[PR #805] [MERGED] Feat linux firewall support #13021

Closed
opened 2026-08-05 02:07:16 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/805
Author: @gigovich
Created: 4/12/2023
Status: Merged
Merged: 5/29/2023
Merged by: @braginini

Base: mainHead: feat-linux-firewall-support


📝 Commits (10+)

  • cd38ad3 Initial implementation of the firewall common manager for client.
  • f3adf3d Add test for iptables firewall manager
  • d74907d Use arch suffix to build iptables manager
  • d80de85 Use string types in the Rule as ID
  • 6caf55a Update protocol to add FirewallRule
  • 4f41069 Add logic layer for the ACL firewall rules management.
  • e9b0fa0 Fix non-port based rules processing. Add rules clean up call.
  • d0ab9b5 Fix direction for firewall rule
  • 66b1b8f Refactor protocol handling for firewall rules, add engine tests
  • 6c26b16 Fix docker build

📊 Changes

51 files changed (+4113 additions, -983 deletions)

View changed files

📝 .github/workflows/golang-test-linux.yml (+6 -0)
📝 client/firewall/firewall.go (+16 -9)
📝 client/firewall/iptables/manager_linux.go (+214 -49)
📝 client/firewall/iptables/manager_linux_test.go (+74 -50)
📝 client/firewall/iptables/rule.go (+1 -0)
client/firewall/nftables/manager_linux.go (+435 -0)
client/firewall/nftables/manager_linux_test.go (+137 -0)
client/firewall/nftables/rule_linux.go (+16 -0)
📝 client/firewall/port.go (+15 -9)
client/firewall/uspfilter/rule.go (+27 -0)
client/firewall/uspfilter/uspfilter.go (+291 -0)
client/firewall/uspfilter/uspfilter_test.go (+207 -0)
client/internal/acl/manager.go (+209 -0)
client/internal/acl/manager_create.go (+27 -0)
client/internal/acl/manager_create_linux.go (+36 -0)
client/internal/acl/manager_test.go (+92 -0)
client/internal/acl/mocks/iface_mapper.go (+77 -0)
📝 client/internal/engine.go (+14 -0)
📝 client/internal/engine_test.go (+1 -3)
📝 go.mod (+4 -10)

...and 31 more files

📄 Description

Describe your changes

Update the client's engine to apply firewall rules received from the manager (results of ACL policy).

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/805 **Author:** [@gigovich](https://github.com/gigovich) **Created:** 4/12/2023 **Status:** ✅ Merged **Merged:** 5/29/2023 **Merged by:** [@braginini](https://github.com/braginini) **Base:** `main` ← **Head:** `feat-linux-firewall-support` --- ### 📝 Commits (10+) - [`cd38ad3`](https://github.com/netbirdio/netbird/commit/cd38ad329e62bcc1d6907be473f33bd340a670c1) Initial implementation of the firewall common manager for client. - [`f3adf3d`](https://github.com/netbirdio/netbird/commit/f3adf3dc4a4201760d21424d599e2bddac834ee8) Add test for iptables firewall manager - [`d74907d`](https://github.com/netbirdio/netbird/commit/d74907d27c4938a8660b3c0b1e45b27f879663d8) Use arch suffix to build iptables manager - [`d80de85`](https://github.com/netbirdio/netbird/commit/d80de8594159de1052631c977c4bf54263a555e4) Use string types in the Rule as ID - [`6caf55a`](https://github.com/netbirdio/netbird/commit/6caf55a67a5da5a79ce0d0b48e45ff4a0b49bed0) Update protocol to add FirewallRule - [`4f41069`](https://github.com/netbirdio/netbird/commit/4f41069cd242d537e506b6451fb9098059d77b5c) Add logic layer for the ACL firewall rules management. - [`e9b0fa0`](https://github.com/netbirdio/netbird/commit/e9b0fa0d4e1a2f116625ab37d0cefc3cd377854c) Fix non-port based rules processing. Add rules clean up call. - [`d0ab9b5`](https://github.com/netbirdio/netbird/commit/d0ab9b5240166c727abee0514a679f6c2ce66ea5) Fix direction for firewall rule - [`66b1b8f`](https://github.com/netbirdio/netbird/commit/66b1b8f13912676be2c744bed52025940d4ffe8b) Refactor protocol handling for firewall rules, add engine tests - [`6c26b16`](https://github.com/netbirdio/netbird/commit/6c26b1606318d40460c90b92b1dde18330864c68) Fix docker build ### 📊 Changes **51 files changed** (+4113 additions, -983 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/golang-test-linux.yml` (+6 -0) 📝 `client/firewall/firewall.go` (+16 -9) 📝 `client/firewall/iptables/manager_linux.go` (+214 -49) 📝 `client/firewall/iptables/manager_linux_test.go` (+74 -50) 📝 `client/firewall/iptables/rule.go` (+1 -0) ➕ `client/firewall/nftables/manager_linux.go` (+435 -0) ➕ `client/firewall/nftables/manager_linux_test.go` (+137 -0) ➕ `client/firewall/nftables/rule_linux.go` (+16 -0) 📝 `client/firewall/port.go` (+15 -9) ➕ `client/firewall/uspfilter/rule.go` (+27 -0) ➕ `client/firewall/uspfilter/uspfilter.go` (+291 -0) ➕ `client/firewall/uspfilter/uspfilter_test.go` (+207 -0) ➕ `client/internal/acl/manager.go` (+209 -0) ➕ `client/internal/acl/manager_create.go` (+27 -0) ➕ `client/internal/acl/manager_create_linux.go` (+36 -0) ➕ `client/internal/acl/manager_test.go` (+92 -0) ➕ `client/internal/acl/mocks/iface_mapper.go` (+77 -0) 📝 `client/internal/engine.go` (+14 -0) 📝 `client/internal/engine_test.go` (+1 -3) 📝 `go.mod` (+4 -10) _...and 31 more files_ </details> ### 📄 Description ## Describe your changes Update the client's engine to apply firewall rules received from the manager (results of ACL policy). ## Issue ticket number and link ### 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) - [ ] 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 02:07:16 -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#13021