[PR #4177] [MERGED] [management, client] Add API to change the network range #22653

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

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/4177
Author: @lixmal
Created: 7/18/2025
Status: Merged
Merged: 8/4/2025
Merged by: @lixmal

Base: mainHead: change-network-range


📝 Commits (10+)

📊 Changes

20 files changed (+606 additions, -27 deletions)

View changed files

📝 client/iface/wgproxy/bind/proxy.go (+1 -1)
📝 client/iface/wgproxy/ebpf/wrapper.go (+1 -1)
📝 client/internal/engine.go (+4 -9)
📝 management/cmd/management.go (+5 -5)
📝 management/server/account.go (+171 -1)
📝 management/server/account/manager.go (+1 -0)
📝 management/server/account_test.go (+68 -0)
📝 management/server/activity/codes.go (+7 -0)
📝 management/server/http/api/openapi.yml (+10 -0)
📝 management/server/http/api/types.gen.go (+11 -5)
📝 management/server/http/handlers/accounts/accounts_handler.go (+110 -0)
📝 management/server/http/handlers/peers/peers_handler.go (+14 -0)
📝 management/server/http/handlers/peers/peers_handler_test.go (+81 -0)
📝 management/server/mock_server/account_mock.go (+8 -0)
📝 management/server/types/config.go (+1 -1)
📝 management/server/types/network.go (+4 -1)
📝 management/server/types/network_test.go (+102 -0)
📝 management/server/types/settings.go (+5 -0)
📝 util/common.go (+1 -2)
📝 util/duration.go (+1 -1)

📄 Description

Describe your changes

  • Adds an API to change the account's subnet and individual peer IPs
  • Disables IP update on client to avoid stale config (the own IP is used in routes, firewalls, etc)

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/4177 **Author:** [@lixmal](https://github.com/lixmal) **Created:** 7/18/2025 **Status:** ✅ Merged **Merged:** 8/4/2025 **Merged by:** [@lixmal](https://github.com/lixmal) **Base:** `main` ← **Head:** `change-network-range` --- ### 📝 Commits (10+) - [`26711ea`](https://github.com/netbirdio/netbird/commit/26711eaecd70e5a4f8a252e43d26c622ae05565b) Add API to change the network range - [`9e81cd4`](https://github.com/netbirdio/netbird/commit/9e81cd431396a41832b0db76d71ad373b518461d) Address review - [`e839eff`](https://github.com/netbirdio/netbird/commit/e839effe3216f24f383aacd7c7cb3ce90b2f2d21) Remove client ip update - [`37eed83`](https://github.com/netbirdio/netbird/commit/37eed83165f7125c54bba7dc9a4485cfce3fce5e) Reduce complexity - [`cfb2536`](https://github.com/netbirdio/netbird/commit/cfb253645ee7adfdc1e601bea2fa42bef10f5b2a) Update network map - [`e70d116`](https://github.com/netbirdio/netbird/commit/e70d116d9a7d5db85a92db5b19ae59bb587ecb04) Use netip.Addr - [`8f11813`](https://github.com/netbirdio/netbird/commit/8f11813676ccc086d1d49506ed777e228a5b03c1) Add network range activity meta - [`64d4798`](https://github.com/netbirdio/netbird/commit/64d479893527b01a5bce1e83fb8a1ae7483799b2) Reduce complexity - [`d541e15`](https://github.com/netbirdio/netbird/commit/d541e155e7997131523842d399f7a9f9ad0b7c2e) Ignore empty string - [`d28420f`](https://github.com/netbirdio/netbird/commit/d28420fe6789781b302f531d4a09b5e1d498956d) Merge branch 'main' into change-network-range ### 📊 Changes **20 files changed** (+606 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `client/iface/wgproxy/bind/proxy.go` (+1 -1) 📝 `client/iface/wgproxy/ebpf/wrapper.go` (+1 -1) 📝 `client/internal/engine.go` (+4 -9) 📝 `management/cmd/management.go` (+5 -5) 📝 `management/server/account.go` (+171 -1) 📝 `management/server/account/manager.go` (+1 -0) 📝 `management/server/account_test.go` (+68 -0) 📝 `management/server/activity/codes.go` (+7 -0) 📝 `management/server/http/api/openapi.yml` (+10 -0) 📝 `management/server/http/api/types.gen.go` (+11 -5) 📝 `management/server/http/handlers/accounts/accounts_handler.go` (+110 -0) 📝 `management/server/http/handlers/peers/peers_handler.go` (+14 -0) 📝 `management/server/http/handlers/peers/peers_handler_test.go` (+81 -0) 📝 `management/server/mock_server/account_mock.go` (+8 -0) 📝 `management/server/types/config.go` (+1 -1) 📝 `management/server/types/network.go` (+4 -1) 📝 `management/server/types/network_test.go` (+102 -0) 📝 `management/server/types/settings.go` (+5 -0) 📝 `util/common.go` (+1 -2) 📝 `util/duration.go` (+1 -1) </details> ### 📄 Description ## Describe your changes - Adds an API to change the account's subnet and individual peer IPs - Disables IP update on client to avoid stale config (the own IP is used in routes, firewalls, etc) ## 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 06:06:13 -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#22653