From owner-freebsd-stable@freebsd.org Tue May 16 00:22:33 2017 Return-Path: Delivered-To: freebsd-stable@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 DD618D6C999 for ; Tue, 16 May 2017 00:22:33 +0000 (UTC) (envelope-from mil@milshop.ru) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BAE71055 for ; Tue, 16 May 2017 00:22:33 +0000 (UTC) (envelope-from mil@milshop.ru) Received: by mail-wm0-x22f.google.com with SMTP id b84so108016465wmh.0 for ; Mon, 15 May 2017 17:22:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=milshop-ru.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=E+3u7BwIN7OI4zhn9EY3hLj+CBxKueAzOuFjA5/IES8=; b=sXMlmFDr63btJupB0f3FK9/2g5iOj/HwSPMdtH3UMA91pZxraaOFoYpEyMW9UtZIZa JGQu6cLsdD6gt7UYOt4lY/nAexyxI/Yy14Zv6bZplw4wO1nABXbCUSkzaQET1FQhd1st L3dPvcLo0DWudp5fT7ydcg8F051FcZFMD+kRr1q6jKLkAuNZnQF6bLGceWCncFBwX9ok sORRItcknIVwfQ2WvFEn/nsOeJ4+qtCVlTG/qUHdXcrikvMAyaANhxRSZ7+mJ2R2j/tw rzQiLgCRpcvAkoMcct65lb/HRLm2Y5PNo90roypPElM8efucUJlk3yL5zGa27Sz1RLCb 9Nkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=E+3u7BwIN7OI4zhn9EY3hLj+CBxKueAzOuFjA5/IES8=; b=PJgyTI9p9Mk01Y/0bFHuQuityMzWiMoxvVi5dbsbsgXVV4JPp7PwOSjWMp5qOZf/oF 3FnhvG819fYwxkqwLEOpZArYIVUwAFcheLALTODuryeKieqOuCpvOjVsGISb4DakzqUc 2GoEQctEe6qjztL1Q5UGIpShrckquBBy6CL/IJlbm9zQJ1f6UpVKlW/CiWmgPuQk2nJR p9ByZQijQrW90J8TJEQiR1fem/KpdXb91nJLFxw+PSs1fOtNPnpOKNIvDL/0YKwa3/L8 Z9WfHCTx5wU6zd421wErDCOsCNbyoMKnIoKvhJzTDj2SZam6vVljQvauK7NkW8X1l500 mNag== X-Gm-Message-State: AODbwcD2sZzWUPiBlgXjsJgnpRgvHNkwTRRv3MWowxUIHsKdJGZ74dJF jM/PSFd8kdSGMgbCTE0lnp/5YGdxohg3 X-Received: by 10.46.77.91 with SMTP id a88mr2674560ljb.1.1494894151312; Mon, 15 May 2017 17:22:31 -0700 (PDT) MIME-Version: 1.0 Sender: mil@milshop.ru Received: by 10.25.22.42 with HTTP; Mon, 15 May 2017 17:22:10 -0700 (PDT) In-Reply-To: References: From: Eugene Kazarinov Date: Tue, 16 May 2017 03:22:10 +0300 X-Google-Sender-Auth: WJ9acZLMaKvKjhX3w5yU9O_DR5o Message-ID: Subject: Re: something is not working: ipfw fwd VIA nat TO tun on FreeBSD-11 stable r318266 To: FreeBSD Stable Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 May 2017 00:22:34 -0000 I downgraded via makeworld&etc from /usr/src to 10.3-STABLE r318297 And now ipnat.rules is working and mapping forwarded packets. Maybe I forgot that pf nat didnt map forwarded packets on 10 version. I install this system some time ago. And dont remember which config is apply (ipnat.rules or pf.conf) By now I see that ipnat.rules is mapping forwarded packets on 10.3-STABLE and doesnt map they on version FreeBSD-11 stable r318266. So. Something in ipnat mechanism is broken in FreeBSD-11 stable r318266. 2017-05-15 23:28 GMT+03:00 Eugene Kazarinov : > Hello. > After upgrade from 10.3 stable something broke. > > I have tun0 > tun0: flags=8151 metric 0 mtu 1500 > options=80000 > inet 10.10.0.6 --> 10.10.0.5 netmask 0xffffffff > groups: tun > Opened by PID 1111 > > in pf.conf I have rule > nat on tun0 inet from 192.168.10.0/24 to any -> 10.10.0.6 > > ipfw forwarding rule: > ipfw 1500 fwd 10.10.0.5 ip from 192.168.10.0/24 to any via em0 > > ipfw sh counts > 01500 1609 102098 fwd 10.10.0.5 ip from 192.168.10.0/24 to any > via em0 > > So packets from network 192.168.10.0/24 forward to tun0 and I see it > there BUT > Why I see they not mapped?!: > > # tcpdump -ni tun0 > 23:02:15.207682 IP 192.168.10.2 > 8.8.8.8: ICMP echo request, id 1, seq > 2253, length 40 > On another side of tun0 there is no packets. > > If I ping 10.10.0.1 then I see right packets on both sided of tun0 (so > tun0 is up and working) > 23:03:15.989577 IP 10.10.0.6 > 10.10.0.1: ICMP echo request, id 25095, > seq 0, length 64 > 23:03:15.992260 IP 10.10.0.1 > 10.10.0.6: ICMP echo reply, id 25095, seq > 0, length 64 > > Why pf doesnt map packets which are forwarded via ipfw? > > BTW > I'd try > ipnat.rules > map tun0 from 192.168.10.0/24 to any -> 10.10.0.6/32 > > but ipnat doesnt map forwarded packets too. Why? > > How to fix it?! > >