From owner-freebsd-net@freebsd.org Fri Jul 21 11:11:00 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 43442DA44F6 for ; Fri, 21 Jul 2017 11:11:00 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward5p.cmail.yandex.net (forward5p.cmail.yandex.net [IPv6:2a02:6b8:0:1465::15]) (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 D4AFF6C244 for ; Fri, 21 Jul 2017 11:10:59 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::28]) by forward5p.cmail.yandex.net (Yandex) with ESMTP id 86F8A20C98; Fri, 21 Jul 2017 14:10:56 +0300 (MSK) Received: from smtp4o.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp4o.mail.yandex.net (Yandex) with ESMTP id 805A86C01116; Fri, 21 Jul 2017 14:10:48 +0300 (MSK) Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 7ZBbPDgj51-AmP0FgJg; Fri, 21 Jul 2017 14:10:48 +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=1500635448; bh=5+y9o8Q5nElG72EgvahldOWu84DKEWObQ25tFi9E/bM=; h=Subject:To:References:From:Message-ID:Date:In-Reply-To; b=lhqwOM4lmecTf++LQyYtWbB09ATOijr1kFCqS9ze4anbz3Ls5yDvMrI7NhFQz7/q+ mVNqAQ0SRjBgZsJ9KMjsj/ZknGaWztddGxMuOZ2NXS1ysoAwqbnYtG+JXvFQFKKiv+ HCBO4K+gZtkLUhBjKzyjb0gWTQT2SAurnoZ4mwvM= Authentication-Results: smtp4o.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> <15e6eb38-ef0c-7bfd-5f2c-d2acc8ea1af4@yandex.ru> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Message-ID: <63e80fcf-915e-2dd5-d8c9-1904c8261c6f@yandex.ru> Date: Fri, 21 Jul 2017 14:08:03 +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: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gmPuCvSx6UrvnCXQKrGTPNihXU9uWuo96" 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: Fri, 21 Jul 2017 11:11:00 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --gmPuCvSx6UrvnCXQKrGTPNihXU9uWuo96 Content-Type: multipart/mixed; boundary="6H74GAuUPqBj0aa4sp75mfpNH8L5PhWQx"; protected-headers="v1" From: "Andrey V. Elsukov" To: "Muenz, Michael" , freebsd-net@freebsd.org Message-ID: <63e80fcf-915e-2dd5-d8c9-1904c8261c6f@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> <15e6eb38-ef0c-7bfd-5f2c-d2acc8ea1af4@yandex.ru> In-Reply-To: --6H74GAuUPqBj0aa4sp75mfpNH8L5PhWQx Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 21.07.2017 13:59, Muenz, Michael wrote: > Am 19.07.2017 um 15:35 schrieb Andrey V. Elsukov: >> >> 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. >> > Googling around with "nat before ipsec" and freebsd shows many topics > like this. > It seems with 11.0 release there were some significant changes to enc > which made this impossible. The only significant change to enc(4) was making it loadable. From other side it still work as before. Another problem is PF-specific, PF does if_output() after translation by self, and there is no chance for IPsec to finish encryption. Third problem mentioned here (deadlock in pf) is also PF-specific, and I'm not sure that it worked well before. With ipfw(4) it should work, at least on FreeBSD. pfsense/opensense have their own patches, so I don't know what can be wrong there. --=20 WBR, Andrey V. Elsukov --6H74GAuUPqBj0aa4sp75mfpNH8L5PhWQx-- --gmPuCvSx6UrvnCXQKrGTPNihXU9uWuo96 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/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAllx4JgACgkQAcXqBBDI oXpiWgf+LNL8tMmG1/PDAFA0mvQLMjueGeeoEy2krzM3Y6WktL8wp6VfEHuGaCth 0hhQZ3HJmcJRNjQQaT5IowN8kN217FrTGNhX1e9nthGlh8Kel+8qKX0mEsg8KIr2 w9pSjQdZPkG/c7abBcc6FybeoqlVSetkUj/BTE2RKgkjCVI4mA8OE55B31GE+Dj9 UthWEzvm+rIdK7JzmnhGu0/8arT3IcB/Y+8Xg2LgbGTo4p+SJl9dRqru5dUklu9D /+IJr7rtJdsIxL9QBMkoNvsgRKFpaEpehVx0uuRTtY3WpMswWqC9qe97C9Fb6ORL x5W/VROEX92qkPL8zrVa7gZZtX91Jg== =eIDK -----END PGP SIGNATURE----- --gmPuCvSx6UrvnCXQKrGTPNihXU9uWuo96--