I just finished setting up a transparent Squid proxy with a Linux bridge. I thought that a bridge configuration would just forward packets as-is.
I haven't done any iptables configuration that is related to SMTP traffic, but now our mail server is detecting the SMTP connections as coming from the IP of the transparent Squid proxy machine, instead of the external IPs. This has made our firewall rules not work.
Does anyone have any idea what may be happening? Or where to look next to figure out what's going on? Thank you.
EDIT: Ok, I found that one of the lines that I had copied from some tutorial "out there" was causing the NAT masquerade to happen:
iptables -t nat -A POSTROUTING -j MASQUERADE
So I have taken that line off, and it all seems to still work. Here is my iptables configuration now:
#!/bin/bash
SQUIDIP=192.168.111.111
SQUIDPORT=3128
iptables -t nat -A PREROUTING -s $SQUIDIP -p tcp -m multiport --dports 80,84,7880,8080 -j ACCEPT
iptables -t nat -A PREROUTING -s 172.0.0.0/8 -p tcp -m multiport --dports 80,84,7880,8080 -j REDIRECT --to-port $SQUIDPORT
iptables -t nat -A PREROUTING -s 192.168.0.0/16 -p tcp -m multiport --dports 80,84,7880,8080 -j REDIRECT --to-port $SQUIDPORT
# This is the line that was causing the problem:
#iptables -t nat -A POSTROUTING -j MASQUERADE
iptables -t mangle -A PREROUTING -p tcp --dport $SQUIDPORT -j DROP
Can anyone see something that I have missed?