[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ipnat



>hi, i am writing about ipnat.rules. I have read all examples about it
>and the manual pages.
>I did many try and get always an "invalid map rules" or "invalid
>netmask" at the boot.
>so, if someone know well ipnat rules, your help will be appreciate.
>I wanna share all tcp connections from ppp0 interface to the ethernet
>address 10.0.0.2
>(ed4 interface).My connection to the net is dynamic
>what is the exact syntax i have to put in the ipnat.rules file.
>thanks.

The exact command is already in the /etc/ipnat.rules file, just
uncomment it.  I have found also that the command does NOT work unless I
have a kernel with only *1* ppp pseudo-device.  Has anybody else seen
this?  Anyway, to get it to work, I

1) Rebuilt my kernel with the GATEWAY option and 1 ppp pseudo-device.

2) Put a script called "ip-up" in /etc/ppp which contains the following
from /etc/netstart:

if [ -f /etc/rc.conf ]; then

        . /etc/rc.conf

        if [ X"${ipnat}" = X"YES" -a -f "${ipnat_rules}" ]; then
                ipnat -CF -f ${ipnat_rules}
        fi
fi 

3) Then uncommented the line in /etc/ipnat.rules

4) Make a ppp connection.

Everything worked as it should.  In fact my gateway even has the ip
address 10.0.0.2!  I spent a week trying to get this same set up to work
in FreeBSD, so I am greatful that it was so easy in OpenBSD.

Aaron Jackson		jackson@msrce.howard.edu