[PR #3270] [MERGED] [client] Manage the IP forwarding sysctl setting in global way #22109

Closed
opened 2026-08-05 05:09:21 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/3270
Author: @pappz
Created: 2/2/2025
Status: Merged
Merged: 2/3/2025
Merged by: @pappz

Base: feature/port-forwardingHead: feature/port-forwarding-ipfwdsysopts


📝 Commits (4)

📊 Changes

4 files changed (+94 additions, -13 deletions)

View changed files

📝 client/firewall/iptables/router_linux.go (+19 -0)
📝 client/firewall/nftables/router_linux.go (+24 -5)
client/internal/routemanager/ipfwdstate/ipfwdstate.go (+51 -0)
📝 client/internal/routemanager/server_nonandroid.go (+0 -8)

📄 Description

Describe your changes

Add new package ipfwdstate that implements reference counting for IP forwarding
state management. This allows multiple usage to safely request IP forwarding
without interfering with each other.

TODO:

  • Read initial state from system config
  • Implement DisableIPForwarding call

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/3270 **Author:** [@pappz](https://github.com/pappz) **Created:** 2/2/2025 **Status:** ✅ Merged **Merged:** 2/3/2025 **Merged by:** [@pappz](https://github.com/pappz) **Base:** `feature/port-forwarding` ← **Head:** `feature/port-forwarding-ipfwdsysopts` --- ### 📝 Commits (4) - [`4db673c`](https://github.com/netbirdio/netbird/commit/4db673c2889c729519c5ba997d26b1fa721acc8f) Manage the ip forwarding sysctl setting in global way - [`b9029e0`](https://github.com/netbirdio/netbird/commit/b9029e09918387ff25f22b24e1dbd5f5280fc315) Change logging - [`5930330`](https://github.com/netbirdio/netbird/commit/59303305098a1db31d8db6a34a677ff8bda54446) Fix typo and add log - [`cf48c66`](https://github.com/netbirdio/netbird/commit/cf48c66b0bc787fafd9a8629e091e8d15daa36bc) Add comment ### 📊 Changes **4 files changed** (+94 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `client/firewall/iptables/router_linux.go` (+19 -0) 📝 `client/firewall/nftables/router_linux.go` (+24 -5) ➕ `client/internal/routemanager/ipfwdstate/ipfwdstate.go` (+51 -0) 📝 `client/internal/routemanager/server_nonandroid.go` (+0 -8) </details> ### 📄 Description ## Describe your changes Add new package ipfwdstate that implements reference counting for IP forwarding state management. This allows multiple usage to safely request IP forwarding without interfering with each other. TODO: - Read initial state from system config - Implement DisableIPForwarding call ## Issue ticket number and link ### Checklist - [x] 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 --- <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 05:09:21 -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#22109