Subject: Re: Basic IPNAT Question(s)
To: Michael Gorsuch <mgorsuch@fogcreek.com>
From: Sigmund Skjelnes <skjelnes@robin.no>
List: netbsd-help
Date: 10/19/2006 21:54:09
Well, I'm not well into the ipnat business, but I'd have had an real
fight with my wireless router this evening. 

Maybe it's an good idea to describe my system before getting any
further. I'd have an ethernet 10.0.0.0/24 which have an adsl router
10.0.0.5 to the internett. I'd put an wireless router on that net, and
assigned a static ip adress 10.0.0.5 to it. The lan side of the wireless
router is 192.168.1.254/24. And I'd have an laptop with an wireless
card, currently assigned 192.168.1.1

I'd can ping any address in the 10.0.0.0 network from the laptop, and
I'd can access the internett from the laptop too. From the host 10.0.0.3
I'd can only ping 10.0.0.5 and any other host on 10.0.0.0 net or
internett, but not 192.168.1.0 network. A route to the 192.168.1.0 net
is set up on the 10.0.0.3 host, of course. 

But I'd could add as many hosts I'd want to ( limited by router
capasity, etc. ), to the wlan, and they all share the 10.0.0.5 address
as seem from the 10.0.0.0 network. This is how ipnat works, it let you
have many hosts, but is limited to one way access. I'd tried to access
an MySQL database on the laptop from the outer net, but that is only
possible if I'd set up an "virtual server" on the wireless router. 

It seems like the only option is to not use ipnat unless it's for the
internett router, cause the available number of internett ip adresses
are limited. 

Maybe I'll experiment with the wlan. It should be ok to communicate host
to host on the wlan as on any other network, maybe I'd could use another
host as an router between the 10.0.0.0 net and the wlan...

Cincerely, 
Sigmund

Thu, 19,.10.2006 kl. 09.46 -0400, skrev Michael Gorsuch:
> My simple config is below:
> 
> host1:
> pcn0: 192.168.1.1/24
> pcn1: 10.1.1.1/24
> pcn2: 10.1.2.1/24
> 
> host2:
> pcn0: 10.1.1.10/24
> 
> host3:
> pcn2: 10.1.2.10/24
> 
> Obviously, host1 is the gateway, host2 is connected via pcn1, and host3 
> is connected via pcn2. 
> 
> pcn0 is considered to be the 'outside world' for this exercise.
> 
> I need 192.168.1.10 to bimap to10.1.1.10, so I set the following up in 
> /etc/ipnat.conf:
> 
> bimap pcn0 10.1.1.10/32 -> 192.168.1.10/32
> 
> I have set 'ipnat=yes' and run /etc/rc.d/ipnat start.  Everything seems 
> to be running, but my external hosts can't ping that IP.
> 
> Do I need to alias 192.168.1.10 to pcn0?  Things seems to work when I do 
> that, but I am not sure that I am doing things correctly.
> 
> Also, what steps need to be taken to allow systems on pcn2 to reach 
> 10.1.1.10 via 192.168.1.10?  Do I need to set up NAT on pcn2 as well?
> 
> Thank you,
> 
> Michael