[PR #4245] [CLOSED] [client] Add support for retain existing AllowedIPs when no alternative paths are available #19878

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

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/4245
Author: @gamerslouis
Created: 7/29/2025
Status: Closed

Base: mainHead: feat/route-sticky


📝 Commits (1)

  • c5b88e8 [client] Add support for keeping routes on failure

📊 Changes

2 files changed (+29 additions, -0 deletions)

View changed files

📝 client/internal/routemanager/client/client.go (+5 -0)
client/internal/routemanager/client/env.go (+24 -0)

📄 Description

We are using Netbird to manage our WireGuard network (without relay nodes). Our topology is relatively stable and does not change frequently.

We have analyzed potential network instability issues that may occur when either the ICE connection drops or the management API becomes temporarily unavailable. As noted in this comment, in such cases, network routes (e.g., 10.0.0.0/24) are removed from AllowedIPs, effectively cutting off connectivity.

In our scenario, we prefer:
• When ICE fails or the management service is temporarily down, the existing network connectivity should remain unaffected. The system should not proactively remove AllowedIPs, especially when no alternative paths are available.
• Even if the management service remains operational, the temporary unavailability of routes during ICE reconnection is still unacceptable, as it causes unnecessary and avoidable disruptions.

We propose adding an option to enable a failsafe routing mode, where:
• Route manager only updates AllowedIPs when a valid, reachable path is available.
• If no valid path is detected, the current AllowedIPs are kept unchanged.

This behavior would help prevent unnecessary network disconnections caused by transient ICE or management issues.

Example environment variable:

NB_ROUTE_STICKY_ON_FAILURE=true

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

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.


🔄 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/4245 **Author:** [@gamerslouis](https://github.com/gamerslouis) **Created:** 7/29/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/route-sticky` --- ### 📝 Commits (1) - [`c5b88e8`](https://github.com/netbirdio/netbird/commit/c5b88e8378f93119e0f2657ddd8f5791f96de6a7) [client] Add support for keeping routes on failure ### 📊 Changes **2 files changed** (+29 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `client/internal/routemanager/client/client.go` (+5 -0) ➕ `client/internal/routemanager/client/env.go` (+24 -0) </details> ### 📄 Description We are using Netbird to manage our WireGuard network (without relay nodes). Our topology is relatively stable and does not change frequently. We have analyzed potential network instability issues that may occur when either the ICE connection drops or the management API becomes temporarily unavailable. As noted in [this comment](https://github.com/netbirdio/netbird/issues/1584#issuecomment-2179294070), in such cases, network routes (e.g., 10.0.0.0/24) are removed from AllowedIPs, effectively cutting off connectivity. In our scenario, we prefer: • When ICE fails or the management service is temporarily down, the existing network connectivity should remain unaffected. The system should not proactively remove AllowedIPs, especially when no alternative paths are available. • Even if the management service remains operational, the temporary unavailability of routes during ICE reconnection is still unacceptable, as it causes unnecessary and avoidable disruptions. We propose adding an option to enable a failsafe routing mode, where: • Route manager only updates AllowedIPs when a valid, reachable path is available. • If no valid path is detected, the current AllowedIPs are kept unchanged. This behavior would help prevent unnecessary network disconnections caused by transient ICE or management issues. Example environment variable: ``` NB_ROUTE_STICKY_ON_FAILURE=true ``` ## Issue ticket number and link ## Stack <!-- branch-stack --> ### 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 > 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). --- <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:06:33 -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#19878