From owner-freebsd-questions@FreeBSD.ORG Sun Jan 9 01:14:49 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 76E3116A4CE for ; Sun, 9 Jan 2005 01:14:49 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0CBE843D48 for ; Sun, 9 Jan 2005 01:14:49 +0000 (GMT) (envelope-from j65nko@gmail.com) Received: by wproxy.gmail.com with SMTP id 69so75107wra for ; Sat, 08 Jan 2005 17:14:48 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=F9I2mrVZNnYSqPuN//1nW3zAs6oUSKrJy3puQnfVYHJU/cnAnJ5E9PkA3ZdqNd/tqj8L2vF1AKWb9QYdciAg2k8MzEHNSt/cuO0oz5mGI1Ycp0uGHfh6QRiSpt4SbpXJQazPsxnGCKyUZzm7auSfokSJpKVBA56gDntOXggDCBY= Received: by 10.54.7.10 with SMTP id 10mr609801wrg; Sat, 08 Jan 2005 17:14:48 -0800 (PST) Received: by 10.54.37.19 with HTTP; Sat, 8 Jan 2005 17:14:48 -0800 (PST) Message-ID: <19861fba05010817141977b96@mail.gmail.com> Date: Sun, 9 Jan 2005 02:14:48 +0100 From: J65nko BSD To: Lewis Thompson In-Reply-To: <20050109002355.GA3882@black.fajita.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <20050109002355.GA3882@black.fajita.org> cc: questions@freebsd.org Subject: Re: Packet filtering with pf and gif tunnels. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: J65nko BSD List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jan 2005 01:14:49 -0000 On Sun, 9 Jan 2005 00:23:55 +0000, Lewis Thompson wrote: > Hi, > > I am wondering what sequence a packet goes through when it is passing > through a gif tunnel. I have the following interface and gif tunnel > (with the equivalent being on the same subnet at the other side): > > fxp0: a.a.a.a/24 > gif0: a.a.a.a -> a.a.a.b (192.168.0.1/32 -> 192.168.0.2/32) > > My question is really what order does the packet go pass through my > firewall (pf) in? i.e., is it: > > in on fxp0 from a.a.a.b to a.a.a.a > (unencapsulated) > in on gif0 from 192.168.0.2 to 192.168.0.1 > > or does it just magically ``appear'' on gif0 straight away? Now I write > it out I am assuiming that it passes through pf twice (first on fxp0 and > secondly on gif0); if this is in fact the case, what sensible rule might > I add to allow this encapsulated traffic from a.a.a.b? > > Currently I have pf configured as follows: > > pass all > > pass quick proto icmp > > block in on fxp0 > pass out on fxp0 keep state > pass in on fxp0 proto tcp from any to fxp0 port 22 keep state > > The reason I ask this question is that for my tunnel endpoints to ping > each other, a.a.a.a must be doing so (a.a.a.b has no firewall). > > Thank you, > > -Lewis Thompson. For some debugging strategies in a similar case with IPSEC see http://www.bsdforums.org/forums/showthread.php?s=&threadid=18601