From owner-freebsd-ipfw@FreeBSD.ORG Tue May 10 12:35:12 2005 Return-Path: Delivered-To: freebsd-ipfw@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AE58A16A4CE for ; Tue, 10 May 2005 12:35:12 +0000 (GMT) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 80E1D43D5A for ; Tue, 10 May 2005 12:35:12 +0000 (GMT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.11/8.12.11) with ESMTP id j4ACZBcu087044; Tue, 10 May 2005 05:35:12 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.11/8.12.3/Submit) id j4ACZ4LB087026; Tue, 10 May 2005 05:35:04 -0700 (PDT) (envelope-from rizzo) Date: Tue, 10 May 2005 05:35:04 -0700 From: Luigi Rizzo To: Simon Litchfield Message-ID: <20050510053504.A86392@xorpc.icir.org> References: <42805673.2070401@quo.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <42805673.2070401@quo.com.au>; from simon@quo.com.au on Tue, May 10, 2005 at 04:36:35PM +1000 cc: freebsd-ipfw@freebsd.org cc: Joshua Paech Subject: Re: IPFW2 statefulness over bridge? X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2005 12:35:12 -0000 without looking into the detail, for which 1) i don't have time and 2) you haven't posted enough information (we'd need the complete ruleset and counter values and interfaces you yse to be sure what is going on), the use of "via" options is almost always incorrect in ipfw configurations (due to bad examples that are cut&pasted out of context), and the use of "via" and "out" options in bridged ipfw configuration is _always_ wrong. The latter is documented in the manpage so there is no excuse :) You should check which rule actually matches your outgoing packets. Almost surely you are accepting the packet at a rule before the 'keep-state' -- e.g. the > .... a bunch of allows for the usual tcp/udp ports like 80 etc to could be the place where this happens. Anyways i would suggest you to look at each rule and ask yourself - what does this rule do ? (answer generally on the manpage) - do i really want this 'via' or 'in' or 'out' option ? and so on. cheers luigi On Tue, May 10, 2005 at 04:36:35PM +1000, Simon Litchfield wrote: > Hi. We've noticed ipfw2 doesnt seem to maintain state on outgoing > connections over our bridge (running 5.3 generic). A similar > configuration worked fine using pf on openbsd. > > Are we missing something? Here's the guts of our rule script -- > > .... some init stuff here ..... > > # allow arps (oh yeah, this is important) > ipfw add allow layer2 mac-type arp > > # deny spurious source addresses and spoof attempts > ipfw add deny log all from $addr_rfc1918 to any in via $ext_if > ipfw add deny log all from any to $addr_rfc1918 out via $ext_if > ipfw add deny log all from 'table(0)' to any in via $ext_if > ipfw add deny log all from any to 'table(0)' out via $ext_if > ipfw add deny log all from me to any in via $ext_if > > # deny illegal TCP flag combinations > ipfw add deny log tcp from any to any tcpflags fin,urg,psh > ipfw add deny log tcp from any to any tcpflags syn,fin,rst,ack > ipfw add deny log tcp from any to any tcpflags '!syn,!fin,!ack' > > .... a bunch of allows for the usual tcp/udp ports like 80 etc to > various servers 'inside' the bridged network go here .... > > # leave the inside of the firewall open > ipfw add allow layer2 via $int_if > > # allow loopback > ipfw add allow ip from 127.0.0.0/8 to 127.0.0.0/8 > > # allow firewalled address to make any outgoing connections > ipfw add allow ip from 'table(0)' to any setup keep-state > ipfw add allow ip from me to any setup keep-state > > # firewalling UDP is pretty pointless > ipfw add allow udp from any to any > > # final denys > ipfw add allow icmp from any to any > > ipfw add allow tcp from any to any setup keep-state > ipfw add allow ip from any to any etup keep-state > > ipfw add reset tcp from any to any > ipfw add unreach port udp from any to any > ipfw add deny log ip from any to any > > > -- > > Quo Consulting > info@quo.com.au > http://www.quo.com.au/ > > Phone +61 (0)7 5520 2665 > Fax +61 (0)2 8569 2377 > > Level 3 : Old Burleigh Theatre Arcade > 66 Goodwin Terrace : Burleigh Heads > Queensland : Australia > _______________________________________________ > freebsd-ipfw@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-ipfw > To unsubscribe, send any mail to "freebsd-ipfw-unsubscribe@freebsd.org"