[plug] raspberry pi transparent proxy problem iptables redirect (plaintext)

Brett Stephens fhht15687 at yandex.com
Thu Aug 25 21:00:00 AWST 2016


So I'm building a transparent raspberry pi proxy using privoxy (socks5) , tor and openwrt.

Have got it working but none of the iptable redirect rules are working. I know this isn't a new problem, but none of the example solutions online are working.

The idea is someone connects to wifi and the connection gets rerouted to tor without the clients setting up proxies manually or using proxy scripts.

I also have multiple interfaces (subnets) on openwrt which might or might not complicate things.

Client machine:
interface: wlan0-1

raspberry pi proxy server
interface: br-lan
privoxy port: 8118

wireless router openwrt

iptable rules which aren't working:

iptables -t nat -A PREROUTING -i wlan0-1 -s ! -p tcp --dport 80 -j DNAT --to
iptables -t nat -A PREROUTING -i wlan0-1 -s ! -p tcp --dport 443 -j DNAT --to
iptables -t nat -A POSTROUTING -o wlan0-1 -s -d -j SNAT --to
iptables -A FORWARD -s -d -i wlan0-1 -o wlan0-1 -p tcp --dport 8118 -j ACCEPT

They're basically rewritten from: http://www.tldp.org/HOWTO/TransparentProxy-6.html

The setup works if I manually setup socks5 proxies to but the automatic redirects don't work.

Also I've edited the privoxy config file to allow intercepted connections '1'.

Any help would be appreciated.

More information about the plug mailing list