Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Jul 2017 16:35:45 +0300
From:      "Andrey V. Elsukov" <bu7cher@yandex.ru>
To:        "Muenz, Michael" <m.muenz@spam-fetish.org>, freebsd-net@freebsd.org
Subject:   Re: NAT before IPSEC - reply packets stuck at enc0
Message-ID:  <15e6eb38-ef0c-7bfd-5f2c-d2acc8ea1af4@yandex.ru>
In-Reply-To: <1279753e-9ad1-2c02-304e-5001e2bbc82f@spam-fetish.org>
References:  <459d59f7-2895-8aed-d547-be46a0fbb918@spam-fetish.org> <a082662c-145e-0132-18ef-083adaa59c33@yandex.ru> <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>

next in thread | previous in thread | raw e-mail | index | archive | help
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" <bu7cher@yandex.ru>
To: "Muenz, Michael" <m.muenz@spam-fetish.org>, 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>
 <a082662c-145e-0132-18ef-083adaa59c33@yandex.ru>
 <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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15e6eb38-ef0c-7bfd-5f2c-d2acc8ea1af4>