我已经configuration了一个鱿鱼透明tproxy 。 一切正常。
现在我需要所有的stream量去外部IP(互联网)不通过代理。
我是否需要修改iptables,ebetables规则或更改squid的configuration?
我发现这个教程 ,但它不使用tproxy规则。
iptables规则:
iptables -F -t mangle iptables -X -t mangle iptables -t mangle -N DIVERT iptables -t mangle -A PREROUTING -p tcp -m socket -j DIVERT iptables -t mangle -A DIVERT -j MARK --set-mark 1 iptables -t mangle -A DIVERT -j ACCEPT iptables -t mangle -A PREROUTING -p tcp --dport 80 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3129
ebtables规则:
ebtables -t broute -A BROUTING -i eth1 -p ipv4 --ip-proto tcp --ip-dport 80 -j redirect --redirect-target DROP ebtables -t broute -A BROUTING -i eth0 -p ipv4 --ip-proto tcp --ip-sport 80 -j redirect --redirect-target DROP
看起来我需要在第一个ebtables规则之前插入旁路规则。 那是对的吗?
这些规则是否有效?
ebtables -t broute -A BROUTING -i eth1 -p ipv4 --ip-proto -d IP_dest -j ACCEPT ebtables -t broute -A BROUTING -i eth0 -p ipv4 --ip-proto -s IP_dest -j ACCEPT