From owner-freebsd-pf@FreeBSD.ORG Thu Sep 15 13:09:30 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 304B616A41F for ; Thu, 15 Sep 2005 13:09:30 +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 C85D643D45 for ; Thu, 15 Sep 2005 13:09:29 +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 54EC124F281 for ; Thu, 15 Sep 2005 14:09:26 +0100 (BST) From: "Greg Hennessy" To: "'Brian Candler'" Date: Thu, 15 Sep 2005 14:09:27 +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 In-Reply-To: <20050915123654.GA1315@uk.tiscali.com> Thread-Index: AcW58b0OjvVxGtx8S1u5hY9kVps+ngAAF3Gg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830 Message-Id: <20050915130927.4A1584D@gw2.local.net> Cc: freebsd-pf@freebsd.org 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 13:09:30 -0000 > Not surprisingly, it blackholes everything. The joys of a default deny. Add a pass all on lo0 keep state Just keep things listening there sweet. > > # telnet -N 147.28.0.39 25 > Trying 147.28.0.39... > telnet: connect to address 147.28.0.39: Operation not permitted > telnet: Unable to connect to remote host > > # tcpdump -r /var/log/pflog > > just shows: > > 13:26:09.426570 IP bloodhound.noc.clara.net.57393 > > rip.psg.com.smtp: S 360892497:360892497(0) win 65535 1460,nop,nop,sackOK,nop,wscale1,nop,nop,timestamp 9750257 0> > > (that's it; no RST, no ICMP ADMIN-PROHIBITED) You need to set block-policy return For that to happen. Now that it's caught it and we know what the specifics are. Try # assuming fxp0 and bloodhound.noc.clara.net are one and the same. rdr pass on fxp0 proto tcp from fxp0 to !fxp0 port smtp -> 127.0.0.1 port smtp And see does that work. > I'm coming to the conclusion that 'rdr' acts on an "inbound" > interface, i.e. > packets arriving at the kernel, and locally-originated > packets don't match any interface; or something like that. It would be rather hard to filter on userid if that was the case. Greg