From owner-freebsd-ipfw@FreeBSD.ORG Mon Jan 5 13:51:14 2015 Return-Path: Delivered-To: freebsd-ipfw@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80CA16C9 for ; Mon, 5 Jan 2015 13:51:14 +0000 (UTC) Received: from mail-lb0-x22c.google.com (mail-lb0-x22c.google.com [IPv6:2a00:1450:4010:c04::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0CAA645A5 for ; Mon, 5 Jan 2015 13:51:13 +0000 (UTC) Received: by mail-lb0-f172.google.com with SMTP id z12so9959848lbi.3 for ; Mon, 05 Jan 2015 05:51:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=a4XHcdJEc8zq5G1zWFTUiS3CimTyjQ0euygcEzK5Hqo=; b=jZ8yn4lAr0uXnBvKNm1Uk0WZQrNZ/YTOO9CXhy5tUPUvrAr25Ls4J2XDAKm1NMAB8V tLrJDg8AAhm2gKsw8YHpc0oAxUIp+34gt5esuBBocsh8lGoq5n0UKWATSeF40lWhCVdl kY+i+pPuAo3ZO42vNZ5gE6RekBouS2t5sWGea3Z6B6+kYMkeG/tjjbgm9NfWWWik0JJ8 loWH3cATlbVNTsvqCqUw5/99iPNsBRC63bOq24436ed+hTf5+fdB6GS5X9psjimfF8/T s18QD3kg77ZN6OHqY5DddqEtX0KAF6itr5nngmXh+ySUh99sCt9UI4BSajSIQ1AuwYNc oWhQ== MIME-Version: 1.0 X-Received: by 10.152.29.129 with SMTP id k1mr93465549lah.10.1420465872006; Mon, 05 Jan 2015 05:51:12 -0800 (PST) Sender: rizzo.unipi@gmail.com Received: by 10.114.10.168 with HTTP; Mon, 5 Jan 2015 05:51:11 -0800 (PST) In-Reply-To: References: <20150105122809.GD31058@vpn.offrom.nl> Date: Mon, 5 Jan 2015 14:51:11 +0100 X-Google-Sender-Auth: axunU3T_yx392isXlIil_izf-LU Message-ID: Subject: Re: Why ipfw didn't filter neither log DHCP packets ? From: Luigi Rizzo To: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "freebsd-ipfw@freebsd.org" , Willy@offermans.rompen.nl X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jan 2015 13:51:14 -0000 On Mon, Jan 5, 2015 at 2:41 PM, Olivier Cochard-Labb=C3=A9 wrote: > On Mon, Jan 5, 2015 at 1:28 PM, Willy Offermans > wrote: > >> Hello Luigi and FreeBSD friends, >> >> I do top posting. >> >> So there might be a chance that someting slips through the firewall >> between the start of the firewall and after the bpf traffic of dhclient. >> Once the NIC is configured, traffic is possible in principle. >> Would it be better to start the bpf traffic of dhclient after the firewa= ll >> runs. In the latter case, all will or can work as expected. If yes, how >> should this be set? Should one set >> >> REQUIRE: firewall >> >> in /etc/rc.d/dhclient? But there seems no firewall daemon to be present. >> So >> I'm not sure how this should work. >> >> > I believe that when Luigi says "that acts before the firewall has a chanc= e > to see the packets", he was not speaking of the RC script order, but abou= t > the FreeBSD network stack layer order. > Do you confirm Luigi ? > > =E2=80=8Bcorrect, it's not a matter of time but of placement of the modules in the stack. injection through bpf goes just above the device driver, so there is no chance to see bpf-generated packets. For incoming traffic, bpf sees a copy, so the original still goes through the stack, but if you want to see it with ipfw you should probably enable layer2 firewalling. cheers luigi