In You I trust! After upgrading from 14.3-RELEASE-p9 GENERIC to 14.4-RELEASE-p3 GENERIC I have got broken kernel nat. I have the FreeBSD host box with a lot of jails. The packet path is that: cetus (jail) <-> bridge (local net) <-> lupus (jail) <-> bridge (hoster net) <-> uplink <-> internet <-> badger I run on the cetus: echo 1 | nc -N -u -p 55555 badger 5201 and on the badger i see: IP (tos 0x0, ttl 59, id 43400, offset 0, flags [none], proto UDP (17), length 30) *.9.0.244.55555 > *.230.26.243.5201: [bad udp cksum 0x893c -> 0x44a5!] UDP, length 2 I try 14.3-RELEASE-p9 GENERIC and get the same. But with 14.3-RELEASE-p9 GENERIC i get IP (tos 0x0, ttl 59, id 49222, offset 0, flags [none], proto UDP (17), length 30) *.9.0.244.55555 > *.230.26.243.5201: [udp sum ok] UDP, length 2
"I try 14.3-RELEASE-p9 GENERIC and get the same." should be "I try 14.4-RELEASE GENERIC and get the same." my typo :(
If you disable -txcsum and -rxcsum on the interfaces involved (do it one at a time to see which is implicated if its only one) that might narrow it down.....
(In reply to Eugene from comment #1) Where in your diagram is the in-kernel NAT applied?
i wrote some more on this on the mailing list. It kept me busy for a week+, and initially i thought it was a IPFW issue. Hence i wrote that mailing list. https://lists.freebsd.org/archives/freebsd-ipfw/2026-April/000546.html
(In reply to Michael Tuexen from comment #4) Hello The in-kernel nat works on the external lupus interface: lupus (jail) <-> bridge (hoster net) eugene@lupus:~$ ifconfig inet0 inet0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 options=60000b<RXCSUM,TXCSUM,VLAN_MTU,RXCSUM_IPV6,TXCSUM_IPV6> ether 02:35:28:c4:b0:0b inet *.9.0.242 netmask 0xffffffe0 broadcast *.9.0.255 inet *.9.0.244 netmask 0xffffffff broadcast *.9.0.244 groups: epair media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>) status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> From the host side where lupus is running it looks like this (ixl0 - physical iface, inet0 - bridge, epair110a - lupus): ixl0: flags=1008943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 options=e500bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,VLAN_HWFILTER,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6,HWSTATS> ether ac:1f:6b:ba:63:24 media: Ethernet autoselect (1000baseT <full-duplex>) status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> inet0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 description: Stel UPLINK options=0 ether 58:9c:fc:10:ff:b6 inet *.9.0.241 netmask 0xffffffe0 broadcast *.9.0.255 id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15 maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200 root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0 member: epair111a flags=223<LEARNING,DISCOVER,EDGE> ifmaxaddr 0 port 13 priority 128 path cost 2000 member: epair110a flags=223<LEARNING,DISCOVER,EDGE> ifmaxaddr 0 port 7 priority 128 path cost 2000 member: ixl0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> ifmaxaddr 0 port 1 priority 128 path cost 55 groups: bridge nd6 options=9<PERFORMNUD,IFDISABLED> epair110a: flags=1008943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 description: jail:lupus:inet options=60000b<RXCSUM,TXCSUM,VLAN_MTU,RXCSUM_IPV6,TXCSUM_IPV6> ether 02:35:28:c4:b0:0a groups: epair media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>) status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> I tryed 'ifconfig ixl0 -txcsum -rxcsum', but it did not fix the checksum problem.
You have to run it on the epair device of the jail. Either in the jail or on the counter part of the eapri on the host to get tcp/udp nat functioning again.
(In reply to Rob Bloemers from comment #7) NAT is working on the inet0 interface (epair) inside jail lupus and this configuration worked fine in 14.3. The problems begen from update to 14.4. Now I had to switch to natd to mitigate udp/tcp in-kernel nat issue.
I was able to reproduce the bug and submitted a patch. https://reviews.freebsd.org/D57091 The bug is related to a feature FreeBSD 14.4-RELEASE seems to include that allows using checksum offloading over epair. I don't know if the patch goes in and in which version. If you need a quick fix, you can just disable checksum offloading on the outgoing interface in the jail. In your setup, run cetus: ifconfig epairXY -txcsum After that, cetus no longer uses checksum offloading just like before 14.4-RELEASE.
(In reply to Timo Voelker from comment #9) Hello After applying the patch in-kernel nat works as should in 14.4-RELEASE-p4 Thanks a lot
Great! Thanks for testing.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=81b47a7c604f1d563283759572fa7a1f9d4dc56f commit 81b47a7c604f1d563283759572fa7a1f9d4dc56f Author: Timo Völker <timo.voelker@fh-muenster.de> AuthorDate: 2026-05-21 10:54:44 +0000 Commit: Michael Tuexen <tuexen@FreeBSD.org> CommitDate: 2026-05-21 10:54:44 +0000 ipfw: fix checksum after NAT When checksum offloading is used, IPFW needs to fix the checksum after libalias has done NAT. The ipfw_nat() function does so, but only for mbufs without a receiving interface. However, if, for example, the packet was sent inside a jail that used checksum offloading over an epair, ipfw still needs to fix the checksum even though the mbuf has set a receiving interface (epair). This patch just removes the check whether a receiving interface is set. PR: 295057 Reviewed by: tuexen MFC after: immediately Differential Revision: https://reviews.freebsd.org/D57091 sys/netpfil/ipfw/ip_fw_nat.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
A commit in branch stable/15 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=198379d2c29fae7300b650a96199e51a66b87364 commit 198379d2c29fae7300b650a96199e51a66b87364 Author: Timo Völker <timo.voelker@fh-muenster.de> AuthorDate: 2026-05-21 10:54:44 +0000 Commit: Michael Tuexen <tuexen@FreeBSD.org> CommitDate: 2026-05-21 11:11:36 +0000 ipfw: fix checksum after NAT When checksum offloading is used, IPFW needs to fix the checksum after libalias has done NAT. The ipfw_nat() function does so, but only for mbufs without a receiving interface. However, if, for example, the packet was sent inside a jail that used checksum offloading over an epair, ipfw still needs to fix the checksum even though the mbuf has set a receiving interface (epair). This patch just removes the check whether a receiving interface is set. PR: 295057 Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D57091 (cherry picked from commit 81b47a7c604f1d563283759572fa7a1f9d4dc56f) sys/netpfil/ipfw/ip_fw_nat.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=151d5f620d9abd0fcea51aed465b8adb213ea3c3 commit 151d5f620d9abd0fcea51aed465b8adb213ea3c3 Author: Timo Völker <timo.voelker@fh-muenster.de> AuthorDate: 2026-05-21 10:54:44 +0000 Commit: Michael Tuexen <tuexen@FreeBSD.org> CommitDate: 2026-05-21 09:19:05 +0000 ipfw: fix checksum after NAT When checksum offloading is used, IPFW needs to fix the checksum after libalias has done NAT. The ipfw_nat() function does so, but only for mbufs without a receiving interface. However, if, for example, the packet was sent inside a jail that used checksum offloading over an epair, ipfw still needs to fix the checksum even though the mbuf has set a receiving interface (epair). This patch just removes the check whether a receiving interface is set. PR: 295057 Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D57091 (cherry picked from commit 81b47a7c604f1d563283759572fa7a1f9d4dc56f) sys/netpfil/ipfw/ip_fw_nat.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
Thanks for reporting and testing. I am closing this bug report, since the patch has been committed to main, stable/15, and stable/14.
Would this be important enough for an errata notice?
(In reply to Ronald Klop from comment #16) I have no idea. I can bring that up with re@, but I have a hard time to say how many people are affected. The work around is simple: disable checksum offloading on the epair interface. Some else also asked this privately...
A commit in branch releng/15.1 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=78de09e1412e2e720a2391457f65717248bad4f4 commit 78de09e1412e2e720a2391457f65717248bad4f4 Author: Timo Völker <timo.voelker@fh-muenster.de> AuthorDate: 2026-05-21 10:54:44 +0000 Commit: Colin Percival <cperciva@FreeBSD.org> CommitDate: 2026-05-21 21:21:05 +0000 ipfw: fix checksum after NAT When checksum offloading is used, IPFW needs to fix the checksum after libalias has done NAT. The ipfw_nat() function does so, but only for mbufs without a receiving interface. However, if, for example, the packet was sent inside a jail that used checksum offloading over an epair, ipfw still needs to fix the checksum even though the mbuf has set a receiving interface (epair). This patch just removes the check whether a receiving interface is set. Approved by: re (cperciva) PR: 295057 Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D57091 (cherry picked from commit 81b47a7c604f1d563283759572fa7a1f9d4dc56f) (cherry picked from commit 198379d2c29fae7300b650a96199e51a66b87364) sys/netpfil/ipfw/ip_fw_nat.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
(In reply to Michael Tuexen from comment #17) i'd like to see it go into production, for practical reasons.
(In reply to Rob Bloemers from comment #19) The fix will be in 15.1 and I am doing the prep work for an EN.