From owner-freebsd-stable@FreeBSD.ORG Wed May 2 20:00:30 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2A1A106564A for ; Wed, 2 May 2012 20:00:30 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) by mx1.freebsd.org (Postfix) with ESMTP id 6260B8FC0A for ; Wed, 2 May 2012 20:00:30 +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 9D2A725D3A82; Wed, 2 May 2012 20:00:28 +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 C4F8EBE61B0; Wed, 2 May 2012 20:00:27 +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 U8RugaUQ4XZf; Wed, 2 May 2012 20:00:26 +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 E6109BE61AE; Wed, 2 May 2012 20:00:25 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <4FA181E3.9020303@gmail.com> Date: Wed, 2 May 2012 20:00:24 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <4579CE0F-2318-4FF1-B1EA-1EC69B24B1DF@lists.zabbadoz.net> References: <4F970899.2040105@incore.de> <4FA181E3.9020303@gmail.com> To: Zmiter X-Mailer: Apple Mail (2.1084) Cc: freebsd-stable@freebsd.org, Andreas Longwitz Subject: Re: Support for IPSec NAT-T in transoprt mode X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 May 2012 20:00:30 -0000 On 2. May 2012, at 18:50 , Zmiter wrote: > 24.04.2012 23:10, Andreas Longwitz ?????: >> There is one limitation I would like to get over. =46rom man 8 = setkey: >> System that do not perform the port check cannot support multiple >> endpoints behind the same NAT. I think this is a FreeBSD kernel = restriction: >> For the first incoming L2TP packet the IPSEC part of the kernel does = not >> save the source port in the corresponding SA (maybe a field like >> natt_l2tp_port). So the kernel does for outgoing L2TP packets not = know >> the correct SA, if two ore more SA's with the same IP exists. >>=20 >> I would like to know if the patch mentioned in this thread adresses = this >> problem. > Thank you very much for your attention. > I've been testing those patches (actually, without your part) and YES = it's a big problem with clients (Android, Windows Mobile) behind the = same NAT. I cannot find the solution yet, but I'm very interested in it. > So, my Androids is some sort of stupid bricks, they do not send NAT-OA = payloads at phase 2, and ipsec-tools fills the SPD with IPs taken from = IDs. But this is not the correct way. IDs contain LAN (which is behind = the NAT) addresses, and FreeBSD cannot route packets to the IPSec crypto = part. > I've made some quick patching of IPSec tools to get my devices = working, but I don't know if they accomodate to the RFCs and ISAKMP. The = main idea is to take NAT-OAi and NAT-OAr addresses not from IDs when we = are using NAT-T, but from real source and destination addresses of the = server and client NATs. >=20 > Here is my ipsec-tools patch (i've call it patch-zz-local-2.diff and = place at /usr/ports/security/ipsec-tools/files with two other patches = from kern /146190) ... > It differs from that in kern/146190 in one simple thing. I have = problems with the original patch from kern/146190. When there was no = NAT-OAi or NAT-OAr values in the kernel space, checksums was calculated = at 0, but they were not ignored despite of the sysctl = net.inet.esp.esp_ignore_natt_cksum value. The improvement allows to = ignore every checksum in esp packets when = net.inet.esp.esp_ignore_natt_cksum=3D1. Just replying to the last one -- you all need to make sure that this = will work with a double-NAT (both i and r sitting behind a NAT) and not = just i behind a NAT and r sitting there with a globally routable IP. The changes suddenly become a lot more complex. Just my 5cts. /bz --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do!