This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
allow_ip="0.0.0.0/8,100.64.0.0/10,127.0.0.0/8,169.254.0.0/16,192.0.0.0/24,192.0.2.0/24,192.88.99.0/24,198.18.0.0/15,198.51.100.0/24,203.0.113.0/24,172.16.0.0/12,192.168.0.0/16,10.0.0.0/8,224.0.0.0/3" | |
iptables -t mangle -I OUTPUT -d 1.2.0.0/16 -j MARK --set-mark 0x1100 | |
iptables -t mangle -I PREROUTING -i lo -p tcp -j TPROXY --on-port 555 --tproxy-mark 0x1100 | |
iptables -t mangle -I PREROUTING -i lo -p udp -j TPROXY --on-port 555 --tproxy-mark 0x1100 | |
iptables -t mangle -I PREROUTING -d $allow_ip -j ACCEPT | |
ip route add local default dev lo table 1100 | |
ip rule add fwmark 0x1100 lookup 1100 | |
*/ |