SOLVED: NEWBIE: FreeBSD 4.10 Internet gateway/DNS problem

James A. Coulter james.coulter at cox.net
Thu Jul 22 17:56:54 PDT 2004


> > On Tue, Jul 13, 2004 at 10:51:21AM -0500, James A. Coulter wrote:
> > >
> > >I am trying to setup my FreeBSD 4.10 box as an internet gateway for a
> > > small home LAN (2x Win XP and 1x Win 98SE)
> > >
> > >The LAN operates without any problems when using the Win 98SE box as a
> > >gateway - all computers can access the internet
> > >
> > >I have two nics installed in the FreeBSD box:
> > >
> > >	dc0 is the LAN interface via 4-port Linksys hub
> > >
> > >	dc1 is the WAN interface via cable modem
> > >
> > >I have successfully connected to the internet with dc1
> > >
> > >I can ping all other machines on my home LAN with dc0 and vice versa
> > >
> > >I cannot access the internet from any machine except the FreeBSD
> gateway
> > >
> > >ifconfig looks like this:
> > >

<snip>

> > >
> > >I'm not sure what to do next.  For some reason the Windows cannot
> access a
> > >name server.  From what I understand from the literature I've been
> using
> > >(FreeBSD Handbook, Lehey's The Complete FreeBSD, and Anderson's
> FreeBSD:
> > > An Open-Source etc etc) all that should be needed is set
> > > gateway_enable="YES" in /etc/rc.conf and I've done that.
> > >
> > >Google revealed some info on using natd for PPOE, but not sure if that
> > >applies to this problem.
> >
> > Definitely you must use NAT. Search Handbook for Network Address
> > Translation.
> >
> > >All suggestions/out-right solutions appreciated.
> > >
> > >TIA,
> > >
> > >Jim C.
> > >
> Hello.
> You might try something like this in your /etc/rc.conf :
> gateway_enable="YES"
> ifconfig_dc1="DHCP"
> dhcp_program="/sbin/dhclient"
> dhcp_flags="-q"
> ifconfig_dc0="inet 192.168.1.1 netmask 255.255.255.0"
> natd_enable="YES"
> natd_interface="dc0"
> natd_flags="-dynamic"
> And if you like some little protection :
> firewall_enable="YES"
> firewall_script="/etc/rc.firewall"
> firewall_type="OPEN"
> firewall_logging="YES"
> And it's never wrong to spend some time reading the man pages :-)
> Don't forget to put the IP of your Gateway on the Winboxes.
> /Hasse

Sorry for the very late response and thanks very much for the suggestions to
check out NAT.  That was of course the problem.  Being a newbie and
life-long Windows user, I thought gateway_enable="YES" in rc.conf was the
magic word.  But it isn't and I read up on NAT and natd and built a custom
kernel with:

options IPFIREWALL
options IPDIVERT

and made the changes to rc.conf as detailed above and now my FreeBSD box is
passing packets back and forth from all the Windows boxes on my LAN to the
WAN beautifully.

Thanks again for your help!

Jim C.



More information about the freebsd-questions mailing list