From owner-freebsd-pf@FreeBSD.ORG Mon Jun 1 22:15:29 2009 Return-Path: Delivered-To: freebsd-pf@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 850441065675 for ; Mon, 1 Jun 2009 22:15:29 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from elsa.codelab.cz (elsa.codelab.cz [94.124.105.4]) by mx1.freebsd.org (Postfix) with ESMTP id 45C268FC08 for ; Mon, 1 Jun 2009 22:15:29 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from localhost (localhost.codelab.cz [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id 5B5EB19E044; Mon, 1 Jun 2009 23:56:05 +0200 (CEST) Received: from [192.168.1.2] (r5bb235.net.upc.cz [86.49.61.235]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by elsa.codelab.cz (Postfix) with ESMTPSA id 1456319E043; Mon, 1 Jun 2009 23:56:03 +0200 (CEST) Message-ID: <4A244E73.8040203@quip.cz> Date: Mon, 01 Jun 2009 23:56:03 +0200 From: Miroslav Lachman <000.fbsd@quip.cz> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 X-Accept-Language: cz, cs, en, en-us MIME-Version: 1.0 To: aftaha@cirp.usp.br References: <4A2415EF.1070206@cirp.usp.br> In-Reply-To: <4A2415EF.1070206@cirp.usp.br> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-pf@freebsd.org Subject: Re: Connect to port 5432 X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 22:15:30 -0000 Ali Faiez Taha wrote: > Dear Sirs. > > What I need to redirect connections from any Internet valid IP and port 5432 to one intranet server running (PostgreSQL Database) on > 5432 port ? > I am using FreeBSD 7.2 with PF firewall. > > The rule on Linux iptables now is: > > iptables -t nat -A PREROUTING -p tcp -s 0/0 -d AAA.BBB.CCC.DDD --dport 5432 -j DNAT --to-destination 192.168.2.253:5432 It could be something like this rdr pass on $ext_if proto tcp from any to AAA.BBB.CCC.DDD port 5432 -> 192.168.2.253 but better read some docs (man pf.conf and examples on the net) Miroslav Lachman