From owner-freebsd-questions@FreeBSD.ORG Tue Jan 24 10:36:12 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 224F216A41F for ; Tue, 24 Jan 2006 10:36:12 +0000 (GMT) (envelope-from igorr@speechpro.com) Received: from speechpro.ru (speech-tech-2.ip.PeterStar.net [81.3.190.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9DE7843D45 for ; Tue, 24 Jan 2006 10:36:11 +0000 (GMT) (envelope-from igorr@speechpro.com) Received: from sysadm.stc ([192.168.2.26]) by s1.stc with esmtp (Exim 4.53 (FreeBSD)) id 1F1LWz-0003OK-Ue for freebsd-questions@freebsd.org; Tue, 24 Jan 2006 13:36:10 +0300 Received: from localhost.stc ([127.0.0.1] helo=sysadm.stc) by sysadm.stc with esmtp (Exim 4.54 (FreeBSD)) id 1F1LWS-00049c-TX for freebsd-questions@freebsd.org; Tue, 24 Jan 2006 13:35:37 +0300 Received: (from igorr@localhost) by sysadm.stc (8.13.4/8.13.3/Submit) id k0OAZa3o015971 for freebsd-questions@freebsd.org; Tue, 24 Jan 2006 13:35:36 +0300 (MSK) (envelope-from igorr) Date: Tue, 24 Jan 2006 13:35:36 +0300 From: Igor Robul To: freebsd-questions@freebsd.org Message-ID: <20060124103536.GE15098@sysadm.stc> References: <5ceb5d550601232141x74879d8ek38c80c886b28be4a@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5ceb5d550601232141x74879d8ek38c80c886b28be4a@mail.gmail.com> User-Agent: Mutt/1.5.11 X-Archived: Yes 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 10:36:12 -0000 On Tue, Jan 24, 2006 at 06:41:27AM +0100, Daniel A. wrote: > sis0: flags=8843 mtu 1500 > options=8 > 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=8843 mtu 1500 > options=8 > 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 = 9541 keep state pass in quick on rl0 proto udp from any to 192.168.0.2/32 port = 9542 keep state