A.安装shellclash
用ssh输入命令(2选1)回车根据提示即可安装:
#jsdelivrCDN源
export url='https://fastly.jsdelivr.net/gh/juewuy/ShellClash@master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
#fastgit源
export url='https://raw.fastgit.org/juewuy/ShellClash/master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
putty连接路由并打开clash设置:7-6-6
进阶设置-配置内置dns服务-Dnsmasq转发开启
设置好后重启clash
B.安装adg
winscp连接路由
etc新建文件夹命名AdGuardHome 右键权限0755
解压AdGuardHome并传入AdGuardHome文件夹 右键权限0755
putty输入下列命令:
cd /etc/AdGuardHome
./AdGuardHome -s install
service AdGuardHome enable
访问 192.168.31.1:3000,进入引导流程,继续设置管理端口为3000,dns监听端口设为5353
putty输入下列命令:
iptables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 5353
iptables -t nat -A PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports 5353
iptables-save >/etc/iptables-script
iptables-restore </etc/iptables-script
winscp打开etc/rc.local 在exit 0之前加入:
/usr/sbin/iptables-restore </etc/iptables-script
保存
推荐规则
拦截列表:
https://cdn.jsdelivr.net/gh/banbendalao/ADgk@master/ADgk.txt
https://cdn.jsdelivr.net/gh/privacy-protection-tools/anti-AD@master/anti-ad-easylist.txt
https://cdn.jsdelivr.net/gh/xinggsf/Adblock-Plus-Rule@master/rule.txt
https://cdn.jsdelivr.net/gh/xinggsf/Adblock-Plus-Rule@master/mv.txt
日志不保存或6小时!!!
adg上游dns推荐:
https://doh.pub/dns-query
https://dns.alidns.com/dns-query
https://doh.360.cn/dns-query
Bootstrap DNS推荐:
本地dns
114.114.114.114
223.5.5.5
2400:3200::1