From owner-freebsd-net@FreeBSD.ORG Sat Feb 6 22:05:08 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 445C6106566C; Sat, 6 Feb 2010 22:05:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id F13B18FC12; Sat, 6 Feb 2010 22:05:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 3BFDA41C65E; Sat, 6 Feb 2010 23:05:07 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id hSQmyOZITjph; Sat, 6 Feb 2010 23:05:06 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 2BCE941C64C; Sat, 6 Feb 2010 23:05:06 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 0F9D34448EC; Sat, 6 Feb 2010 22:02:01 +0000 (UTC) Date: Sat, 6 Feb 2010 22:02:01 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Eugene Grosbein In-Reply-To: <201002062050.o16Ko5cT063017@freefall.freebsd.org> Message-ID: <20100206215534.V27327@maildrop.int.zabbadoz.net> References: <201002062050.o16Ko5cT063017@freefall.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-net@FreeBSD.org, bug-followup@FreeBSD.org, junk@fromru.com Subject: Re: kern/143593: [ipsec] When using IPSec, tcpdump doesn't show outgoing packets on gif interface 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: Sat, 06 Feb 2010 22:05:08 -0000 On Sat, 6 Feb 2010, Eugene Grosbein wrote: Hi Eugene, > The following reply was made to PR kern/143593; it has been noted by GNATS. > > From: Eugene Grosbein > To: Vadim Fedorenko > Cc: bug-followup@freebsd.org > Subject: Re: kern/143593: [ipsec] When using IPSec, tcpdump doesn't show outgoing > packets on gif interface > Date: Sat, 06 Feb 2010 13:21:37 +0700 > > Hi! > > This is not a bug but some misunderstanding how IPSEC tunnel mode works. > You need not use gif tunnel and IPSEC tunnel at once. But still you could for various reasons. > You should use IPSEC transport mode with gif or IPSEC tunnel mode > without gif. > > In fact, for IPSEC tunnel mode your kernel encrypts and encapsulates > outgoing packets > before it chooses outgoing interface. And IPSEC-encapsulated packet already > has B.B.B.B as destination IP so it is not routed to your gif-tunnel. > Instead, it is routed to your real network interface, therefore tcpdump > -i gif0 does not show it. > > Just change your IPSEC configuration to transport mode > keeping your gif configuration unchanged. > Then outgoing packets will be routed to gif0 by means of routing table > (and not by IPSEC tunnel mode config) and tcpdump will show them. > Gif tunnel will encapsulate them and only then they will be encrypted > with IPSEC and sent. > > I suggest this PR be closed. Please ask this type of questions in the > lists first. While what you say ist best practise and will mitigate the problem, there is a known problem here nonetheless. I think kern/121642 was one of the original submissions and this should be marked as a duplicate and possibly migrated there. There are more slightly similar problems reported (kern/110959, ...) I think similar strange results might be seen if stacking gif and gre w/o IPsec (or maybe it was gif in gif). -- Bjoern A. Zeeb It will not break if you know what you are doing.