I have a Linux box I use for a firewall with iptables, and I need to put my mail server on the right ip address for proper reverse DNS Lookup.
So I can take inbound packets and NAT them to the mail server, but I need to take outbound packets from the mail server, and send them on a different IP address. The IPTables sends everything out on the same IP, which is 1, but I need 5.
I thinking maybe I could add another gateway, using route, below is my main route, I'd like to add 192.168.3.5 to use a gateway of 18.104.22.168,
Am I on the right track here?, I could use some help on this
/sbin/route add default gw 22.214.171.124 dev eth0
/sbin/route add -net 192.168.3.0 netmask 255.255.255.0 gw 192.168.3.1 dev eth1
I had 2 addresses bound to the mail server adapter, and was only SNAT 1 of them, so I added a SNAT to the other address, and now the mail server responds on the correct ip address for reverse dns and resolves correctly.
So I didn't need a 2nd gateway address, or need to add any additional routing, turned out to be pretty easy. Only took me years to figure out.
I want to take all new smtp packets generated inside the network, and send them out on a different ip address, and not the gateway address, so the ipaddress reverses back to the correct ptr record, indicating it's a mail a server that belongs to my domain.
Right now, the packets go out on the gateway, with a different reverse ptr record.
Last Visit: 31-Dec-99 18:00 Last Update: 29-Aug-14 17:04