PaulDotCom mailing list archives

transparent proxy and iptables failing


From: dninja at gmail.com (Robin Wood)
Date: Wed, 7 Oct 2009 09:18:44 +0100

I'm trying to setup a transparent proxy so I've got a linux device
with two NICs which are bridged using brctl. Traffic flows happily
across the bridge so I know it is working fine.

Now when I try to setup the iptables rules they are being ignored. The
rule I want to use is:

iptables -t nat -A PREROUTING -i br-lan -p tcp --dport 80 -j REDIRECT
--to-port 3128

but nothing gets redirected. I've also tried changing 3128 to a port
that is closed to see what would happen, nothing, the packets kept
flowing.

I've also tried clearing the list and then adding

iptables -t nat -A PREROUTING -i br-lan -p tcp --dport 80 -j DROP

which should kill all web traffic but it doesn't. As a last resort I tried

iptables -t nat -A PREROUTING -i br-lan -p tcp -j DROP

which should kill all TCP traffic but again, nothing.

What am I doing wrong?

Robin


Current thread: