From owner-freebsd-pf@freebsd.org Wed Apr 5 09:34:51 2017 Return-Path: Delivered-To: freebsd-pf@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 DDB13D2EE77 for ; Wed, 5 Apr 2017 09:34:51 +0000 (UTC) (envelope-from paul.g.webster@googlemail.com) Received: from mail-yw0-x22b.google.com (mail-yw0-x22b.google.com [IPv6:2607:f8b0:4002:c05::22b]) (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 9D5979D6 for ; Wed, 5 Apr 2017 09:34:51 +0000 (UTC) (envelope-from paul.g.webster@googlemail.com) Received: by mail-yw0-x22b.google.com with SMTP id v76so3366858ywg.0 for ; Wed, 05 Apr 2017 02:34:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=xvjEAgD2BKd9UK6NWeZKiCpSOqhwRlGjM/wSEHy4eps=; b=CiB/cp8RD+GqPLOddHP+elfO87v//XdCOuY38ImnyVRXgeYeOIS61W+OO7aI5B8D28 DD+zLrEAc5ibVz+ceCLCgocPGNED/cUF5VhvApSuumI/Q3+/FM9GprFVMoaYXgB4v/lx shk3K5Yuww39xeR4DHsHO0sbPvGAcFKOhstHrD02oaUejua3d9Wa+Cl76W7B/FY/9aIP A3nQoBwKJKTKsN79WRzfreF/XH82Pi8YqBoPMV04gWHvjUNSaNTkY+YfO9zylYASvoEB OeY81b3QEPQsT+d91dt2XpyORyWDUgtUqj81ZIiR3Os0BRuE9/HK1R5Fg0bgUJKJyv3M jxEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=xvjEAgD2BKd9UK6NWeZKiCpSOqhwRlGjM/wSEHy4eps=; b=ZoPv6Oh12GdTGoK58EgJ3PXrvWv+5ExKgEqWTfDLhWkFN78fhjLJEDxm1QvCpu/aVl YsPXOUrj2K9CBy1yy7HIdMIM2zFVLCUKJilLLpFcxR5Flto6SythUJEAf7uymsjvvZxp mAJLd+nVwrv8QMI/9UaNjwt/6RLq5gce5aHxNZeSAI/XeHjNty0p/A0s5L+ru2y0+q7A rxBw4nDmrvZ6c44sn4/9sByYc3t4jQ5wVr/nMr3icpvdbpleSgq3AP8tDP4jG0YwwrMD D9kbkuPlRs4HuqiODDRulnFQjAeaQBF6qG/wLjOYZsh5hRFALpzMz0sNZQV21P/b0OYo PJIw== X-Gm-Message-State: AFeK/H1CFb/1s6Aqr+yVytdqPP4iLBgn8sfnS+5shl03DK6uBanQdpGgmJm9WtnI1CSxmp5hORSMtHPFBeXChQ== X-Received: by 10.129.91.86 with SMTP id p83mr17404389ywb.50.1491384890452; Wed, 05 Apr 2017 02:34:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.37.5 with HTTP; Wed, 5 Apr 2017 02:34:50 -0700 (PDT) In-Reply-To: <47feb5d2-ff8b-3657-5d92-207ca341a6ab@als.nnov.ru> References: <47feb5d2-ff8b-3657-5d92-207ca341a6ab@als.nnov.ru> From: Paul Webster Date: Wed, 5 Apr 2017 10:34:50 +0100 Message-ID: Subject: Re: Complicated NAT setup To: freebsd-pf@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Apr 2017 09:34:52 -0000 Thank you for the fast reply mark, here is a list of interfaces with there relative ips: GW1(local lan gateway): lo0: 127.0.0.1 ::1 igb0: 86.5.192.180 (public_ip) igb1: 172.31.33.1/24 (private lan) msk0: unused/192.168.0.1 tun0: 172.19.20.2 gre0: 10.0.0.1 (via igb0) GW2(vps remote gateway): lo0: 127.0.0.1 ::1 vio0: 185.157.232.30 gre0: 10.0.0.2 (via vio0) Xbox1 ( GW1[igb1->gre0] -> GW2[gre0->vio0] ): lo0: 127.0.0.1 ::1 vtnet0: 172.31.33.254 NOTE: xbox1 in this case is really freebsd 12-current with the forced ip 172.31.33.254, because xbox really is to restrictive for debug purposes, all it requires is that I set the correct dhcp-host on GW1 to make the xbox1 172.31.33.254 though. Also the $localnet is really { 172.31.33.2-200 } so when the XBOX is 172.31.33.254 it is not going out via primary NAT rule it is instead getting caught by pass in quick on $int_if from $josh_xbox rtable 1 # Swap packets from the xbox to fib1 routing table and the corresponding NAT further up the ruleset, the 'default route' of 'fib 1' is 10.0.0.2