From owner-freebsd-net@FreeBSD.ORG Thu Nov 8 19:28:22 2007 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D55316A4A6 for ; Thu, 8 Nov 2007 19:28:22 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 1908213C4D3 for ; Thu, 8 Nov 2007 19:28:22 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id A0938208F for ; Thu, 8 Nov 2007 20:08:52 +0100 (CET) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: -0.1/3.0 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on tim.des.no Received: from ds4.des.no (des.no [80.203.243.180]) by smtp.des.no (Postfix) with ESMTP id 736B4209E for ; Thu, 8 Nov 2007 20:08:52 +0100 (CET) Received: by ds4.des.no (Postfix, from userid 1001) id 58770844A6; Thu, 8 Nov 2007 20:08:52 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: net@freebsd.org Date: Thu, 08 Nov 2007 20:08:52 +0100 Message-ID: <86zlxoblmj.fsf@ds4.des.no> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Subject: pf misfeature X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2007 19:28:22 -0000 Given appropriate definitions for $eth and $lan, you'd expect the following rule to simply pass all traffic originating from and destined for the LAN: pass on $eth from $lan to $lan However, in pf, "keep state" is *implicit* (why?), so you'd expect it to turn into something like this: pass on $eth from $lan to $lan keep state but what you actually get is this: pass on $eth from $lan to $lan flags S/SA keep state which only matches TCP handshakes, so your UDP streams are screwed. Workaround: explicitly specify TCP and UDP, causing pf to split the rule into two: pass on $eth inet proto { tcp, udp } from $lan to $lan becomes pass on $eth inet proto tcp from $lan to $lan flags S/SA keep state pass on $eth inet proto udp from $lan to $lan keep state There does not seem to be any way to turn off this misguided rewriting of firewall rules. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no