Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 01 Aug 2001 21:49:19 -0400
From:      Matthew Hagerty <mhagerty@voyager.net>
To:        Danny Ho <dannyho@bigpond.net.au>, freebsd-questions@FreeBSD.ORG
Subject:   Re: Natd Complications
Message-ID:  <5.0.2.1.2.20010801212701.024301c0@pop.voyager.net>
In-Reply-To: <3B68B4D5.990A20A4@bigpond.net.au>

next in thread | previous in thread | raw e-mail | index | archive | help
The NATd man page is pretty detailed, so is the handbook, but see below for 
some additional info.

At 12:03 PM 8/2/2001 +1000, Danny Ho wrote:
>Hello
>
>- I have the following in my network
>
>1)
>FreeBSD 4.3
>bpalogin cable modem
>192.168.1.196
>
>2)
>Windows 95
>192.168.1.195
>
>3)
>Windows 95
>192.168.1.197
>
>- Not suprisngly, I want FreeBSD 4.3 to run natd. I have completed the
>following steps
>  below
>
>
>-I have tried compiling the kernel with the follwing:
>
>options IPFIREWALL
>options IPDIVERT

What do you mean "tried" to compile at kernel?  Either you were successful 
or it failed.  If is failed then you have to stop right there until you get 
a successful kernel build.

>- I have add "natd  8668/divert #NAT Socket" to /etc/services
>- I have added natd -interface rl0" in /usr/local/etc/rc.d/nat.sh

You should not have had to edit the /etc/services file, it has had the natd 
entry in it since 3.x releases.

>Question
>
>- What exactly do I do in "redirecting traffic" to natd to get the the
>above FreeBSD 4.3 and Window 95 machines to work?

Complete steps to set-up NATd on a 4.3 install:

Make sure your FreeBSD box has TWO network cards in it.  One should connect 
directly to your cable modem and the other to your internal hub.  Make sure 
both interfaces work and that you can PING the FreeBSD box from your Win 
boxes and that your FreeBSD box can see the Internet via the cable modem.

I assume below that you know how to use the "vi" editor.  If not, use 
whatever you use for editing the files and disregard the "<esc>:wq<enter>" 
steps.

As root:

# cd /sys/i386/conf
# cp GENERIC CUSTOM
# vi CUSTOM

make any changes you need to and add these lines:

options IPFIREWALL
options IPDIVERT

<esc>:wq<enter>

# /usr/sbin/config CUSTOM
# cd ../../compile/CUSTOM
# make depend
# make
# make install

# cd /etc
# vi rc.conf

add these lines:

defaultrouter="x.x.x.x"

firewall_enable="YES"
firewall_type="open"
gateway_enable="YES"
natd_enable="YES"
natd_interface="rl0"

<esc>:wq<enter>

# rm /usr/local/etc/rc.d/nat.sh

# reboot

Make sure you use your EXTERNAL interface (the one connected to the cable 
modem) in the natd_interface= above.  The defaultrouter should be whatever 
your ISP told you.

Set the default gateway of your Win boxes to the INTERNAL interface of your 
FreeBSD box.  Look into IPFW if you feel unsure about running an "open" 
firewall.  Look into adding DHCP for an easier time with your Win boxes.


Matthew


>To Unsubscribe: send mail to majordomo@FreeBSD.org
>with "unsubscribe freebsd-questions" in the body of the message


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5.0.2.1.2.20010801212701.024301c0>