🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: muc.lists.freebsd.bugs
Article #847

[Bug 301277] NAT pool behavior change from FreeBSD 14 -> 15 with IPv6

#847
From: bugzilla-noreply
Date: Mon, 30 Nov 2026 01:57
69 lines
4366 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=301277

            Bug ID: 301277
           Summary: NAT pool behavior change from FreeBSD 14 -> 15 with
                    IPv6
           Product: Base System
           Version: 15.1-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: steve.kerrison@jcu.edu.au

The changes to pf introduced between FreeBSD 14 and 15 have created
inconsistencies in the behavior of NAT in IPv6. When the target of a
translation is a dynamic interface's network `(iface:network...)`, source-hash
and random pools no longer target the full supplied subnet, but only the base
address of the network.

The simplest example is, for:

nat on $b_if inet6 from 2001:db8:aaaa::/56 to !2001:db8:aaaa::/56 ->
($pd_if:network:0) source-hash

Where $pd_if has 2001:db8:ffff::1/64 assigned to it, in 14.x, translated
addresses originating from 2001:db8:aaaa::/56 will NAT to addresses throughout
2001:db8:ffff:: -- 2001:db8:ffff::ffff:ffff:ffff:ffff as one would expect. On
15.x, *all* translated addresses use 2001:db8:ffff::

This is the case for both source-hash and random, whereas round-robin still
works.

I've produced a script to test this against a pair of fresh VMs, each with
three network interfaces, the 'WAN' side of which must be connected together,
but the others just need to be up and assigned addresses by the script. I've
also included the output of my tests from this script with a 14.4 and 15.1
release. I will test on 15.2-RC1 shortly as well.

The test code and my results are in this repo:
https://github.com/stevekerrison/freebsd-pf-snat-bug

My testing also exposes some changes in previously erroneous configurations,
that now work but may not be working as expected. My particular use case was
using (iface:network:0) but I expanded my test to include all forms of
:network, dynamic and static, with and without extra alias addresses assigned
to the interface. The results table from my tests is inlined below.

This bug was discovered while using OPNsense
(https://github.com/opnsense/src/issues/359), but my testing was since done in
FreeBSD.

-- 
You are receiving this mail because:
You are the assignee for the bug.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Technical Details
Message-ID: <bug-301277-227@https.bugs.freebsd.org/bugzilla/>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!weretis.net!feeder8.news.weretis.net!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!weretis.net!feeder8.news.weretis.net!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mail
From: bugzilla-noreply@freebsd.org
Newsgroups: muc.lists.freebsd.bugs
Subject: [Bug 301277] NAT pool behavior change from FreeBSD 14 -> 15 with
 IPv6
Date: Mon, 30 Nov 2026 01:57:00 +0000
Organization: Newsgate at muc.de e.V.
Approved: news-admin@muc.de
Distribution: world
Message-ID: <bug-301277-227@https.bugs.freebsd.org/bugzilla/>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2";
	logging-data="16370"; mail-complaints-to="news-admin@muc.de"
X-Original-To: bugs@mlmmj.nyi.freebsd.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1796003820;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding;
	bh=YDWDiT/ydN1nDNjilIecNQ1px5Z+veVRynZTGaM/RCM=;
	b=lTW9smmX5HNBJkYy6VWt+pMbU3ihHcLru82lELWbogrg1HA1A0xnSK9Ekv32ZM44DG6xTJ
	af2yE5iDw6yYzIuc9LG/qtLuMyqt+TL14a07+am4OyIfyJDJ8/IJGN79uL69tCLWZrv+Qu
	9HaMTPu3z1lgXoWNrCd3LMuVebIQY3v6j9M3C7keXinamBwELJYdqNAGVLeXsi7zLK+eLb
	p+t5D9paIYSPrLzDqazkI+OKLNjpCABhBxwLpL+v0HqmYnNs7j5QI7P7dhAgo1tFSXO0qM
	panFnpnCm5R/dUbjYMNWv7XlDocoAnccxZ7dz3PXnf3vqj2zPE5oyjPGli0Dww==
X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f
Auto-Submitted: auto-generated
Precedence: list
X-Newsgate-Id: f02c70b8849f+
X-No-Archive: Yes