[GH-ISSUE #4758] Option to disable direct peer-to-peer connections for specific peers (server-only mode) #9319

Open
opened 2026-08-05 01:21:42 -04:00 by saavagebueno · 3 comments
Owner

Originally created by @TheDoDoo on GitHub (Nov 7, 2025).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/4758

I have a setup where one peer is located in a network that only allows connections to the NetBird server (management/relay), but not to other peers directly.

Currently, NetBird keeps trying to establish direct peer-to-peer connections, which are not possible in this environment and result in constant connection attempts and log noise.

It would be great to have an option to configure certain peers to only communicate via the NetBird server (relay), effectively a server-only or no direct P2P mode.

Expected behavior

A peer configured in this mode should:

  • Never attempt direct P2P connections to other peers.
  • Always use the relay/management server for all communication.

Why this is useful

In restricted network environments, devices are often only allowed to talk to the NetBird server.
In such cases, trying to establish direct P2P connections wastes resources and generates unnecessary retries.

Questions

  • Is there currently any way to force a peer to only use the relay (via configuration, policy, or flag)?
  • If not, would you consider adding this as a feature in the future?
Originally created by @TheDoDoo on GitHub (Nov 7, 2025). Original GitHub issue: https://github.com/netbirdio/netbird/issues/4758 I have a setup where one peer is located in a network that only allows connections to the NetBird server (management/relay), but not to other peers directly. Currently, NetBird keeps trying to establish direct peer-to-peer connections, which are not possible in this environment and result in constant connection attempts and log noise. It would be great to have an option to configure certain peers to only communicate via the NetBird server (relay), effectively a server-only or no direct P2P mode. **Expected behavior** A peer configured in this mode should: - Never attempt direct P2P connections to other peers. - Always use the relay/management server for all communication. **Why this is useful** In restricted network environments, devices are often only allowed to talk to the NetBird server. In such cases, trying to establish direct P2P connections wastes resources and generates unnecessary retries. **Questions** - Is there currently any way to force a peer to only use the relay (via configuration, policy, or flag)? - If not, would you consider adding this as a feature in the future?
saavagebueno added the feature-request label 2026-08-05 01:21:42 -04:00
Author
Owner

@ghazyami commented on GitHub (Nov 27, 2025):

Same as #4715?

<!-- gh-comment-id:3587282260 --> @ghazyami commented on GitHub (Nov 27, 2025): Same as #4715?
Author
Owner

@openapphub commented on GitHub (Jan 23, 2026):

A such control is required.

<!-- gh-comment-id:3789785674 --> @openapphub commented on GitHub (Jan 23, 2026): A such control is required.
Author
Owner

@MichaelUray commented on GitHub (Apr 25, 2026):

This use case ("force relay-only for one specific peer in a restricted network") is directly addressed by the per-peer override mechanism proposed in #5990, which extends the existing account-level connection-mode setting to also support per-group and per-peer values, with explicit-peer winning over group winning over account-default.

In the proposed model, your scenario would be: set explicit per-peer connection-mode=relay-forced on the restricted peer in the dashboard. The server then sends that value to that one peer via NetworkMap, and the client skips ICE entirely for outbound to all other peers — no more retry log noise.

Issue #5990 depends on the connection-mode enum proposed in companion #5989. Together they replace today's binary flags with a hierarchical, server-controllable, per-peer-overridable mode setting.

If you think this captures your use case, you may want to consider closing this issue in favor of the new proposal.

<!-- gh-comment-id:4318535084 --> @MichaelUray commented on GitHub (Apr 25, 2026): This use case ("force relay-only for one specific peer in a restricted network") is directly addressed by the per-peer override mechanism proposed in #5990, which extends the existing account-level connection-mode setting to also support per-group and per-peer values, with explicit-peer winning over group winning over account-default. In the proposed model, your scenario would be: set explicit per-peer `connection-mode=relay-forced` on the restricted peer in the dashboard. The server then sends that value to that one peer via NetworkMap, and the client skips ICE entirely for outbound to all other peers — no more retry log noise. Issue #5990 depends on the connection-mode enum proposed in companion #5989. Together they replace today's binary flags with a hierarchical, server-controllable, per-peer-overridable mode setting. If you think this captures your use case, you may want to consider closing this issue in favor of the new proposal.
Sign in to join this conversation.
No Label feature-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#9319