On the raspberry Pi, I install the privoxy and a socks proxy software.
I want to redirect all the traffic to the chain REDSOCKS_FILTER. The traffic of tcp protocol of port 80 from all the traffic will go through the privoxy and then to the chain REDSOCKS_FILTER. In the chain REDSOCKS_FILTER, I will discard some local ip address and finally the processed traffic go to the socks proxy software.
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8118 iptables -t nat -A OUTPUT -p tcp --dport 8118 -j REDSOCKS_FILTER iptables -t nat -A PREROUTING -p tcp -j REDSOCKS_FILTER
I try to write thease but the traffic of port 80 which go through privoxy cannot go to the REDSOCKS_FILTER chain. But if I type
iptables -t nat -A OUTPUT -p tcp --dport 8118 -j REDSOCKS_FILTER
It seems that it can't work from my test and still has the same result. I am puzzled for what mistake I have made.