IPTABLES FW Forward to Exchange Svr
Any help here would be greatly appreciated.
I have a linux (RHEL4) FW using IPTABLES
I am forwarding packets from external interface to internal Exchange Server
Exchange server sees all mail as coming from FW box (192.168.192.1)
From mail header:
Received: from pccarlos.lan (192.168.192.1)
So, I cannot do reverse lookups, and worse (imagine that) spam filters are not working correctly.
I need to forward these packets without altering the IP
Other than the Exchange server seeing all mail as coming from the FW the below code is working.
Any help much appreciated.
$SMTP is eth1:16 (EXTERNAL IP)
$INTERNALIF is eth0 (INTERNAL IP)
192.168.192.1 is just IP address of eth0 (same as $INTERNALIF)
$IPTABLES -A FORWARD -i $SMTP -p tcp -m state --state NEW -d 192.168.193.7 -j ACCEPT
$IPTABLES -A FORWARD -i $SMTP -o $INTERNALIF -d 192.168.193.7 -p tcp -j ACCEPT
$IPTABLES -A FORWARD -i $INTERNALIF -o $SMTP -d 0.0.0.0/0.0.0.0 -s 192.168.193.7 -j ACCEPT
$IPTABLES -t nat -A PREROUTING -d $SMTP -p tcp -j DNAT --to 192.168.193.7
$IPTABLES -A POSTROUTING -t nat -d 192.168.193.7 -j SNAT --to 192.168.192.1