Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions src/pages/how-to/lazy-connection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ NetBird now includes an experimental lazy connection feature designed to improve
This guide walks you through enabling and configuring this feature in your NetBird client.

<Note>
Minimum supported agent version: <strong>v0.45.0</strong>.
Minimum supported agent version: <strong>v0.50.1</strong>.
This or higher version must also be installed on the peers you are trying to access for lazy connections to function.
</Note>

<Note>
This feature also requires an upgraded NetBird Management server.
If you're self-hosting NetBird, ensure your server is updated to version <strong>v0.45.0</strong>, which adds support for lazy connections.
This feature also requires an upgraded NetBird Management and Signal server.
If you're self-hosting NetBird, ensure your server is updated to version <strong>v0.50.1</strong>, which adds support for lazy connections.
</Note>

<Note>
Expand All @@ -25,7 +25,7 @@ When enabled, lazy connections allow the NetBird agent to:

- Establish peer-to-peer connections **only when needed** (e.g., when pinging a remote peer).
- Monitor peer activity and **automatically disconnect peers** that remain inactive **and unreachable** for a specified time.
- Keep critical peers (such as routers or excluded peers) **always connected** to ensure uninterrupted communication.
- Keep critical peers (such as excluded peers) **always connected** to ensure uninterrupted communication.

This feature is especially useful in **large-scale deployments** or **resource-constrained environments**, where maintaining full-mesh, permanent connections to all peers is unnecessary and inefficient.

Expand All @@ -36,15 +36,12 @@ This feature is especially useful in **large-scale deployments** or **resource-c

### How Automatic Disconnection Works

Once a connection between two peers is established, it will remain open **as long as the remote peer is reachable**. The connection is **not** closed just because there is no data transfer.

In other words, the inactivity timer only triggers a disconnect if the peer is both <em>inactive</em> and <em>unreachable</em> for the full duration of the threshold.
Once a connection between two peers is established, it will remain open only if there is ongoing traffic from the remote peer. If no traffic is received for 15 minutes, the connection will be closed — even if the remote peer is still reachable.

<Note>
The default inactivity threshold is <strong>60 minutes</strong>, and can be configured via the <code>NB_LAZY_CONN_INACTIVITY_THRESHOLD</code> environment variable.
The default inactivity threshold is <strong>15 minutes</strong>, and can be configured via the <code>NB_LAZY_CONN_INACTIVITY_THRESHOLD</code> environment variable.
</Note>

Additionally, the disconnection logic is being improved and will be enhanced in future releases to better support mobile devices—providing more intelligent reconnection behavior and improved handling of intermittent connectivity.

## Enabling Lazy Connections on agent

Expand Down