Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Jan 2003 22:23:13 -0500 (EST)
From:      Rich Fox <rich@foxengines.net>
To:        Thaddeus Quintin <tq101100@ohio.edu>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: A twisted home network
Message-ID:  <20030131220137.V714-100000@test_server.no.domain>
In-Reply-To: <188996853.1044039149@[192.168.0.2]>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

let's see here... (You should probably wait to get at least two responses
since I am not feeling real confident about my description here... if they
jive you're alright...)

INET }--{ DLINK Thingie }--{ FBSD BOX }--{ Internal net

Basically, the Dlink is going to get it's outside IP from whatever, be it
DHCP, etc.

The Inside will also have an IP address which I believe you said will be
192.168.0.1, right?

Okay, now the freebsd box...

Set the DLINK NIC (the NIC connecting to the DLINK box) to be
192.168.0.n where n is not the same as the DLINK.
Set the default gateway for the DLINK NIC to be the DLINK Inside address.
(Mine is using DHCP so I don't have a default_gateway setting in my
rc.conf but if I remember from my DSL & dialup days, you do set it)

Set the inside NIC to be something different, say 10.0.0.1
set gateway_enable to "YES" (which I think you already did)

for natd, set the natd_interface to be the DLINK NIC.
(On mine I conveniently have the external nic is xl1 and the inside is xl0
so mine looks like this:

	gateway_enable="YES"
	ifconfig_xl0="inet 192.168.1.18  netmask 255.255.255.0"
	ifconfig_xl1="DHCP"
	[snip]
	natd_enable="YES"
	natd_interface="xl1"
	natd_flags="-l -f /etc/natd.conf"

Now set all of your internal boxes to something matching the 10.0.0.n
phrase where n is not the same as the inside NIC on your FreeBSD box.

Okay, I think I can summarize this coherently...

On the FreeBSD box, the two NICs sort of know about each other.
You configure them independently, and slightly differently.
On the NIC that goes to the outside, you set the default gateway
explicitly. In the Inside NIC, you tell natd essentially what the default
gateway is and natd handles the packets.
(My natd.conf contains redirect directives mostly, I don't think it's
usually necessary.)

Rich.

 | Rich Fox
 | rich@foxengines.net
 | 86 Nobska Road
 | Woods Hole, MA 02543
 | MA 508 548 4358
 | VA 703 201 6050

On Fri, 31 Jan 2003, Thaddeus Quintin wrote:

> There's plenty of information on how to install two network cards (done
> that), how to enable a FreeBSD box to run as a gateway, do NAT, DHCP, etc.
> However, I'm having a mental block with how the cards should be configured.
>
> Here's how I want my network setup-
> CABLE MODEM-> D-link DI-701 Residential Gateway->
> FreeBSD NIC dc0 -> FreeBSD NIC ep1 -> hub -> other computers...
>
> I'd like to leave the D-Link in place, since it has a built-in firewall and
> I'm not ready to start testing out my rules for ipfw.  The D-Link assigns
> IP addresses Dynamically, or I can specify them statically.  By default,
> the D-link has an IP address of 192.168.0.1 and the IP pool goes up from
> there.
>
> Where I get confused is how configure my network cards.  Do I need a new IP
> prefix for the inner network?  If the FreeBSD is a gateway, technically
> each NIC is connected to a different subnet, right?  The card that will
> connect to the hub will need a Static IP address, since nothing is there to
> give an IP address.  Does each NIC know of the other, or are the routing
> tables separate?
>
> This seems like a simple problem, but I've been scouring the handbook,
> freebsd diary, and the man pages, but I can't find any good examples.
>
> Thanks a bunch!
> Thaddeus
>
> 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?20030131220137.V714-100000>