Subject: NAT Trouble
To: None <port-i386@netbsd.org>
From: James Snow <sno@flesh.net>
List: port-i386
Date: 10/22/1998 10:08:49
Thanks to everyone who helped me with my com port/modem problem. I've
subsequently set up PPP without a hitch, but following the directions for
NAT has got me stumped.

I've got ipfilter compiled into the kernel., and I have it enabled in
/etc/rc.conf. I have an empty /etc/ipf.conf, the following in
/etc/netstart.local:

   if [ -f /etc/ipnat.conf ]; then
                  echo 'starting IP network address translation (ipnat)...';
                  /usr/sbin/ipnat -f /etc/ipnat.conf
        fi

and the following in /etc/ipnat.conf:

map ppp0 10.0.0.0/24 -> 0/32 portmap tcp/udp 40000:60000
map ppp0 10.0.0.0/24 -> 0/32

I'm a little confused about those numbers following the portmap command.
Do they represent the range of ports that the machine will resend NATed
packets from or the range of ports that a packet to be NATed must be
coming from?

Back to the NAT problem though, with the above setup and one of the other
machines here set to use the NetBSD box as its gateway, nothing happens.
The output of ipnat -ls remains as follows:

mapped  in      0       out     0
added   0       expired 0
inuse   0
rules   2
List of active MAP/Redirect filters:
map ppp0 10.0.0.0/24  -> 0.0.0.0/32  portmap tcp/udp 40000:60000
map ppp0 10.0.0.0/24  -> 0.0.0.0/32 

List of active sessions:

I can verify with tcpdump that the client machine is indeed making
requests and they are making it to the gateway, but the NAT doesn't seem
to see tem at all.

Anyone have any ideas?


Thanks in advance,
James Snow