From owner-freebsd-net@freebsd.org Wed Jul 19 13:38:34 2017 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E93D9C7D962 for ; Wed, 19 Jul 2017 13:38:34 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward3h.cmail.yandex.net (forward3h.cmail.yandex.net [87.250.230.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 79EA27FA31 for ; Wed, 19 Jul 2017 13:38:33 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [IPv6:2a02:6b8:0:801::ab]) by forward3h.cmail.yandex.net (Yandex) with ESMTP id B65C6203CD; Wed, 19 Jul 2017 16:38:23 +0300 (MSK) Received: from smtp1j.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp1j.mail.yandex.net (Yandex) with ESMTP id B27C03C80A5F; Wed, 19 Jul 2017 16:38:22 +0300 (MSK) Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 9dOeFtqVEp-cLaeuuUx; Wed, 19 Jul 2017 16:38:21 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1500471501; bh=AFbULexkvkNiH0B6IBZyz+4Y7YYkHTTSKGENf5GZ24Y=; h=Subject:To:References:From:Message-ID:Date:In-Reply-To; b=YER/D6TajcjLofuIGvyxEiK4uUxnn6TGIcbBWNXxJJltlUTuvtPdmk4F+x2VHg0KS Sb7Tj3uNQ4+81HbXPshrWgtIsjkeLlXigUGZQvgY73UYr23VYY9t3jXXblXOE4nXpI 63Mb+LHqqUUEen4D/CtTo+T7EilRu6kT78L0e40A= Authentication-Results: smtp1j.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-Suid-Status: 1 0,1 0 Subject: Re: NAT before IPSEC - reply packets stuck at enc0 To: "Muenz, Michael" , freebsd-net@freebsd.org References: <459d59f7-2895-8aed-d547-be46a0fbb918@spam-fetish.org> <1c0de616-91ff-a6f9-d946-f098bc1a709f@spam-fetish.org> <911903d1-f353-d5d6-d400-d86150f88136@yandex.ru> <2d607e1a-a2c0-0f85-1530-c478962a76cd@spam-fetish.org> <3344e189-cdf0-a2c9-3a2a-645460866f2d@yandex.ru> <1279753e-9ad1-2c02-304e-5001e2bbc82f@spam-fetish.org> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Message-ID: <15e6eb38-ef0c-7bfd-5f2c-d2acc8ea1af4@yandex.ru> Date: Wed, 19 Jul 2017 16:35:45 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 MIME-Version: 1.0 In-Reply-To: <1279753e-9ad1-2c02-304e-5001e2bbc82f@spam-fetish.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="I16qIIKMIn6oDPRImqGQAU6hsSKg1O7GG" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jul 2017 13:38:35 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --I16qIIKMIn6oDPRImqGQAU6hsSKg1O7GG Content-Type: multipart/mixed; boundary="3ivEsMHnttj1hfKnEv9fdj6FVl0EeGhsk"; protected-headers="v1" From: "Andrey V. Elsukov" To: "Muenz, Michael" , freebsd-net@freebsd.org Message-ID: <15e6eb38-ef0c-7bfd-5f2c-d2acc8ea1af4@yandex.ru> Subject: Re: NAT before IPSEC - reply packets stuck at enc0 References: <459d59f7-2895-8aed-d547-be46a0fbb918@spam-fetish.org> <1c0de616-91ff-a6f9-d946-f098bc1a709f@spam-fetish.org> <911903d1-f353-d5d6-d400-d86150f88136@yandex.ru> <2d607e1a-a2c0-0f85-1530-c478962a76cd@spam-fetish.org> <3344e189-cdf0-a2c9-3a2a-645460866f2d@yandex.ru> <1279753e-9ad1-2c02-304e-5001e2bbc82f@spam-fetish.org> In-Reply-To: <1279753e-9ad1-2c02-304e-5001e2bbc82f@spam-fetish.org> --3ivEsMHnttj1hfKnEv9fdj6FVl0EeGhsk Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 19.07.2017 15:46, Muenz, Michael wrote: > Am 19.07.2017 um 14:22 schrieb Andrey V. Elsukov: >> >> Different NAT instances will not work for the same flow, because they >> have different state tables. Packets in both direction should pass >> trough the same NAT instance. >> >> What you see in tcpdump on the enc0 interface? >> > Ok, also tried with one nat instance, same result: >=20 > ipfw nat 1 config ip 10.26.1.1 log reverse > ipfw add 179 nat 1 log all from 10.26.2.0/24 to 10.24.66.0/24 > ipfw add 179 nat 1 log all from 10.24.66.0/24 to 10.26.1.1 in recv enc0= >=20 > LAN Interface: > 14:40:32.441506 IP 10.26.2.11 > 10.24.66.25: ICMP echo request, id > 45314, seq 256, length 8 > 14:40:33.441565 IP 10.26.2.11 > 10.24.66.25: ICMP echo request, id > 45314, seq 512, length 8 > 14:40:34.441635 IP 10.26.2.11 > 10.24.66.25: ICMP echo request, id > 45314, seq 768, length 8 >=20 > enc0 interface > 14:40:32.441553 (authentic,confidential): SPI 0x8fe95b44: IP 10.26.1.1 = > > 10.24.66.25: ICMP echo request, id 64122, seq 256, length 8 > 14:40:32.449671 (authentic,confidential): SPI 0xcbc867ea: IP 10.24.66.2= 5 >> 10.26.1.1: ICMP echo reply, id 64122, seq 256, length 8 > 14:40:33.441613 (authentic,confidential): SPI 0x8fe95b44: IP 10.26.1.1 = > > 10.24.66.25: ICMP echo request, id 64122, seq 512, length 8 > 14:40:33.450623 (authentic,confidential): SPI 0xcbc867ea: IP 10.24.66.2= 5 >> 10.26.1.1: ICMP echo reply, id 64122, seq 512, length 8 > 14:40:34.441683 (authentic,confidential): SPI 0x8fe95b44: IP 10.26.1.1 = > > 10.24.66.25: ICMP echo request, id 64122, seq 768, length 8 > 14:40:34.449786 (authentic,confidential): SPI 0xcbc867ea: IP 10.24.66.2= 5 >> 10.26.1.1: ICMP echo reply, id 64122, seq 768, length 8 Check what you will see if you set net.enc.in.ipsec_bpf_mask=3D3. You should see the reply two times, the second one should be with translated address. --=20 WBR, Andrey V. Elsukov --3ivEsMHnttj1hfKnEv9fdj6FVl0EeGhsk-- --I16qIIKMIn6oDPRImqGQAU6hsSKg1O7GG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAllvYDEACgkQAcXqBBDI oXq+tQf7Bw28qDdUnrSGqEo1aJqyXh66v3jUj1KIQRneeDRKNlouMK+p4eNTdqQy QjmXZekRiHKEVoyBIuvXFIBakN8XmGjAy591zPRciu+cnyAtub9B4u7+NFUUkEWE LS+szgnebxqrhcjRwuxVznFykDmcXUo4/BNFc32jPAad5twyUOAZ3fe/rrMpzhkf tPhU1KdhUZF6biSefFmtch8OdvzLiXGQxZZbLDMbxCk6tmYsIrX+YpxPxr5jOUjl NymB80oM2rj4TZTM9kEf8YAwoU1kZwGrAjm+HDYyfNI3Ic9u+fN3dGFBCr7nn+Yg KtzrlxGpBg/9gK4qfT3bYvnbwQuaMQ== =cXo5 -----END PGP SIGNATURE----- --I16qIIKMIn6oDPRImqGQAU6hsSKg1O7GG--