From owner-freebsd-net@freebsd.org Wed Jul 19 12:45:51 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 8DC4EC7C917 for ; Wed, 19 Jul 2017 12:45:51 +0000 (UTC) (envelope-from m.muenz@spam-fetish.org) Received: from mailout-02.maxonline.de (mailout-02.maxonline.de [81.24.66.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4ACF97DD37 for ; Wed, 19 Jul 2017 12:45:51 +0000 (UTC) (envelope-from m.muenz@spam-fetish.org) Received: from web03-01.max-it.de (web03-01.max-it.de [81.24.64.215]) by mailout-02.maxonline.de (Postfix) with ESMTPS id C1CD74F for ; Wed, 19 Jul 2017 14:45:48 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by web03-01.max-it.de (Postfix) with ESMTP id B54F728B847 for ; Wed, 19 Jul 2017 14:45:48 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at web03-01.max-it.de Received: from web03-01.max-it.de ([127.0.0.1]) by localhost (web03-01.max-it.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id anCcirWo-KX7 for ; Wed, 19 Jul 2017 14:45:48 +0200 (CEST) Received: from [81.24.66.132] (unknown [81.24.66.132]) (Authenticated sender: m.muenz@spam-fetish.org) by web03-01.max-it.de (Postfix) with ESMTPA id 824D128AB1C for ; Wed, 19 Jul 2017 14:45:48 +0200 (CEST) Subject: Re: NAT before IPSEC - reply packets stuck at enc0 To: 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> From: "Muenz, Michael" Message-ID: <1279753e-9ad1-2c02-304e-5001e2bbc82f@spam-fetish.org> Date: Wed, 19 Jul 2017 14:46:03 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <3344e189-cdf0-a2c9-3a2a-645460866f2d@yandex.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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 12:45:51 -0000 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: 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 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 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.25 > 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.25 > 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.25 > 10.26.1.1: ICMP echo reply, id 64122, seq 768, length 8 ipfw -ta list 00179 4 112 Wed Jul 19 14:40:34 2017 nat 1 log ip from 10.26.2.0/24 to 10.24.66.0/24 00179 4 112 Wed Jul 19 14:40:34 2017 nat 2 log ip from 10.24.66.0/24 to 10.26.1.1 in recv enc0 Thanks, Michael