One to One Nat, one more try

Ray ray@ops.selu.edu
Fri, 6 Jul 2001 10:12:14 -0500 (CDT)


On Thu, 5 Jul 2001, [iso-8859-1] Daniel El=EDas Robles wrote:

> This is mi setting
>=20
> eth0 209.100.xxx.5-10,   5 virtual Interfaces
> eth1 172.16.4.0/22
>=20
> I want to map 209.100.119.6 to 172.16.4.9 and vice.

Elias,

This is my NAT rule doing a similar one-to-one NAT mapping.  It maps a
public address to a private 172 address:

/sbin/ip address add 10.41.200.1 dev eth1
/usr/local/sbin/iptables -t nat -A POSTROUTING -s xxx.xxx.6.79 -o eth1 \
                 -j SNAT --to 10.41.200.1

The ip address alias is needed so the firewall will answer arp requests
for that address, so the returning traffic will correctly get sent back to
the firewall/router.  Not sure if you need it, but this had me stumped for
a while...

-Ray
=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D=
-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D
Ray DeJean  =09=09=09=09       =09 http://www.r-a-y.org
Systems Administrator               Southeastern Louisiana University
IBM Certified Specialist  =09      AIX Administration, AIX Support
=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D=
-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D