Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Jan 2003 18:45:27 -0600
From:      Mike Meyer <mwm-dated-1044492328.f41897@mired.org>
To:        Thaddeus Quintin <tq101100@ohio.edu>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: A twisted home network
Message-ID:  <15931.6311.627786.913544@guru.mired.org>
In-Reply-To: <188996853.1044039149@[192.168.0.2]>
References:  <3E3B05AD.90805@attbi.com> <188996853.1044039149@[192.168.0.2]>

next in thread | previous in thread | raw e-mail | index | archive | help
In <188996853.1044039149@[192.168.0.2]>, Thaddeus Quintin <tq101100@ohio.edu> typed:
> 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...
> 
> Where I get confused is how configure my network cards.  Do I need a new IP 
> prefix for the inner network?

That's one way to solve it. You need two subnets.

> If the FreeBSD is a gateway, technically each NIC is connected to a
> different subnet, right?

Right. In fact, FreeBSD gets upset if they aren't connected to
different subnets.

> The card that will connect to the hub will need a Static IP address,
> since nothing is there to give an IP address.

Right.

> Does each NIC know of the other, or are the routing tables separate?

NICs don't have routing tables. The system has a routing table, and
knows about both nics.

> 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.

Call the dc0 side of the FreeBSD box subnet 0. Call the ep0 side
subnet 1 . Let's use the same prefix (192.168) for all the subnets,
and set up for 256 subnets of 256 hosts.

The dlink is 192.168.0.1, so it's already right for subnet 0. Give the
dc0 the IP address of 192.168.0.2. Or let dchp assign it to any value
on 192.168.0.2.

Ep1 is on subnet 1, so lets make it host 1, and give it the address of
192.168.1.1. The other hosts on subnet 1 must have addresses on
192.168.1. Their default router will be 192.168.1.1.

The netmask for dc0, ep1 and all hosts on subnet 1 is
255.255.255.0.

The dlink will need to know that the route to 192.168.1 is via
192.168.0.2. Without knowing details on it, I can't say how to set
things up to give it that information.

I also note that my dlink - a cable/DSL router - only understands
192.168.0 addresses. If that's the case, you'll have to subnet
192.168.0, not 192.168. as I just demonstrated. That would look like
dc0 being 192.168.0.2, ep1 being 192.168.0.129, other on subnet 1
having last bytes greater than 130, and everybody having a netmask of
255.255.255.128.

	<mike
-- 
Mike Meyer <mwm@mired.org>		http://www.mired.org/consulting.html
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

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?15931.6311.627786.913544>