openclash 转发改为TProxy
最近不想用Tun了,但是OpenClash的转发也不是全走的TProxy,TCP走Redirect,UDP走TProxy 这次修改一下防火墙来达到两个协议都用TProxy 1 2iptables -t mangle -N clash_tproxy 3 4iptables -t mangle -A clash_tproxy -p udp -m udp --sport 500 -j RETURN 5iptables -t mangle -A clash_tproxy -i lo -j RETURN 6iptables -t mangle -A clash_tproxy -m set --match-set localnetwork dst -j RETURN 7 8iptables -t mangle -A clash_tproxy -p udp -m udp --dport 53 -j RETURN 9 10iptables -t mangle -A clash_tproxy -d 198.18.0.0/16 -p udp -j TPROXY --on-port 7895 --on-ip 0.0.0.0 --tproxy-mark 0x162 11iptables -t mangle -A clash_tproxy -d 198.18.0.0/16 -p tcp -j TPROXY --on-port 7895 --on-ip 0.0.0.0 --tproxy-mark 0x162 12 13iptables -t mangle -A clash_tproxy -p udp -j TPROXY --on-port 7895 --on-ip 0.0.0.0 --tproxy-mark 0x162 14iptables -t mangle -A clash_tproxy -p tcp -j TPROXY --on-port 7895 --on-ip 0.0.0.0 --tproxy-mark 0x162 15 16iptables -t mangle -N clash_tproxy_output 17 18iptables -t mangle -A clash_tproxy_output -p udp -m udp --sport 500 -j RETURN 19iptables -t mangle -A clash_tproxy_output -d 198.18.0.0/16 -p udp -m owner ! --uid-owner 65534 -j MARK --set-xmark 0x162 20iptables -t mangle -A clash_tproxy_output -d 198.18.0.0/16 -p tcp -m owner ! --uid-owner 65534 -j MARK --set-xmark 0x162 21 22iptables -t mangle -A PREROUTING -j clash_tproxy 23iptables -t mangle -A OUTPUT -j clash_tproxy_output 然后修改OpenClash的系统脚本 ...