I need help routing and forwarding SMTP traffic across my firewall:
 
I have a firewall using iptables with a public(eth0) and a private interface(eth1).  The private interface is connected to a web server that needs to be able to only send outgoing mail- the web server does not need to be able to check mail or access anyone's mail account.
 
I need a list of the iptables commands needed to allow outgoing SMTP requests from the internal web server to pass through this firewall to a mail server on the public network. 
 
My current setup script looks like this:
 
iptables --flush
iptables -t nat --flush
iptables -t mangle --flush
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -A INPUT -j DROP ! -i eth0 -s 129.81.1.1/255.255.0.0
iptables -t nat -A PREROUTING -i eth0 -p tcp --sport 1024:65535 -d 129.81.201.10 --dport 80 -j DNAT --to-destination 192.168.1.2
iptables -A FORWARD -i eth0 -o eth1 -p tcp --sport 1024:65535 -d 192.168.1.2 --dport 80 -m state --state NEW -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables-save
HTTP requests and responses are moving back and forth nicely.  I just need to get SMTP setup.
Any help is greatly appreciated.
 
Thanks,
 
Bryan J. Snow

Reply via email to