[PR #1091] [MERGED] Enable netbird traffic through uspfilter on Linux systems #14852

Closed
opened 2026-08-05 03:06:27 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/1091
Author: @gigovich
Created: 8/18/2023
Status: Merged
Merged: 8/22/2023
Merged by: @gigovich

Base: allow-netbird-trafficHead: allow-netbird-traffic-uspfilter


📝 Commits (5)

  • 3c2aa45 Enable netbird traffic through uspfilter on Linux systems
  • c63b951 Fix tests for ACL manager
  • fc5d8a8 ACL manager test fix
  • 9871819 Fix double call to AllowNetbird
  • 04a69f5 Fix tests after rebase

📊 Changes

8 files changed (+107 additions, -25 deletions)

View changed files

📝 client/firewall/iptables/manager_linux.go (+4 -0)
📝 client/firewall/uspfilter/allow_netbird.go (+1 -1)
client/firewall/uspfilter/allow_netbird_linux.go (+21 -0)
📝 client/firewall/uspfilter/uspfilter.go (+6 -0)
📝 client/internal/acl/manager.go (+0 -3)
📝 client/internal/acl/manager_create.go (+5 -0)
📝 client/internal/acl/manager_create_linux.go (+40 -9)
📝 client/internal/acl/manager_test.go (+30 -12)

📄 Description

Describe your changes

Enable netbird traffic through uspfilter on Linux systems

Issue:
While every firewall manager has an AllowNetbird method,
uspfilter doesn't utilize it on Linux due to the need
for system firewall traffic control.

Solution:
On Linux, we now attempt to initialize either nftables
or iptables within the ACL manager. We then invoke the
AllowNetbird method for the chosen firewall. If userspace
implementation is being used, the firewall manager is
subsequently recreated as a uspfilter instance.

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)
  • Extended the README / documentation, if necessary

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/1091 **Author:** [@gigovich](https://github.com/gigovich) **Created:** 8/18/2023 **Status:** ✅ Merged **Merged:** 8/22/2023 **Merged by:** [@gigovich](https://github.com/gigovich) **Base:** `allow-netbird-traffic` ← **Head:** `allow-netbird-traffic-uspfilter` --- ### 📝 Commits (5) - [`3c2aa45`](https://github.com/netbirdio/netbird/commit/3c2aa45f1b21e4dc8e5d726a778f4e17b7514166) Enable netbird traffic through uspfilter on Linux systems - [`c63b951`](https://github.com/netbirdio/netbird/commit/c63b95136ea75941acb34e0ba77c4c7f71f7a850) Fix tests for ACL manager - [`fc5d8a8`](https://github.com/netbirdio/netbird/commit/fc5d8a8aa94772eb7a77322f0b2da79657721dce) ACL manager test fix - [`9871819`](https://github.com/netbirdio/netbird/commit/9871819061eec1f4a1dd14f21195f23d3f1ae7e5) Fix double call to AllowNetbird - [`04a69f5`](https://github.com/netbirdio/netbird/commit/04a69f5dba5ae9215d0e545aabfcf682afa351fc) Fix tests after rebase ### 📊 Changes **8 files changed** (+107 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `client/firewall/iptables/manager_linux.go` (+4 -0) 📝 `client/firewall/uspfilter/allow_netbird.go` (+1 -1) ➕ `client/firewall/uspfilter/allow_netbird_linux.go` (+21 -0) 📝 `client/firewall/uspfilter/uspfilter.go` (+6 -0) 📝 `client/internal/acl/manager.go` (+0 -3) 📝 `client/internal/acl/manager_create.go` (+5 -0) 📝 `client/internal/acl/manager_create_linux.go` (+40 -9) 📝 `client/internal/acl/manager_test.go` (+30 -12) </details> ### 📄 Description ## Describe your changes Enable netbird traffic through uspfilter on Linux systems Issue: While every firewall manager has an AllowNetbird method, uspfilter doesn't utilize it on Linux due to the need for system firewall traffic control. Solution: On Linux, we now attempt to initialize either nftables or iptables within the ACL manager. We then invoke the AllowNetbird method for the chosen firewall. If userspace implementation is being used, the firewall manager is subsequently recreated as a uspfilter instance. ## Issue ticket number and link ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] Extended the README / documentation, if necessary --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 03:06:27 -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#14852