From owner-freebsd-pf@FreeBSD.ORG Thu Sep 15 10:42:21 2005 Return-Path: X-Original-To: freebsd-pf@freebsd.org Delivered-To: freebsd-pf@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D4EF016A41F for ; Thu, 15 Sep 2005 10:42:21 +0000 (GMT) (envelope-from Greg.Hennessy@nviz.net) Received: from smtp.nildram.co.uk (smtp.nildram.co.uk [195.112.4.54]) by mx1.FreeBSD.org (Postfix) with ESMTP id 69E1F43D48 for ; Thu, 15 Sep 2005 10:42:21 +0000 (GMT) (envelope-from Greg.Hennessy@nviz.net) Received: from gw2.local.net (unknown [62.3.210.251]) by smtp.nildram.co.uk (Postfix) with ESMTP id E1F12252B33 for ; Thu, 15 Sep 2005 11:42:17 +0100 (BST) From: "Greg Hennessy" To: "'Brian Candler'" , Date: Thu, 15 Sep 2005 11:42:18 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.6353 Thread-Index: AcW54Jcs/J8Lp3FRTRyNo3/oiJeUXAAASSyA X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830 In-Reply-To: <20050915101444.GA836@uk.tiscali.com> Message-Id: <20050915104218.54C684D@gw2.local.net> Cc: Subject: RE: Using 'rdr' on outbound connections 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: Thu, 15 Sep 2005 10:42:22 -0000 > -----Original Message----- > From: owner-freebsd-pf@freebsd.org > [mailto:owner-freebsd-pf@freebsd.org] On Behalf Of Brian Candler > Sent: 15 September 2005 11:15 > To: freebsd-pf@freebsd.org > Subject: Using 'rdr' on outbound connections > > Hello, > > I would like to use pf to trap all locally-originated > outbound connections to port 25 on any remote host, and > redirect them to a local mailserver. > > I tried: > > rdr pass proto tcp from any to any port 25 -> 127.0.0.1 port 25 > Try tying that rdr to the inside interface. This for example ~ # grep -i rdr /etc/pf.conf | grep 3128 rdr pass on $Int proto tcp from $LAN to ! port www -> 127.0.0.1 port 3128 rdr pass on $Int proto tcp from $LAN to $Int:0 port 3128 -> 127.0.0.1 port 3128 Works fine to redirect http transparently to squid and provide inline http proxying when needed. Greg