[PR #5309] [client] Ability to disable default route with Exit Node #25555

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

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/5309
Author: @Arsolitt
Created: 2/13/2026
Status: 🔄 Open

Base: mainHead: feature/disable-default-route


📝 Commits (10+)

  • cd3a2ef [client] Add disable_default_route field to SetConfigRequest
  • 4525565 [client] Add DisableDefaultRoute to config layer
  • 77baab3 [client] Add --disable-default-route CLI flag and route filtering
  • d7d0e53 [client] Add tests for DisableDefaultRoute flag
  • c925852 [client] Add disable_default_route to LoginRequest and GetConfigResponse
  • dcf0930 [client] Improve DisableDefaultRoute test to verify route-skipping
  • 999bcff [client] Regenerate protobuf bindings after rebase
  • f5c92f3 [client] Fix gofmt formatting violations
  • 870d2f0 [client] Remove unused DisableDefaultRoute from LoginRequest
  • daacec6 [client] Strengthen DisableDefaultRoute test assertions

📊 Changes

16 files changed (+1184 additions, -696 deletions)

View changed files

📝 client/cmd/system.go (+5 -0)
📝 client/cmd/up.go (+7 -0)
📝 client/internal/connect.go (+1 -0)
📝 client/internal/debug/debug.go (+1 -0)
📝 client/internal/engine.go (+2 -0)
📝 client/internal/profilemanager/config.go (+2 -418)
client/internal/profilemanager/config_apply.go (+486 -0)
📝 client/internal/profilemanager/config_test.go (+91 -0)
📝 client/internal/profilemanager/profilemanager_test.go (+1 -1)
📝 client/internal/routemanager/manager.go (+25 -18)
📝 client/internal/routemanager/manager_test.go (+182 -7)
📝 client/proto/daemon.pb.go (+25 -6)
📝 client/proto/daemon.proto (+3 -0)
📝 client/proto/daemon_grpc.pb.go (+222 -246)
📝 client/server/server.go (+4 -0)
📝 client/server/setconfig_test.go (+127 -0)

📄 Description

Describe your changes

This PR introduces the ability to prevent the installation of the default route (0.0.0.0/0) into the system routing table while preserving the WireGuard AllowedIPs configuration by passing
--disable-default-route CLI arg.

This allows enabling an Exit Node on the peer without automatically routing all host traffic through the tunnel, enabling custom routing management outside netbird.

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

Summary by CodeRabbit

  • New Features

    • New configuration option and CLI flag to disable installation of the system default route; the choice is persisted, surfaced via the daemon API, and, when enabled, prevents the client from adding the 0.0.0.0/0 default route.
  • Tests

    • Added and updated tests covering the disable-default-route behavior across configuration, startup, and route-management scenarios.

🔄 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/5309 **Author:** [@Arsolitt](https://github.com/Arsolitt) **Created:** 2/13/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feature/disable-default-route` --- ### 📝 Commits (10+) - [`cd3a2ef`](https://github.com/netbirdio/netbird/commit/cd3a2eff1cd9a991c43ca2079fec63d36e7b72f2) [client] Add disable_default_route field to SetConfigRequest - [`4525565`](https://github.com/netbirdio/netbird/commit/45255655486bb6b9bcea53dc6fb941d70ab78672) [client] Add DisableDefaultRoute to config layer - [`77baab3`](https://github.com/netbirdio/netbird/commit/77baab3a72d9d1e92c6de3f0d8f0ebd45f6aa938) [client] Add --disable-default-route CLI flag and route filtering - [`d7d0e53`](https://github.com/netbirdio/netbird/commit/d7d0e53a01c15c111fc9c6291b2fd9b0aa65a1ac) [client] Add tests for DisableDefaultRoute flag - [`c925852`](https://github.com/netbirdio/netbird/commit/c925852d120a08bd2bb554b2c9622ff8e195f9e4) [client] Add disable_default_route to LoginRequest and GetConfigResponse - [`dcf0930`](https://github.com/netbirdio/netbird/commit/dcf0930b7c04a3e8fa0db3cdb5453d00ca88e083) [client] Improve DisableDefaultRoute test to verify route-skipping - [`999bcff`](https://github.com/netbirdio/netbird/commit/999bcff32e2f49238f6d4cfa090e1e4a8e612dae) [client] Regenerate protobuf bindings after rebase - [`f5c92f3`](https://github.com/netbirdio/netbird/commit/f5c92f3395dd8073e80cb2abbd2b5d152ccf70d6) [client] Fix gofmt formatting violations - [`870d2f0`](https://github.com/netbirdio/netbird/commit/870d2f057766c5987f31e63680e943b3a25fbbbc) [client] Remove unused DisableDefaultRoute from LoginRequest - [`daacec6`](https://github.com/netbirdio/netbird/commit/daacec6337eaa6e3634159339857d034d38b09a7) [client] Strengthen DisableDefaultRoute test assertions ### 📊 Changes **16 files changed** (+1184 additions, -696 deletions) <details> <summary>View changed files</summary> 📝 `client/cmd/system.go` (+5 -0) 📝 `client/cmd/up.go` (+7 -0) 📝 `client/internal/connect.go` (+1 -0) 📝 `client/internal/debug/debug.go` (+1 -0) 📝 `client/internal/engine.go` (+2 -0) 📝 `client/internal/profilemanager/config.go` (+2 -418) ➕ `client/internal/profilemanager/config_apply.go` (+486 -0) 📝 `client/internal/profilemanager/config_test.go` (+91 -0) 📝 `client/internal/profilemanager/profilemanager_test.go` (+1 -1) 📝 `client/internal/routemanager/manager.go` (+25 -18) 📝 `client/internal/routemanager/manager_test.go` (+182 -7) 📝 `client/proto/daemon.pb.go` (+25 -6) 📝 `client/proto/daemon.proto` (+3 -0) 📝 `client/proto/daemon_grpc.pb.go` (+222 -246) 📝 `client/server/server.go` (+4 -0) 📝 `client/server/setconfig_test.go` (+127 -0) </details> ### 📄 Description ## Describe your changes This PR introduces the ability to prevent the installation of the default route (0.0.0.0/0) into the system routing table while preserving the WireGuard AllowedIPs configuration by passing `--disable-default-route` CLI arg. This allows enabling an Exit Node on the peer without automatically routing all host traffic through the tunnel, enabling custom routing management outside netbird. ## 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 - [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: - [X] 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/602 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * New configuration option and CLI flag to disable installation of the system default route; the choice is persisted, surfaced via the daemon API, and, when enabled, prevents the client from adding the 0.0.0.0/0 default route. * **Tests** * Added and updated tests covering the disable-default-route behavior across configuration, startup, and route-management scenarios. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <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 07:06:10 -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#25555