Subject: Fwd: nat with dynamic ip address
To: None <netbsd-help@netbsd.org>
From: Rick McCombs <rick.mccombs@gmail.com>
List: netbsd-help
Date: 01/10/2006 15:44:20
I tried to send this once and gmail gave some error so I hope you
don't see this twice.


I'm using a Pentium II with NetBSD 3.0 to connect to the
Internet with a modem and ppp and I have a computer running
Windows XP that is connected to the computer that is running
NetBSD with ethernet. The NetBSD box is 192.168.0.1 on the
ethernet and the Win XP is 192.168.0.2

I Have been trying to use nat to allow them both to access
the internet at the same time but If I reboot the NetBSD computer
or redial sometimes I can get the nat to work.

when I use map ppp0 is there something I need to do so that
when the address for ppp0 changes the nat will keep working?


Here are my setup files.

#!/sbin/sysctl -f
#
# $NetBSD: sysctl.conf,v 1.5 2003/11/03 15:12:06 briggs Exp $
#
# sysctl(8) variables to set at boot time.

# Default core name template:
#kern.defcorename=3D%n.core

# Number of kernel threads to use for NFS client
#vfs.nfs.iothreads=3D4
net.inet.ip.forwarding=3D1
net.inet.tcp.recvspace=3D65535
net.inet.tcp.sendspace=3D65535





# Load the defaults in from /etc/defaults/rc.conf (if it's readable).
# These can be overridden below.
#
if [ -r /etc/defaults/rc.conf ]; then
        . /etc/defaults/rc.conf
fi

# If this is not set to YES, the system will drop into single-user mode.
#
rc_configured=3DYES

# Add local overrides below
#
wscons=3DYES
hostname=3Dshop
auto_ifconfig=3DYES
ifconfig_tlp0=3D"inet 192.168.0.1 netmask 255.255.255.0"
ipfilter=3DYES
ipnat=3DYES
named=3DYES
sshd=3DYES
sendmail=3DNO


#ipnat.conf
map ppp0 192.168.0.0/24 -> 0/32 proxy port ftp ftp/tcp
map ppp0 192.168.0.0/24 -> 0/32 portmap tcp/udp 40000:60000
map ppp0 192.168.0.0/24 -> 0/32


#ipf.conf
pass in from any to any
pass out from any to any