├── README.md ├── firewall-start └── clash-iptable.sh /README.md: -------------------------------------------------------------------------------- 1 | 一个在梅林路由器上安装Clash的简易教程。 2 | 具体操作见 Wiki 部分。 3 | -------------------------------------------------------------------------------- /firewall-start: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | /jffs/scripts/clash-iptable.sh 3 | -------------------------------------------------------------------------------- /clash-iptable.sh: -------------------------------------------------------------------------------- 1 | #Clash auto-launch 2 | start-stop-daemon -S -b -x /jffs/.koolshare/clash -m -p /tmp/clash.pid -- -d /jffs/.koolshare/ 3 | # ports redirect for clash except port 22 for ssh connection 4 | iptables -t nat -A PREROUTING -p tcp --dport 22 -j ACCEPT 5 | #new 6 | iptables -t nat -N CLASH 7 | #Lan related 8 | iptables -t nat -A CLASH -d 192.168.0.0/16 -j RETURN 9 | #redirect to Clash 10 | iptables -t nat -A CLASH -p tcp -j REDIRECT --to-ports 8887 11 | iptables -t nat -A PREROUTING -j CLASH 12 | #DNS 13 | iptables -t nat -A PREROUTING -p udp -m udp --dport 53 -j DNAT --to-destination 192.168.50.1:55 --------------------------------------------------------------------------------