From owner-freebsd-net@freebsd.org Wed Mar 8 17:04:01 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 C9A7ED01E3A for ; Wed, 8 Mar 2017 17:04:01 +0000 (UTC) (envelope-from fjwcash@gmail.com) Received: from mail-oi0-x232.google.com (mail-oi0-x232.google.com [IPv6:2607:f8b0:4003:c06::232]) (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 94A251B4B for ; Wed, 8 Mar 2017 17:04:01 +0000 (UTC) (envelope-from fjwcash@gmail.com) Received: by mail-oi0-x232.google.com with SMTP id 126so22649670oig.3 for ; Wed, 08 Mar 2017 09:04:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=tEQCduUn3/eix3kUTvHv++YBjuT8SHQ3wIYzwJpe4VY=; b=Rt6gOvPFB0IKa4sB67nwTC/zlyp0f0kcuegKIv5U9ANJgbQofAx7PR2iN1cGUs5aF7 F5wkn+REA5T/Hju/6ujNGP5sssJnC/IhjHsSTguEfLHbgw8He6TLFHrH0zU3zZniuSuH 4Pa6v8G4CuJGp7r1ATYm+thKmAN0tAiEgxXwwuCo2TUsAKbXoHNp5X5Tq/Txaw1NeL+s Wr3bJKZgLnUmltrGndjP47pqNEDPaMXiNQEu+tPosNgNGKCoZSGlF84bP1jbA+Pv9aS9 JKfXYrY5fK3gbJzM2oDsJQslvb0puTgGlTGixbnXAJtT/2Dlvgl32NZ1gWIRa0lPZPn1 8H/g== 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:cc; bh=tEQCduUn3/eix3kUTvHv++YBjuT8SHQ3wIYzwJpe4VY=; b=VKgnpSLhZ1YZGmZaPHeryQGa6gokPPcUoIQyNATXRPgZsd56dBv2xIZY5IS8GZU95F JC5gw5tEA8VF+tysodoCmAf1dugk4gYIGzNUq3SMTQ7i9rqvQ/2PRPcJ0Qhi7cVg/H+D bypZ1oz6iS9ZT7D34AJ/GYXQOvfO6C/xnVekgfUbgso7WSzjO7Cr1GDaDlY0eixwezV3 4of0BxQv1kDuKMKyv3Bw2+nP7RkNnccV7i1DYQOd418mAVgFqiYCFMn0+mfkRGIblL6J 9TSt9iSa5NOU29RwjzlQUQmoiIhBVFWnEVgK5Zq1GSbdB0tF0QfmKh59IZOop29OyTl+ 24NA== X-Gm-Message-State: AMke39lverqp5yOAKQ61R18itW5wKzto7XuD3G040Ft/ehqCcWqFLuM2Nr531bHDLjgpfH3y6O9DrzkznxKdTw== X-Received: by 10.200.0.25 with SMTP id a25mr8248235qtg.199.1488992639656; Wed, 08 Mar 2017 09:03:59 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.28.202 with HTTP; Wed, 8 Mar 2017 09:03:59 -0800 (PST) In-Reply-To: References: From: Freddie Cash Date: Wed, 8 Mar 2017 09:03:59 -0800 Message-ID: Subject: Re: Some questions about in-kernel NAT To: Andrea Venturoli Cc: freebsd-net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 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, 08 Mar 2017 17:04:01 -0000 On Wed, Mar 8, 2017 at 7:52 AM, Andrea Venturoli wrote: > Hello. > > I'm using "ipfw nat" on several 10.3 boxes, but I have some questions. > > Let's start with a simple one: how do I list configured NATs and their > details? > I know I can configure a NAT with "ipfw nat 1 config ...", but how do I > show what I did? > It's listed in the EXAMPLES section of the ipfw(8) man page. ipfw nat show config=E2=80=8B <-- view config for all nat instances ipfw nat 123 show config <-- view config for nat 123 ipfw nat 111-999 show <-- view logs for nat 111-999 > Let's get to my problem now: > _ at boot, my re0 interface is configured with IP 192.168.0.1, along with > an alias (192.168.0.2); > _ my ipfw rules get loaded, issuing a "nat 2 config ip 192.168.0.1" > command; > _ after that ezjail is started, featuring a jail on 192.168.0.3. > From this point on, my aliased packets go out with 192.168.0.3 as source > address. I have to manually run "ipfw nat 2 config ip 192.168.0.1" again, > in order to have them correctly going with the desired IP. > =E2=80=8BWhat's the ipfw command that's run at boot time? Sounds like it's configured to use the interface address instead of a specific IP address.= =E2=80=8B --=20 Freddie Cash fjwcash@gmail.com