From owner-freebsd-ipfw@FreeBSD.ORG Sat Nov 18 07:51:48 2006 Return-Path: X-Original-To: freebsd-ipfw@freebsd.org Delivered-To: freebsd-ipfw@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DA95B16A67A for ; Sat, 18 Nov 2006 07:51:48 +0000 (UTC) (envelope-from nilton.volpato@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id E471445801 for ; Sat, 18 Nov 2006 05:06:16 +0000 (GMT) (envelope-from nilton.volpato@gmail.com) Received: by nf-out-0910.google.com with SMTP id x37so1242459nfc for ; Fri, 17 Nov 2006 21:06:16 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=Ijj4FBh68bLSQjVMVwjKhf0B7o/yTZTBmawJFjo/wCrVEvaXP6YcHIK9OsueG4PjO4x4Gyv0hfzzXgxlNFsF42hS5D2zTkmupDRJLfXrvGigK4QhZMKfKdYEhfF9XIis/Ge4sHBpLTzVsC5+NkUjK9d/RL/RjH/tAL50RLMYN0c= Received: by 10.78.26.9 with SMTP id 9mr2345176huz.1163798932585; Fri, 17 Nov 2006 13:28:52 -0800 (PST) Received: by 10.78.126.15 with HTTP; Fri, 17 Nov 2006 13:28:52 -0800 (PST) Message-ID: <27fef5640611171328r2973167dm2b58e1dc2e393bb7@mail.gmail.com> Date: Fri, 17 Nov 2006 19:28:52 -0200 From: "Nilton Volpato" To: freebsd-ipfw@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: port redirection with natd and ipfw X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Nov 2006 07:51:49 -0000 Hi, I'm using a computer with FreeBSD as a gateway and NAT for a private LAN. Let's say the gateway has external.com as external address, and 192.168.0.1 as internal address, so that the LAN is 192.168.0.0/24. I'm doing a number of port redirects in the gateway, for svn, http, https, ssh, etc using natd. However, these port redirects do not work from inside the LAN. For instance, if I point my browser to http://external.com and I'm in the LAN, then it will not work. I can't use the internal address of the web server because none of the links will work on the web page. In summary, I want that my port redirections work also when I try to connect to the gateway's external address from inside the LAN. I'm using a minimal ipfw configuration to try to solve this. This is the default configuration. 00050 divert 8668 ip4 from any to any via vr0 00100 allow ip from any to any via lo0 00200 deny ip from any to 127.0.0.0/8 00300 deny ip from 127.0.0.0/8 to any 65000 allow ip from any to any 65535 deny ip from any to any I tried to add: 00060 divert 8668 ip4 from 192.168.0.0/24 to external.com expecting that it would send the packets from LAN to natd, which would apply the port redirections. But it did not work. How can I solve this? Thanks, -- Nilton