From owner-freebsd-questions@FreeBSD.ORG Tue Jan 24 11:20:20 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2EC8F16A41F for ; Tue, 24 Jan 2006 11:20:20 +0000 (GMT) (envelope-from ldrada@gmail.com) Received: from uproxy.gmail.com (uproxy.gmail.com [66.249.92.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id 80D3343D53 for ; Tue, 24 Jan 2006 11:20:19 +0000 (GMT) (envelope-from ldrada@gmail.com) Received: by uproxy.gmail.com with SMTP id j3so208520ugf for ; Tue, 24 Jan 2006 03:20:18 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Vuh0LBiJ41NC5eRu5R1mvcmu/+/r8cQDW+5iClMJrfs2ShfiGhqSQkFzcHQJmcVnakCFuEyy+xMh7NKxs8AUhNLaAx+UTPn5H/coKoWlFfa4VB3VeVaMEhKB9XrwLwO992S1y/xvchDEHXhwgnmqFnUCiWDiKNawb/Ogrc6vD+8= Received: by 10.48.48.3 with SMTP id v3mr435344nfv; Tue, 24 Jan 2006 02:54:00 -0800 (PST) Received: by 10.48.108.14 with HTTP; Tue, 24 Jan 2006 02:54:00 -0800 (PST) Message-ID: <5ceb5d550601240254x2be85e5eg45355b5e9e7c2cae@mail.gmail.com> Date: Tue, 24 Jan 2006 11:54:00 +0100 From: "Daniel A." To: Igor Robul In-Reply-To: <20060124103536.GE15098@sysadm.stc> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <5ceb5d550601232141x74879d8ek38c80c886b28be4a@mail.gmail.com> <20060124103536.GE15098@sysadm.stc> Cc: freebsd-questions@freebsd.org Subject: Re: Port forwarding. 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: Tue, 24 Jan 2006 11:20:20 -0000 Ah, thanks a lot! It finally works! *Does a happy dance* All the other guides to ipfilter / ipnat only listed changes to ONE of the files (either ipf.rules or ipnat.rules), and never mentioned putting the changes before mapping, even though they did cover that topic. On 1/24/06, Igor Robul wrote: > On Tue, Jan 24, 2006 at 06:41:27AM +0100, Daniel A. wrote: > > sis0: flags=3D8843 mtu 1500 > > options=3D8 > > inet6 fe80::20a:e6ff:fe53:fc1e%sis0 prefixlen 64 scopeid 0x2 > > inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 > > ether 00:0a:e6:53:fc:1e > > media: Ethernet autoselect (100baseTX ) > > status: active > > rl0: flags=3D8843 mtu 1500 > > options=3D8 > > inet6 fe80::2b0:2ff:fe00:27f3%rl0 prefixlen 64 scopeid 0x3 > > inet 87.50.69.60 netmask 0xffffff80 broadcast 87.50.69.127 > > ether 00:b0:02:00:27:f3 > > media: Ethernet autoselect (100baseTX ) > > status: active > > > > I have been googling and reading ifconfig papers all day yesterday, in > > the search for how to do simple port-forwarding, but nothing have > > worked. > > So, this is my final resort: How would I forward the ports 9541 (TCP) > > and 9542 (UDP) to 192.168.0.2 on my LAN? > /etc/ipnat.conf: > rdr rl0 0/0 port 9541 -> 192.168.0.2 port 9541 tcp > rdr rl0 0/0 port 9542 -> 192.168.0.2 port 9542 udp > > somewhere on top of file (before "map"). > > Also you need something like this in your /etc/ipf.rules: > > pass in quick on rl0 proto tcp from any to 192.168.0.2/32 port =3D 9541 k= eep state > pass in quick on rl0 proto udp from any to 192.168.0.2/32 port =3D 9542 k= eep state > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.o= rg" >