From owner-freebsd-questions Sun Feb 20 13:23:24 2000 Delivered-To: freebsd-questions@freebsd.org Received: from cc942873-a.ewndsr1.nj.home.com (cc942873-a.ewndsr1.nj.home.com [24.2.89.207]) by hub.freebsd.org (Postfix) with ESMTP id 051D937BEF5 for ; Sun, 20 Feb 2000 13:23:12 -0800 (PST) (envelope-from cjc@cc942873-a.ewndsr1.nj.home.com) Received: (from cjc@localhost) by cc942873-a.ewndsr1.nj.home.com (8.9.3/8.9.3) id QAA36894; Sun, 20 Feb 2000 16:22:52 -0500 (EST) (envelope-from cjc) Date: Sun, 20 Feb 2000 16:22:51 -0500 From: "Crist J. Clark" To: John Purser Cc: questions@FreeBSD.ORG Subject: Re: Setting up a Gateway to @home - Newbie VERY confused Message-ID: <20000220162251.C36373@cc942873-a.ewndsr1.nj.home.com> Reply-To: cjclark@home.com References: <000501bf7bcc$04e7ace0$40390918@vncvr1.wa.home.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <000501bf7bcc$04e7ace0$40390918@vncvr1.wa.home.com>; from johnmpurser@home.com on Sun, Feb 20, 2000 at 09:57:56AM -0800 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, Feb 20, 2000 at 09:57:56AM -0800, John Purser wrote: > Hello, > > I have a computer running FreeBSD 3.4 (custom kernel) with two network cards > (fxp0, fxp1). fxp0 is on my local network (FreeBSD, NTWks, Win98) and I > want to use fxp1 to connect to my AT&T@home cable modem. I have a static IP > address from @home, both NIC's are recognized by FreeBSD but I'm still > having trouble. I've read man pages, huge chunks for the manual, man pages > galore, and several tutorials that start out with "All you have to do..." > and nothing is working. > > Using /stand/sysinstall I've configured fxp1 with the info from @home (Host > name, Domain, DNS Server, Gateway, IP address, subnet mask). Now I'm trying > to configure fxp0 for my network but changing the host name changes it for > both cards. I thought the whole point of having two cards was that each > card had it's own complete set of info. Apparently I'm way off base there > but that leaves me not knowing how to proceed. Don't use /stand/sysinstall to try to do both NICs. It is beyond the scope of what sysinstall was created for. >From what I've read there seem to be five things that need to be configured > for my FreeBSD box to work as a gateway: > fxp0 (Private network) > HOST: > DOMAIN: > DNS Server: > GATEWAY: > IP ADDR: 192.168.0.NNN > SUBNET MASK: 255.255.255.0 > fxp1 (@home) > HOST: CWHATEVER > DOMAIN: HOME.COM > DNS Server: 24.YYY.YYY.YYY > GATEWAY: 24.XXX.XXX.XXX > IP ADDR: 24.ZZZ.ZZZ.ZZZ > SUBNET MASK: 255.255.255.0 hostname(1), domain name, DNS server, and gateway are not things associated with a NIC. Only an address, subnet mask, and broadcast address are associated with the NIC. See tha output of 'ifconfig -a.' > ipfw: > > natd: > > bind: > > I've filled in what I'm fairly confident about. I know this is a lot to ask > for on the mailing list but this is my third day trying get there on my own > and I don't have a whole lot to show for it. I've got a ton of books in the > mail (Thank you Amazon and O'Reilly) but I want to at least connect my > FreeBSD box to the internet before reading all of them! "All you have to do" to have this one machine connected to the Internet is have the outer NIC (fxp1) configured properly. I'll assume you have done that in sysinstall. Now, if you have machines behind this box you want to access the Internet on, we have a few more things. First, we need to configure the internal interface (let's just say you use 192.168.0.0/24 for a private address-space), # ifconfig fxp0 inet 192.168.0.254 You are all set there. But we need NAT for the internal machines. That is as simple as (provided the kernel has DIVERT built in, see natd(8)), # natd -u -n fxp1 Now, we need to add the divert rule to the firewall, # ipfw add 100 divert all any to any via fxp1 And that's really all you need there. To get this to work on boot, edit rc.conf, hostname="really.long.ugly.home.com" network_interfaces="lo0 fxp0 fxp1" ifconfig_fxp0="inet 192.168.0.254" ifconfig_fxp1="inet netmask 255.255.255.0" firewall_enable="YES" firewall_type="open" natd_enable="YES" natd_interface="fxp1" natd_flags="-u" > Has anyone seen a good tutorial on this? I've tried a few but not only did > they not work I didn't even get enough of a response to figure out what was > not working. If you've read all the stuff you said you did, I don't see how it could be too much of a problem. Just try to get away from /stand/sysinstall. The only thing that I like using it for besides installing is that nice interactive interface to fdisk. -- Crist J. Clark cjclark@home.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message