From owner-freebsd-questions Fri Jan 31 16:11:57 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 72A1E37B401 for ; Fri, 31 Jan 2003 16:11:55 -0800 (PST) Received: from pa-plum1b-166.pit.adelphia.net (pa-plum1b-166.pit.adelphia.net [24.53.161.166]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5A22E43F75 for ; Fri, 31 Jan 2003 16:11:54 -0800 (PST) (envelope-from wmoran@potentialtech.com) Received: from potentialtech.com ([172.16.0.95]) by pa-plum1b-166.pit.adelphia.net (8.12.3/8.12.3) with ESMTP id h110DGT5001984; Fri, 31 Jan 2003 19:13:20 -0500 (EST) (envelope-from wmoran@potentialtech.com) Message-ID: <3E3B1075.3000902@potentialtech.com> Date: Fri, 31 Jan 2003 19:10:29 -0500 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.1) Gecko/20021127 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Thaddeus Quintin Cc: freebsd-questions@FreeBSD.ORG Subject: Re: A twisted home network References: <3E3B05AD.90805@attbi.com> <188996853.1044039149@[192.168.0.2]> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 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. The reason that you're not seeing examples, is because the FreeBSD box is not needed in your setup. You could eliminate it altogether. I'm assuming your want to use it as a gateway so you can learn and eventually get rid of the d-link, so here's the easiest way. The physical layout you describe above is OK (as to what connects to what) Set up the dlink to be 192.168.0.1 and the dc0 card on the FreeBSD box to be 192.168.0.2 Disable DHCP on the dlink for the time being. Configure the ep1 nic on FreeBSD to be 172.16.0.1 ... be sure to enable forwarding on the FreeBSD box (gateway_enable="yes" in rc.conf) The default gateway on the FreeBSD machine should be 192.168.0.1 Give the rest of your computers 172.16.0.* addresses with 172.16.0.1 as their gateway. Everything should work. When you're ready to remove the dlink, you'll change dc0 to get its IP from DHCP (from your ISP) and enable nat on the FreeBSD box. Then remove the dlink and plug the FreeBSD box directly into the cable modem. Be sure to adjust any firewall rules to match the changes in IP address. -- Bill Moran Potential Technologies http://www.potentialtech.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message