Monday, October 02, 2006

Linux tools is so neat

So, my little internet connection at home is a Telkom ADSL line. It is driven by a Open-WRT enabled Linksys WRT54G routers. For a while now, I wanted to do proper transparent proxy on it. But my proxy server is on a different machine. Then I found this helpfull howto that works just great.

On my linksys firewall I add this to /etc/firewall.user:

#method 2
iptables -t mangle -A PREROUTING -j ACCEPT -p tcp --dport 80 -s 192.168.22.3
iptables -t mangle -A PREROUTING -j MARK --set-mark 3 -p tcp --dport 80
ip rule add fwmark 3 table 2
ip route add default via 192.168.22.3 dev br0 table 2


And I also add this to my proxy machine:
iptables -A PREROUTING -t nat -p tcp -s 192.168.0.0/16 --dport 80 -j REDIRECT --to-port 3128


And that is it...

No comments: