From owner-freebsd-questions@freebsd.org Fri Apr 2 20:36:09 2021 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77F525B11DA for ; Fri, 2 Apr 2021 20:36:09 +0000 (UTC) (envelope-from frank2@fjl.co.uk) Received: from bs1.fjl.org.uk (bs1.fjl.org.uk [84.45.41.196]) by mx1.freebsd.org (Postfix) with ESMTP id 4FBsJm6Lpnz3sWn for ; Fri, 2 Apr 2021 20:36:08 +0000 (UTC) (envelope-from frank2@fjl.co.uk) Received: from [192.168.1.181] (host86-173-112-21.range86-173.btcentralplus.com [86.173.112.21]) (authenticated bits=0) by bs1.fjl.org.uk (8.14.4/8.14.4) with ESMTP id 132Ka5I5014932 for ; Fri, 2 Apr 2021 21:36:06 +0100 (BST) (envelope-from frank2@fjl.co.uk) Subject: Re: pf or ipfw for NAT To: freebsd-questions@freebsd.org References: <50dcf18d-f9c3-71c2-abb0-eed8f1b5e192@fjl.co.uk> <20210402210356.637a3ed714957fb9c5fdfa3a@sohara.org> From: Frank Leonhardt Message-ID: <1ff607ca-79cc-3072-831c-54659920e9dc@fjl.co.uk> Date: Fri, 2 Apr 2021 21:36:04 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210402210356.637a3ed714957fb9c5fdfa3a@sohara.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-Rspamd-Queue-Id: 4FBsJm6Lpnz3sWn X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of frank2@fjl.co.uk designates 84.45.41.196 as permitted sender) smtp.mailfrom=frank2@fjl.co.uk X-Spamd-Result: default: False [-3.40 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:84.45.41.196:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; DMARC_NA(0.00)[fjl.co.uk]; RCVD_IN_DNSWL_MED(-0.20)[84.45.41.196:from]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:25577, ipnet:84.45.0.0/17, country:GB]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-questions]; RECEIVED_SPAMHAUS_PBL(0.00)[86.173.112.21:received] X-Mailman-Approved-At: Sat, 03 Apr 2021 07:58:58 +0000 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2021 20:36:09 -0000 On 02/04/2021 21:03, Steve O'Hara-Smith wrote: > On Fri, 2 Apr 2021 20:17:58 +0100 > Frank Leonhardt wrote: > >> For longer than I care to remember (FreeBSD 2)  I've implemented a >> physical asymmetric nat gateway using natd and ipfw. I just do what the >> user guide says and it works. > Yes it does and that's fine. > >> Am I using ipfw/natd for historical reasons? Can I do the same with pf? > Yes you can the relevant line in my pf.conf is: > > nat on $ext_if inet from !($ext_if) -> ($ext_if:0) Thanks Steve. Any idea whether I need to enable the gateway when using pf instead? e.g. sysctl net.inet.ip.forwarding=1 Thanks, Frank.