Subject: Re: IP routing and masqurading (?)
To: Johan =?iso-8859-1?Q?B=E5ng?= <jbong@hem2.passagen.se>
From: Bruce Walker <bmw@visgen.com>
List: netbsd-help
Date: 08/17/1998 07:34:12
Johan =?iso-8859-1?Q?B=E5ng?= writes:
> 
> I am thinking of trying netBSD, but I have a small problem.
> 
> I have one connection to interenet (static ip) and i run a subnet with some
> computers.
> Now the question, Is that possible and where do I find info about what to do? 

Having just got it working myself, I can help you.
Yes, your single static IP address is just fine for NAT.

First get or build a kernel with these kernel options enabled:

 options       GATEWAY         # packet forwarding
 options       IPFILTER_LOG    # ipmon(8) log support

By the way, if you are building and rebuilding incrementally, be
sure and do a "make clean" before the "make depend; make".  Failing
to do a "make clean" stymied me earlier this weekend.  I ended up
with a half-functioning NAT.

Read the man pages: ipnat(8), ipnat.conf(5)
Additionally, there are some examples in /usr/share/examples/ipf.

If you are dialing up with ppp, you will likely end up with these
NAT rules:

[excerpt from /usr/share/examples/ipf/BASIC.NAT]
  # ppp0 - (external) PPP connection to ISP, address a.b.c.d/32
  # ed0 - (internal) network interface, address w.x.y.z/32
  #
  # If we have only 1 valid IP address from our ISP, then we do this:
  #
  map ppp0 w.x.y.z/24 -> a.b.c.d/32 portmap tcp/udp 40000:60000
  map ppp0 w.x.y.z/24 -> a.b.c.d/32


> I have tried to access a IP-NAT howto pages, but I couldn't view them....

If you mean...

  http://radon.moof.ai.mit.edu/~armenb/ipnat.html 

they worked on Saturday, but I see err 403 today, so try again in
a day or two.

-bmw