[PR #5688] [client] Add IPv6 support to ACL manager, USP filter, and forwarder #26490

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

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

State: closed
Merged: Yes


Describe your changes

  • ACL manager: read SourcePrefixes from firewall rules (compact bytes), fall back to deprecated PeerIP for old management. Accumulate errors instead of rolling back on first failure.
  • USP filter: dual-parser decoder (v4/v6 selected by version nibble), ICMPv6 conntrack with echo type mapping, cross-family ICMP rule matching, IPv6 fragment detection, TCP MSS clamping with v6 pseudo-header
  • USP filter DNAT: rewriteIPv4/rewriteIPv6 split (v6 has no header checksum), updateICMPv6Checksum with pseudo-header, zero-alloc extractPacketIPs
  • USP forwarder: dual-stack gvisor NIC, ICMPv6 echo handling via ping6, proper [v6]:port formatting
  • Local IP manager: lock-free atomic snapshot with v4 bitmap + v6 map
  • Refactor: consolidate splitAllowedIPs/extractPeerIPs into overlayAddrsFromAllowedIPs returning typed netip.Addr
  • Tests for IPv6 peer ACL filtering, route ACL matching, and local IP detection

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

Summary by CodeRabbit

  • New Features

    • Full dual-stack IPv4/IPv6 support across firewall, NAT, routing, forwarding, and peer/route ACLs.
    • ICMPv6 support with echo handling, reply synthesis, and IPv6-aware ping selection.
  • Behavior Changes

    • Separate TCP MSS clamping for IPv4 vs IPv6.
    • Event/flow reporting and connection tracking now correctly handle IPv4 and IPv6.
    • ICMP error handling extended to ICMPv6.
  • Performance

    • Lock-free local IP snapshot for faster membership checks.
  • Tests

    • Added IPv6-focused tests and benchmarks for ACLs, NAT, forwarding, and local IP checks.
**Original Pull Request:** https://github.com/netbirdio/netbird/pull/5688 **State:** closed **Merged:** Yes --- ## Describe your changes - ACL manager: read `SourcePrefixes` from firewall rules (compact bytes), fall back to deprecated `PeerIP` for old management. Accumulate errors instead of rolling back on first failure. - USP filter: dual-parser decoder (v4/v6 selected by version nibble), ICMPv6 conntrack with echo type mapping, cross-family ICMP rule matching, IPv6 fragment detection, TCP MSS clamping with v6 pseudo-header - USP filter DNAT: `rewriteIPv4`/`rewriteIPv6` split (v6 has no header checksum), `updateICMPv6Checksum` with pseudo-header, zero-alloc `extractPacketIPs` - USP forwarder: dual-stack gvisor NIC, ICMPv6 echo handling via ping6, proper `[v6]:port` formatting - Local IP manager: lock-free atomic snapshot with v4 bitmap + v6 map - Refactor: consolidate `splitAllowedIPs`/`extractPeerIPs` into `overlayAddrsFromAllowedIPs` returning typed `netip.Addr` - Tests for IPv6 peer ACL filtering, route ACL matching, and local IP detection ## Issue ticket number and link ## Stack - #5631 - #5675 - #5686 - #5687 - #5688 :point_left: - #5706 - #5707 - #5708 ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [x] 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/>\_\_ <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Full dual-stack IPv4/IPv6 support across firewall, NAT, routing, forwarding, and peer/route ACLs. - ICMPv6 support with echo handling, reply synthesis, and IPv6-aware ping selection. - **Behavior Changes** - Separate TCP MSS clamping for IPv4 vs IPv6. - Event/flow reporting and connection tracking now correctly handle IPv4 and IPv6. - ICMP error handling extended to ICMPv6. - **Performance** - Lock-free local IP snapshot for faster membership checks. - **Tests** - Added IPv6-focused tests and benchmarks for ACLs, NAT, forwarding, and local IP checks. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
saavagebueno added the pull-request label 2026-08-05 07:07:24 -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#26490