From owner-freebsd-net@FreeBSD.ORG Thu Jan 12 07:55:45 2012 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 DFF4A1065672; Thu, 12 Jan 2012 07:55:45 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 91F4B8FC16; Thu, 12 Jan 2012 07:55:45 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id CF55825D37C7; Thu, 12 Jan 2012 07:55:44 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 17AC4BD9009; Thu, 12 Jan 2012 07:55:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id Ub0-OKV696uo; Thu, 12 Jan 2012 07:55:42 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id BF681BD9008; Thu, 12 Jan 2012 07:55:42 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <4F0E8BC8.2020703@FreeBSD.org> Date: Thu, 12 Jan 2012 07:55:42 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <4F0DD127.4040205@FreeBSD.org> <6B1A8EF0-C5BA-4EF3-B886-8F7C490564E5@lists.zabbadoz.net> <4F0E8BC8.2020703@FreeBSD.org> To: Alex Dupre X-Mailer: Apple Mail (2.1084) Cc: freebsd-net@FreeBSD.org Subject: Re: Filtering on IPSEC 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: Thu, 12 Jan 2012 07:55:46 -0000 On 12. Jan 2012, at 07:29 , Alex Dupre wrote: > Bjoern A. Zeeb ha scritto: >> Need more input. A) why are using gif? B) are you using transport = mode? >=20 > I'm using gif, because the official FreeBSD documentation says so = (http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ipsec.html). = My configuration is very similar to what described in that page. If = that's not the correct way, I'll fix the documentation after = understanding the right procedure. It's not and hasn't been in ... I think there was someone fixing the = documentation actually lately... I'll ping people and see where that = went. > I'm using tunnel mode for network to network vpn. If you are using tunnel mode and gif you'll have trouble; just use = tunnel mode without gif and you'll be happy. >> NAT before IPSEC can be done with ipfw, not with pf, don't know about = ipfilter. >=20 > Can you elaborate a little more about the reason ipfw can and pf = cannot? Is it because with ipfw/nat the packet is reinjected with the = translated src IP and so matched by SPD? Currently, with my setup and = pf, I faced exactly these two problems (SPD match before translation and = i/o on different interfaces). It's because (our) pf cannot NAT on incoming but only on outgoing = interfaces. And you need to NAT on packet entry into the system... > I think it's not so uncommon that the two networks may collide, so = assigning a "good" ip to one endpoint gateway and making NAT on it = should be well documentated in our handbook. If you give me a hint on = how this could be achieved with ipfw I'll update the docs accordingly. The answer is use IPv6 and ... oh wait.. not the answer you wanted to = hear;) I haven't done it in probably 5 years or so now but basically you setup = the nat on the incoming (probably your inside) interface and take care = of localhost as much as needed. /bz --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do!