[KLUG Members] iptables NAT problem

Phillip Hofmeister plhofmei at antiochcomputerconsulting.com
Wed Jun 30 10:48:51 EDT 2004


On Wed, 30 Jun 2004 at 10:34:20AM -0400, John Pesce wrote:
> Hi all,

Hello
> eth0 192.168.3.1
> eth1 10.7.35.2
> eth2 192.168.2.1
> 
> It sounds like I should setup some kind of NAT POSTROUTE to rewrite the
> source address on packets leaving the eth1 interface destined for 224.*
> to a source IP of eth1 ?


The NAT Table sounds like the best approach.  Try:

iptables -t nat -A POSTROUTING -o eth1 -s 192.168.0.0/22 -j MASQUERADE

That one iptable entry will MASQ any address between 192.168.0.0 and
192.168.3.255.  Make sure the proper entries in the FORWARD chain are
set up to allow traffic from eth0 and eth2 to get to eth1.

HTH,

-- 
Phillip Hofmeister

PGP/GPG Key:
http://www.zionlth.org/~plhofmei/
wget -O - http://www.zionlth.org/~plhofmei/key.asc | gpg --import


More information about the Members mailing list