[plug] raspberry pi transparent proxy problem iptables redirect (plaintext)
Brett Stephens
fhht15687 at yandex.com
Thu Aug 25 21:00:00 AWST 2016
Hi,
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
ip: 192.168.9.168
raspberry pi proxy server
interface: br-lan
ip: 192.168.1.105
privoxy port: 8118
wireless router openwrt
iptable rules which aren't working:
iptables -t nat -A PREROUTING -i wlan0-1 -s ! 192.168.1.105 -p tcp --dport 80 -j DNAT --to 192.168.1.105:8118
iptables -t nat -A PREROUTING -i wlan0-1 -s ! 192.168.1.105 -p tcp --dport 443 -j DNAT --to 192.168.1.105:8118
iptables -t nat -A POSTROUTING -o wlan0-1 -s 192.168.9.0/24 -d 192.168.1.55 -j SNAT --to 192.168.9.1
iptables -A FORWARD -s 192.168.9.1/24 -d 192.168.1.55 -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 192.168.1.105:8118 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