Running DD-WRT V24 SP1 on a Linksys WRT-160N (192.168.101.1). Using
iptables to do a transparent proxy to a squid box (192.168.101.3).
It's working, but the source address of the traffic in the squid logs
is the Linksys and not the originating client IP (hosts on the
192.168.101.0/24 network). Here's the iptables rules I'm using. Any
help appreciated. Thanks.
iptables -t nat -A PREROUTING -i br0 -s 192.168.101.0/24 -d
192.168.101.0/24 -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -i br0 -s ! 192.168.101.3 -p tcp --dport
80 -j DNAT --to 192.168.101.3:3128
iptables -t nat -A POSTROUTING -o br0 -s 192.168.101.0/24 -p tcp -d
192.168.101.3 -j SNAT --to 192.168.101.1
iptables -t filter -I FORWARD -s 192.168.101.0/24 -d 192.168.101.3 -i
br0 -o br0 -p tcp --dport 3128 -j ACCEPT
|