Subject: Re: IP masquerade
To: None <current-users@NetBSD.ORG>
From: Geoff Wing <>
List: current-users
Date: 05/25/1997 14:56:34
David Brownlee <> wrote:
:ipnat can do exactly this - assuming you can get a static IP
:address from your ISP (doing it via a dynamic address would be
:more... interesting :) Ipnat is part of ipfilter.

More... interesting?  Given that I haven't really looked at ipnat (or used it),
I would assume you could put something like this in /etc/ppp/ip-up;

/bin/rm .../ip.ppp0	# with ``...'' being whatever directory you want
/bin/echo "map ppp0 10/8 -> $4/32 portmap tcp/udp 10000:20000" > .../ip.ppp0
/usr/sbin/ipnat -f .../ip.ppp0

Then in /etc/ppp/ip-down , you could remove it:

/usr/sbin/ipnat -r -f .../ip.ppp0

Anything else needed?  I suppose you might want make sure there aren't any
static routes pointing to the wrong interface, and you'd want the above to
work only for the selected ppp interface (if you've got more than one) but
those checks are easy enough to put it.
Geoff Wing []   Technical Manager
  Phone    : +61-3-9818 2977         PrimeNet - Internet Consultancy
  Facsimile: +61-3-9819 3788         Web : <URL:>
  Mobile   : 0412 162 441