From owner-freebsd-questions Sun Dec 10 19:29:32 2000 From owner-freebsd-questions@FreeBSD.ORG Sun Dec 10 19:29:29 2000 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from damoe.wireless-isp.net (damoe.wireless-isp.net [208.61.227.212]) by hub.freebsd.org (Postfix) with ESMTP id 6AF2537B402 for ; Sun, 10 Dec 2000 19:29:29 -0800 (PST) Received: from localhost (keen@localhost) by damoe.wireless-isp.net (8.11.1/8.11.1) with ESMTP id eBB3Vwe62475; Sun, 10 Dec 2000 22:31:58 -0500 (EST) (envelope-from keen@damoe.wireless-isp.net) Date: Sun, 10 Dec 2000 22:31:58 -0500 (EST) From: David Raistrick To: Sean Peck Cc: Chris Hill , freebsd-questions@FreeBSD.ORG Subject: Re: Configuring Gateway/NAT on Freebsd In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, 10 Dec 2000, Sean Peck wrote: > I have one machine, that has 1 NIC card, this card is configured with the > ifconfig commands to be listening to both 1 public IP address, and to > 172.16.0.1 > I have configured tun0 to be 172.16.0.1 to public IP (or at least I > believe I have) Ok, this appears to be one of the problems. tun0 is for userland ppp (vs ppp0 for kernel ppp) You do not need it. What you DO need (and i'll note that I can only say this in concept. I've not dealt with nat on a BSD machine since 2.2something..but i do it all day long with Cisco:) is to ifconfig xl0 inet 64.2.61.236 netmask 255.255.255.0 (assuming that 64...236 is the IP assigned by your provider, netmask as well) route add default 64.2.61.X (as provided by the ISP for your default route) then, ifconfig xl0 alias 172.16.0.1 netmask 255.255.255.0 Then you need to configure natd to use xl0 for all outbound traffic, with the 64.2.61.236 IP. so ( a quick scan of man natd ) natd -a 63.2.61.236 might do it. Of course, all this assumes sysctl -w net.inet.ip.forwarding=1 This is the "interesting project" that has been mentioned. It has also been mentioned that natd has been known to go haywire when used in this way (only one NIC). Should this be the case, you will need to adjust your situation accordingly and get a second NIC. Plug your dsl modem directly into this nic, (if you use a straight-through cable to the hub from the modem, you'll need a crossover...or versavisa) and then just ifconfig xl1 inet 64.2.61.236 netmask 255.255.255.0 (same defroute) natd -i xl1 that should do it. Should i get entirely bored, and you folks want me to, i'd be glad reconfigure my testlab at work to see if this works with only one NIC... later...david -- David Raistrick Digital Wireless Communications davidr@dwcinet.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message