I'm trying to test an internal mail server. My production one is also inside the same firewall. I have two domains.
Mydomain.com
Mydomain.net
They both work fine.
My question is I would like the firewall to be able to route the incomming mail to the proper mail server.
For instance mail comming to
Mydomain.com would hit the firewall and the firewall would forward it to mail.Mydomain.com. If mail comming to mail.Mydomain.net hit the firewall it would rout it to its mail server.
My current rules work individually, meaning I can do one server but not the other. Heres what the single looks like.
#Forwarding related to mail:
iptables -A FORWARD -i $EXTIF -o $INTIF -p tcp -d $INTSMTP --dport 25 -j ACCEPT
#Forwarding incomming SMTP connections:
iptables -t nat -A PREROUTING -i $EXTIF -p tcp -d $EXTIP --dport 25 -j DNAT --to $INTSMTP:25
Any ideas?
Cheers,
Scully