From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 12 17:35:37 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6D4D516A4DA for ; Sat, 12 Aug 2006 17:35:37 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.183]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8E2E243D46 for ; Sat, 12 Aug 2006 17:35:36 +0000 (GMT) (envelope-from max@love2party.net) Received: from [88.64.180.29] (helo=amd64.laiers.local) by mrelayeu.kundenserver.de (node=mrelayeu4) with ESMTP (Nemesis), id 0ML21M-1GBxOY17Jb-0005lJ; Sat, 12 Aug 2006 19:35:34 +0200 From: Max Laier Organization: FreeBSD To: freebsd-hackers@freebsd.org Date: Sat, 12 Aug 2006 19:35:27 +0200 User-Agent: KMail/1.9.3 References: <8e96a0b90608120936q67a5365vcc97217b44a272c0@mail.gmail.com> In-Reply-To: <8e96a0b90608120936q67a5365vcc97217b44a272c0@mail.gmail.com> X-Face: ,,8R(x[kmU]tKN@>gtH1yQE4aslGdu+2]; R]*pL,U>^H?)gW@49@wdJ`H<=?utf-8?q?=25=7D*=5FBD=0A=09U=5For=3D=5CmOZf764=26nYj=3DJYbR1PW0ud?=>|!~,,CPC.1-D$FG@0h3#'5"k{V]a~.<=?utf-8?q?mZ=7D44=23Se=7Em=0A=09Fe=7E=5C=5DX5B=5D=5Fxj?=(ykz9QKMw_l0C2AQ]}Ym8)fU MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4112652.B6gO07oNMV"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200608121935.33395.max@love2party.net> X-Provags-ID: kundenserver.de abuse@kundenserver.de login:61c499deaeeba3ba5be80f48ecc83056 Cc: mal content Subject: Re: Packet filtering on tap interfaces X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Aug 2006 17:35:37 -0000 --nextPart4112652.B6gO07oNMV Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 12 August 2006 18:36, mal content wrote: > Hello, this is a simplified re-phrasing of a question posted to > questions@. It didn't get any answers over there because I > think people took one look at it and switched off. A cut down > version follows... > > How does one do packet filtering on tap interfaces? I'm using > qemu and I'm going to be loading some untrusted OS images > so I'd like complete filtering of packets to and from the qemu > process. > > I was given a partial solution by somebody before, but I couldn't > get it to work. > > I'm currently: > > 1. Using bridge.sh[1] to bridge between tap0 and my real fxp0 > interface. > > 2. Trying to log or filter packets on tap0. > > My current pf.conf looks like this: > > nic0 =3D "fxp0" > host_ip =3D "192.168.2.5" > pass in log all > pass out log all > > Which should surely filter everything. However, I can use the > network on the guest OS (going through tap0) without ever > triggering the pf logging. Why is this happening? Even when > explicity specifying: > > pass in log all on tap0 > pass out log all on tap0 > > I still don't see any logs. > > Can tap interfaces reliably be filtered? This is because the packets never make it to the IP-Layer (where our=20 packet filters normally hook into). You can try to use if_bridge(4) to=20 bridge tap0 and fxp0. if_bridge(4) offers extensive means of packet=20 filtering described in the man page in great detail. =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --nextPart4112652.B6gO07oNMV Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQBE3hFlXyyEoT62BG0RAt17AJ92xVakPAnAbUvATURqMKDI4g81fACcCl5g enRgPkm4C5uc7qJZetiQlr0= =Lb/4 -----END PGP SIGNATURE----- --nextPart4112652.B6gO07oNMV--