From owner-freebsd-questions@FreeBSD.ORG Sun May 17 21:05:46 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F322106564A for ; Sun, 17 May 2009 21:05:46 +0000 (UTC) (envelope-from patfbsd@davenulle.org) Received: from smtp.lamaiziere.net (net.lamaiziere.net [91.121.44.19]) by mx1.freebsd.org (Postfix) with ESMTP id D36BA8FC14 for ; Sun, 17 May 2009 21:05:45 +0000 (UTC) (envelope-from patfbsd@davenulle.org) Received: from baby-jane.lamaiziere.net (54.158.192-77.rev.gaoland.net [77.192.158.54]) by smtp.lamaiziere.net (Postfix) with ESMTPA id DEB2863317E; Sun, 17 May 2009 23:05:44 +0200 (CEST) Received: from baby-jane.lamaiziere.net (localhost [127.0.0.1]) by baby-jane.lamaiziere.net (Postfix) with ESMTP id 5774AC39C; Sun, 17 May 2009 23:05:49 +0200 (CEST) Date: Sun, 17 May 2009 23:05:44 +0200 From: Patrick =?ISO-8859-15?Q?Lamaizi=E8re?= To: alexus Message-ID: <20090517230544.7e0a8170@baby-jane.lamaiziere.net> In-Reply-To: <6ae50c2d0905171316y6a5ef955u3517366d71229e70@mail.gmail.com> References: <6ae50c2d0905130958r6877114bgbea6a4f717c1287d@mail.gmail.com> <6ae50c2d0905131109j7d61075ao1a0b329a1b2fd122@mail.gmail.com> <991123400905132259n2e99fa40g9ef9c18514ab0637@mail.gmail.com> <4A0F1724.50205@telia.com> <6ae50c2d0905171316y6a5ef955u3517366d71229e70@mail.gmail.com> Organization: /dave/nulle X-Mailer: Claws Mail 3.7.1 (GTK+ 2.16.1; i386-portbld-freebsd7.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "freebsd-questions@freebsd.org" Subject: Re: ipnat port-range X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 May 2009 21:05:46 -0000 Le Sun, 17 May 2009 16:16:51 -0400, alexus : > i dont see how things are obvious for you as they not so obvious for > me. first of all my ipf default policy to allow everything. > > so the original question is for ipnat and not for ipf > > now for non-passive (active) i put in these rules > > rdr bce0 0/0 port ftp-data -> lama port ftp-data tcp > rdr bce0 0/0 port ftp -> lama port ftp tcp > > and for pasv i still dont know what to do > > i've tried > > rdr bce0 0/0 port 49152-65534 -> lama port 65534 > > and in my ftp i said that this is range for pasv connections I don't think there is a way to redirect a ports ranges to a ports range with ipnat. For my ftp server I redirect each port (I use 30000 to 30039 for FTP) with a rule: rdr vr0 0.0.0.0/0 port 21 -> 192.168.1.4 port 21 rdr vr0 0.0.0.0/0 port 30000 -> 192.168.1.4 port 30000 rdr vr0 0.0.0.0/0 port 30001 -> 192.168.1.4 port 30001 ... rdr vr0 0.0.0.0/0 port 30038 -> 192.168.1.4 port 30038 rdr vr0 0.0.0.0/0 port 30039 -> 192.168.1.4 port 30039 For ipnat see http://www.westworks.ch/~chris/netbsd/NetBSD-NAT-FTP-server.html Regards.