forwarding port 25 to internal SMTP server

Phil Barbier p.barbier@online-bills.com
Fri, 7 Dec 2001 12:50:43 -0000


Hi There,

iptables -A INPUT -i $EXTERNAL_INTERFACE -p tcp --dport 25 --destination
$EXTERNALIP -j ACCEPT 

iptables -t nat -A PREROUTING -d $EXTERNALIP -p tcp --dport 25 -j DNAT --to
10.105.105.21 

These two should work fine - you need to accept traffic for the External IP,
as that is where the clients "think" that the mail is going to, they don't
know about your 10.x.x.x network.

This is assuming your OUTPUT rule on the filter table is set to ACCEPT.

iptables -A INPUT -j ACCEPT -p tcp --sport 25 -s 10.105.105.21 -d 0.0.0.0/0

You'll probably want to add support in there for SYN packets.

Hope this helps,

Phil Barbier.

--
Phil Barbier
Registered Linux User #227794
Web Developer & Linux Systems Administrator
Online-Bills Ltd
http://www.online-bills.com/
mailto:p.barbier@online-bills.com?subject=from_email