[PR #5707] [client] Add dual-stack nftables manager with IPv6 table support #23718

Open
opened 2026-08-05 06:07:45 -04:00 by saavagebueno · 0 comments
Owner

Original Pull Request: https://github.com/netbirdio/netbird/pull/5707

State: closed
Merged: Yes


Describe your changes

  • Add addrFamily abstraction encapsulating IPv4/IPv6 header offsets, address lengths, set key types, and ICMP protocol numbers
  • Create parallel ip6 netbird table with its own router and ACL manager when the interface has IPv6
  • Route all firewall operations to the correct table by address family
  • Split UpdateSet prefixes by family for dynamic DNS route sets
  • Add IPv6 interval set tests (TestNftablesCreateIpSet_IPv6) and calculateLastIP tests covering both families
  • MSS clamping uses correct overhead per family (40 for v4, 60 for v6)

Stacked on #5706.

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

https://github.com/netbirdio/docs/pull/667

Summary by CodeRabbit

  • New Features

    • Added full IPv6 support across firewall filtering, routing, NAT (including DNAT) and MSS handling; firewall now manages IPv4 and IPv6 in parallel with mirrored NAT for IPv6 destinations and dual-stack rule management.
  • Tests

    • Expanded IPv6 test coverage and compatibility checks, including IP set creation, prefix/address calculations, protocol handling, and ip6tables interoperability.
**Original Pull Request:** https://github.com/netbirdio/netbird/pull/5707 **State:** closed **Merged:** Yes --- ## Describe your changes - Add `addrFamily` abstraction encapsulating IPv4/IPv6 header offsets, address lengths, set key types, and ICMP protocol numbers - Create parallel `ip6 netbird` table with its own router and ACL manager when the interface has IPv6 - Route all firewall operations to the correct table by address family - Split `UpdateSet` prefixes by family for dynamic DNS route sets - Add IPv6 interval set tests (`TestNftablesCreateIpSet_IPv6`) and `calculateLastIP` tests covering both families - MSS clamping uses correct overhead per family (40 for v4, 60 for v6) Stacked on #5706. ## Issue ticket number and link ## Stack - #5631 - #5675 - #5686 - #5687 - #5688 - #5706 - #5707 :point_left: - #5708 ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [ ] It is a refactor - [x] Created tests that fail without the change (if possible) > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [x] I added/updated documentation for this change - [ ] Documentation is **not needed** for this change (explain why) ### Docs PR URL (required if "docs added" is checked) Paste the PR link from https://github.com/netbirdio/docs here: https://github.com/netbirdio/docs/pull/667 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added full IPv6 support across firewall filtering, routing, NAT (including DNAT) and MSS handling; firewall now manages IPv4 and IPv6 in parallel with mirrored NAT for IPv6 destinations and dual-stack rule management. * **Tests** * Expanded IPv6 test coverage and compatibility checks, including IP set creation, prefix/address calculations, protocol handling, and ip6tables interoperability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
saavagebueno added the pull-request label 2026-08-05 06:07:45 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#23718