From owner-freebsd-questions Fri Jan 31 16:45:32 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 143EC37B401 for ; Fri, 31 Jan 2003 16:45:30 -0800 (PST) Received: from mired.org (ip68-97-54-220.ok.ok.cox.net [68.97.54.220]) by mx1.FreeBSD.org (Postfix) with SMTP id DE55443F3F for ; Fri, 31 Jan 2003 16:45:28 -0800 (PST) (envelope-from mwm-dated-1044492328.f41897@mired.org) Received: (qmail 26736 invoked from network); 1 Feb 2003 00:45:28 -0000 Received: from localhost.mired.org (HELO guru.mired.org) (127.0.0.1) by localhost.mired.org with SMTP; 1 Feb 2003 00:45:28 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15931.6311.627786.913544@guru.mired.org> Date: Fri, 31 Jan 2003 18:45:27 -0600 To: Thaddeus Quintin Cc: freebsd-questions@FreeBSD.ORG Subject: Re: A twisted home network In-Reply-To: <188996853.1044039149@[192.168.0.2]> References: <3E3B05AD.90805@attbi.com> <188996853.1044039149@[192.168.0.2]> X-Mailer: VM 7.07 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`; h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ From: Mike Meyer X-Delivery-Agent: TMDA/0.68 (Shut Out) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In <188996853.1044039149@[192.168.0.2]>, Thaddeus Quintin 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. 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