|
本帖最后由 rehai 于 2014-9-10 00:52 编辑
此方法需要wgetpro的支持,如果固件没有wgetpro版的话,需要自己安装pro版。教程请百度。
首先在tomato 高级设置>>DHCP / DNS中把"启用内置DNS服务器"和"截获DNS端口(UDP 53)"两项打钩保存。
再用telnet或ssh登录路由linux系统
然后逐条运行
- wget --no-check-certificate -O - https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt |
- grep ^\|\|[^\*]*\^$ |
- sed -e 's:||:address\=\/:' -e 's:\^:/127\.0\.0\.1:' >> /etc/dnsmasq.custom
- killall dnsmasq
- service dnsmasq restart
-
复制代码
完了之后默认过滤脚本就做好了
我后在tomato 系统设置>>定时重启/连接中 把"自定义1"打钩,下面的时间选"720分钟",在下面文本框中填入以下内容:
- wget --no-check-certificate -O - https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt |
- grep ^\|\|[^\*]*\^$ |
- sed -e 's:||:address\=\/:' -e 's:\^:/127\.0\.0\.1:' >> /etc/dnsmasq.custom
- killall dnsmasq
- service dnsmasq restart
-
复制代码
以上是每隔12小时在线刷新一次过滤脚本。保存后路由器就可以过滤广告了!
因为abp脚本本来就不是针对dnsmasq做的,过滤效果没有原生的浏览器端abp这么强。
抛个砖,如果谁有更好的办法在路由器上过滤广告,请分享一下哦!
|
|