Published February 13th, 2003 by Jim O'Halloran
IPTables NAT
I had problems doing a simple port forward using iptables NAT today. I had everything in iptables setu up the same way as another machine which was doing similar forwards, but it just didn’t want to work.
In the end, I’d forgotten to…
echo 1 > /proc/sys/net/ipv4/ip_forward
To enable IP Forwarding. The Linux 2.4 NAT HOWTO doesn’t seem to mention this, and perhaps should.
phsieh Says
Hi, Jim,
I am planning to use MS Exchange 2000 server(on another server running win 2000 server). Also, all PC on the private network would like to connect to the internet through the Linux box. How do I set it up using iptables? Could you please explain? Thanks!
phsieh
Feb 19th, 2003 at 11:25 pm
Jim Says
phsieh, see http://humboldt.kendle.com.au/weblog/archives/000120.html for an answer to your question.
Jim.
Feb 20th, 2003 at 12:17 pm
Herman Says
Hi:
I am trying to replace my cisco with a RH9 box. I have everything working except for nat.
Eth0 is an ADSL line into the box.
Eth1 is a connection to a catalyst switch feeding 11 work stations.
I use the following script, and nothing works. Well, Squid works, we can surf the net, but that is about it. Any comments?
=============================================
iptables –flush
iptables –table nat –flush
iptables –delete-chain
iptables –table nat –delete-chain
iptables –table nat –append POSTROUTING –out-interface eth0 -j MASQUERADE
iptables –append FORWARD –in-interface eth1 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
Oct 27th, 2003 at 6:46 pm
Francis S Victor Says
iptables -t nat -A POSTROUTING -O ETH0 -J masquerade
Nov 7th, 2003 at 5:01 pm
Shannon Wynter Says
if you’ve denied everything by default you need the following
iptables -I FORWARD -m state –state established,related -j ACCEPT
Apr 15th, 2005 at 1:09 pm
Leif Madsen Says
This is an old post, but it was the first link on Google, and was exactly what I’d forgotten too, lol. Thanks!
Apr 22nd, 2005 at 9:51 am