Subject: IPNAT with just one ethernet card?
To: None <netbsd-help@netbsd.org>
From: Zach Fine <czyz@u.washington.edu>
List: netbsd-help
Date: 02/28/1999 19:29:02
Here's my situation. I've just gotten one static IP address over a DSL
connection, and have one ethernet card in my machine. I've plugged the
DSL modem into one port on the hub, run a line from my ethernet card
to another port on the hub, and run a line from my housemate's Win98
box to the hub. I've beena able to configure things so that my machine
can see and be seen from the internet at large, but have as yet been
unable to get ipnat working so that my machine can function as a
gateway for my admittedly small intranet.

Here's a few relevant numbers:
my assigned, static IP#:	207.207.83.53
my gateway at my ISP:		207.207.83.54
the IP# I've set on
my housemate's computer:	192.158.1.2

Is it necessary for me to purchase a second ethernet card in order to
make this happen? Can I instead do something clever along the lines of
'ifconfig ep0 inet alias 192.168.1.1 netmask 255.255.255.0' in order
to have my ethernet card accept connections as both 192.168.1.1 and
207.207.83.53?

Thanks for any help or information. I'm appending to the end of this
message some more info about my configuration in case anyone has any
bright ideas.

Thanks.
-Zach Fine
czyz@u.washington.edu

here are the uncommented lines from /etc/hosts:
127.0.0.1		localhost localhost.stupidhorses.com
207.207.83.53		jehosephat xdsl014.serv.net
207.207.83.54		serv.net
192.168.1.2		ra	   ra.stupidhorses.com

"" from /etc/resolv.conf:
domain serv.net
search u.washington.edu washington.edu amazon.com serv.net
stupidhorses.com
nameserver 204.177.154.23
nameserver 199.201.191.1
nameserver 199.201.191.2
nameserver 128.95.120.1
lookup file bind

from /etc/ifconfig.ep0 (my ethernet card):
inet 207.207.83.53 netmask 255.255.255.252

from /etc/ipnat.conf:
map ep0 192.168.1.2/32 -> 207.207.83.53/32 portmap tcp/udp 10000:40000

the output of 'ifconfig -a' with my current configuration:
ep0: flags=8863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        address: 00:a0:24:ba:5f:2d
        media: 10baseT/UTP status: active
        inet 207.207.83.53 netmask 0xfffffffc broadcast 207.207.83.55
lo0: flags=8009<UP,LOOPBACK,MULTICAST> mtu 32976
        inet 127.0.0.1 netmask 0xff000000 
ppp0: flags=8010<POINTOPOINT,MULTICAST> mtu 1500
ppp1: flags=8010<POINTOPOINT,MULTICAST> mtu 1500
sl0: flags=c010<POINTOPOINT,LINK2,MULTICAST> mtu 296
sl1: flags=c010<POINTOPOINT,LINK2,MULTICAST> mtu 296
strip0: flags=0<> mtu 1100
strip1: flags=0<> mtu 1100
tun0: flags=10<POINTOPOINT> mtu 1500
tun1: flags=10<POINTOPOINT> mtu 1500
eon0: flags=3<UP,BROADCAST> mtu 1500