From owner-freebsd-questions Mon Aug 20 7:54:40 2001 Delivered-To: freebsd-questions@freebsd.org Received: from cody.jharris.com (cody.jharris.com [205.238.128.83]) by hub.freebsd.org (Postfix) with ESMTP id 2EC0137B40B for ; Mon, 20 Aug 2001 07:54:34 -0700 (PDT) (envelope-from nick@rogness.net) Received: from localhost (nick@localhost) by cody.jharris.com (8.11.1/8.9.3) with ESMTP id f7KEsUl88360; Mon, 20 Aug 2001 09:54:30 -0500 (CDT) (envelope-from nick@rogness.net) Date: Mon, 20 Aug 2001 09:54:29 -0500 (CDT) From: Nick Rogness X-Sender: nick@cody.jharris.com To: Chris Hastie Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Port redirection with natd In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 On Mon, 20 Aug 2001, Chris Hastie wrote: > I'm trying to set up an internet gateway with NAT and some port > redirection using Free BSD 4.3-CURRENT. The machine has two nics, xl0 > faces the internet and sis0 faces my LAN. > > So far the NAT works fine, but I can't get the port redirection going at > all. > > The kernel was compiled with: > > |options IPFIREWALL # install ipfw firewall > |options IPFIREWALL_VERBOSE_LIMIT=5 # log firewall packets, limit entries > |options IPDIVERT # Allow NAT > > I have this in /etc/rc.conf > > |# -- Configure NAT and Firewall --# > |firewall_enable="YES" > |firewall_type="open" #Close later when I get it working! > |natd_enable="YES" > |natd_interface="xl0" > |natd_flags="-f /etc/natd.conf" > > > and the natd.conf referenced looks like this > > |dynamic yes > |redirect_port tcp celandine:25 25 > |redirect_port tcp celandine:119 119 > |redirect_port tcp celandine:3306 3306 > > The ports do not seem to being redirected though, and I can see no > errors at boot up. netstat does not show any of the ports in question > in use, but an attempt to run Have you turned on logging to see what is going on? > > # natd -n xl0 -f /etc/natd.conf > > returns > > |natd: Unable to bind socket.: Address already in use. > natd is already running and bound to port 8668 [from the startup]. > Additionally, I can get no response from any of those ports by > telnetting to them with another machine. > The redirect_port stuff will only work from the outside with your setup. Try going to an outside machine and telnetting. Nick Rogness - Keep on Routing in a Free World... "FreeBSD: The Power to Serve!" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message