[PR #5708] [client] Add dual-stack iptables manager with ip6tables support #28404

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

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

State: closed
Merged: Yes


Describe your changes

iptables

  • Add parallel ipv6Client/aclMgr6/router6 in the iptables manager, dispatching operations by address family
  • Use -v6 suffix for ip6 ipset names (kernel ipsets are global, need family separation)
  • MSS clamping uses correct overhead per family (40 for v4, 60 for v6)
  • State cleanup creates v6 components even when current run has no IPv6 (previous run may have left state)

Misc

  • Fix blockLanAccess to use matching source family for IPv6 LAN prefixes
  • Accumulate errors in Windows firewall cleanup so v6 rule deletion isn't skipped on v4 failure
  • Fix shouldForward in USP filter for dual-stack address comparison
  • Fix anonymizer test assertions for updated v6 start address
  • Nil guard on fakeAddress for v6 peer address handling
  • SSH normalizeLocalHost("*") returns "" for dual-stack listening

Stacked on #5707.

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/594

Summary by CodeRabbit

  • New Features

    • Added IPv6 support to firewall rules, routing, and NAT operations.
    • Enabled IP version selection in diagnostic ping commands.
    • Added CIDR prefix support in IP anonymization.
    • Implemented dual-stack WireGuard interface configuration.
  • Bug Fixes

    • Improved port forwarding wildcard behavior for dual-stack networks.
    • Enhanced IPv4-mapped address handling in connection tracking.
**Original Pull Request:** https://github.com/netbirdio/netbird/pull/5708 **State:** closed **Merged:** Yes --- ## Describe your changes ### iptables - Add parallel `ipv6Client`/`aclMgr6`/`router6` in the iptables manager, dispatching operations by address family - Use `-v6` suffix for ip6 ipset names (kernel ipsets are global, need family separation) - MSS clamping uses correct overhead per family (40 for v4, 60 for v6) - State cleanup creates v6 components even when current run has no IPv6 (previous run may have left state) ### Misc - Fix `blockLanAccess` to use matching source family for IPv6 LAN prefixes - Accumulate errors in Windows firewall cleanup so v6 rule deletion isn't skipped on v4 failure - Fix `shouldForward` in USP filter for dual-stack address comparison - Fix anonymizer test assertions for updated v6 start address - Nil guard on `fakeAddress` for v6 peer address handling - SSH `normalizeLocalHost("*")` returns `""` for dual-stack listening Stacked on #5707. ## Issue ticket number and link ## Stack - #5631 - #5675 - #5686 - #5687 - #5688 - #5706 - #5707 - #5708 :point_left: ### 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: - [ ] I added/updated documentation for this change - [x] 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/594 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added IPv6 support to firewall rules, routing, and NAT operations. * Enabled IP version selection in diagnostic ping commands. * Added CIDR prefix support in IP anonymization. * Implemented dual-stack WireGuard interface configuration. * **Bug Fixes** * Improved port forwarding wildcard behavior for dual-stack networks. * Enhanced IPv4-mapped address handling in connection tracking. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
saavagebueno added the pull-request label 2026-08-05 08:06:19 -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#28404