Remove unused|stale peers from netbird peer entries configuration #2434

Open
opened 2025-11-20 07:09:47 -05:00 by saavagebueno · 0 comments
Owner

Originally created by @marcportabellaclotet-mt on GitHub (Nov 4, 2025).

Description:

Currently, when peers disconnect or stay offline , they continue to appear in the local netbird peers configuration (netbird status -d). These peers are shown with a Status: Connecting, even though they are no longer active.

When peers are completely removed from the Netbird configuration, they do disappear as expected — however, there’s no automatic cleanup for peers that are simply disconnected or inactive for a long time.

This leads to “peer entry spam” in the netbird configuration, which can grow significantly over time in larger networks.

Expected behavior:
Peers that remain disconnected for a long time (or are inactive beyond a configurable threshold) should be automatically removed or cleaned up from the local netbird peers configuration to keep it accurate and manageable.

Actual behavior:
Disconnected or long-inactive peers remain indefinitely in the local configuration with a Connecting status.

Steps to reproduce:

Connect multiple peers to the same Netbird network.

Disconnect some peers or keep them offline for an extended period.

Run netbird status -d on an active peer.

Observe that inactive peers still appear with a Connecting status.

Impact:

The list of peers grows indefinitely in long-lived networks.

Harder to read and manage peer states.

Potentially unnecessary overhead on peer configuration synchronization.

 xtx31q4kxw.netbird.selfhosted:
  NetBird IP: 100.127.138.6
  Public key: zzzzz
  Status: Connecting

Peers count: 20/102 Connected
Originally created by @marcportabellaclotet-mt on GitHub (Nov 4, 2025). Description: Currently, when peers disconnect or stay offline , they continue to appear in the local netbird peers configuration (netbird status -d). These peers are shown with a Status: Connecting, even though they are no longer active. When peers are completely removed from the Netbird configuration, they do disappear as expected — however, there’s no automatic cleanup for peers that are simply disconnected or inactive for a long time. This leads to “peer entry spam” in the netbird configuration, which can grow significantly over time in larger networks. Expected behavior: Peers that remain disconnected for a long time (or are inactive beyond a configurable threshold) should be automatically removed or cleaned up from the local netbird peers configuration to keep it accurate and manageable. Actual behavior: Disconnected or long-inactive peers remain indefinitely in the local configuration with a Connecting status. Steps to reproduce: Connect multiple peers to the same Netbird network. Disconnect some peers or keep them offline for an extended period. Run netbird status -d on an active peer. Observe that inactive peers still appear with a Connecting status. Impact: The list of peers grows indefinitely in long-lived networks. Harder to read and manage peer states. Potentially unnecessary overhead on peer configuration synchronization. ``` xtx31q4kxw.netbird.selfhosted: NetBird IP: 100.127.138.6 Public key: zzzzz Status: Connecting Peers count: 20/102 Connected ```
saavagebueno added the feature-requestclient labels 2025-11-20 07:09:47 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#2434