From nobody Wed Dec 1 13:10:35 2021 X-Original-To: freebsd-pf@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8D0F618C45CE for ; Wed, 1 Dec 2021 13:10:44 +0000 (UTC) (envelope-from franco@lastsummer.de) Received: from host64.shmhost.net (host64.shmhost.net [213.239.241.64]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4J3zwg3DJ4z3s1c for ; Wed, 1 Dec 2021 13:10:43 +0000 (UTC) (envelope-from franco@lastsummer.de) Received: from smtpclient.apple (p200300cd8713f4fc803801c1685adbc8.dip0.t-ipconnect.de [IPv6:2003:cd:8713:f4fc:8038:1c1:685a:dbc8]) by host64.shmhost.net (Postfix) with ESMTPSA id 4J3zwX1DyMzNqZW; Wed, 1 Dec 2021 14:10:36 +0100 (CET) Content-Type: text/plain; charset=utf-8 List-Id: Technical discussion and general questions about packet filter (pf) List-Archive: https://lists.freebsd.org/archives/freebsd-pf List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-pf@freebsd.org X-BeenThere: freebsd-pf@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: Logging NAT translations and correlating nat & rule logs From: Franco Fichtner In-Reply-To: Date: Wed, 1 Dec 2021 14:10:35 +0100 Cc: freebsd-pf@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: To: =?utf-8?Q?=C3=96zkan_KIRIK?= X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Virus-Scanned: clamav-milter 0.103.3 at host64.shmhost.net X-Virus-Status: Clean X-Rspamd-Queue-Id: 4J3zwg3DJ4z3s1c X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of franco@lastsummer.de has no SPF policy when checking 213.239.241.64) smtp.mailfrom=franco@lastsummer.de X-Spamd-Result: default: False [-0.94 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-0.34)[-0.338]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[lastsummer.de]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_SPF_NA(0.00)[no SPF record]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:213.239.192.0/18, country:DE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N Hi =C3=96zkan, > On 28. Nov 2021, at 8:06 PM, =C3=96zkan KIRIK = wrote: >=20 > I'm trying to log NAT, BINAT, RDR translations. But the "nat log on > ...." statement only logs the packets after translation is done. So > the information before translation is lost. > Is there a way to log the translation details ? https://github.com/freebsd/freebsd-src/commit/8e496ea1df1 was introduced to address this but has not been moved to stable/12 or stable/13. I see there is some controversy around patches that made it to stable for less so I'd probably advocate to add this patch as well since it solves a longterm issue with NAT logging visibility. Cheers, Franco