Running into an issue with my iptable rule to redirect outbound traffic on port 80 to a squid proxy transparently.
Here is my interface information
eth0 = internet eth1 = physical interface eth1:0 = 192.168.0.1/24 eth1:1 = 172.16.0.0/24
My iptables rule:
iptables -t nat -A PREROUTING -s 192.168.0.0/24 ! -d 172.16.0.5/32 -p tcp --dport 80 -j DNAT --to-destination 172.16.0.5:8080
squid proxy's socket 172.16.0.5:8080
#bind address http_port 172.16.0.5:8080
Issue, while the squid proxy is pingable from an addresson the 192.168.0.0/24 network, when I enable the above iptables rule to turn on transparent proxy, websites hang and never load.
I understand that iptables does not support virtual interfaces filtering, so the iptables rule needs to include IP information to filter the rule. This is why I included the -s and -d with each network. Effectively only triggering this rule when the source IP is in the 192.168.0.0/24 network and NOT destined for the 172.16.0.0/24 network.