From e35fce276b381c68d451ad8aef2a8e523ce9c2bb Mon Sep 17 00:00:00 2001 From: Viktor Liu Date: Tue, 30 Jun 2026 13:21:05 +0200 Subject: [PATCH] Update lazy connection docs for the NB_LAZY_CONN override --- src/pages/client/environment-variables.mdx | 2 +- src/pages/manage/peers/lazy-connection.mdx | 23 ++++++---------------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/pages/client/environment-variables.mdx b/src/pages/client/environment-variables.mdx index 4ce0a783..853809aa 100644 --- a/src/pages/client/environment-variables.mdx +++ b/src/pages/client/environment-variables.mdx @@ -71,7 +71,7 @@ To clear all saved service parameters (including env vars), run `sudo netbird se | `NB_ICE_FAILED_TIMEOUT_SEC` | All | Seconds of silence before ICE gives up on the connection entirely and falls back to relay (default: `6`). | | `NB_ICE_RELAY_ACCEPTANCE_MIN_WAIT_SEC` | All | Minimum seconds ICE waits for a direct (P2P) candidate before accepting a relay candidate. Higher values give direct connections more time to succeed at the cost of slower initial connection (default: `2`). | | `NB_ICE_MONITOR_PERIOD` | All | Interval between ICE connection health checks that verify handshake freshness and trigger reconnection if needed (Go duration, default: `5m`). | -| `NB_ENABLE_EXPERIMENTAL_LAZY_CONN` | All | Open WireGuard tunnels to peers only when traffic is detected, instead of connecting to all peers at startup. Same effect as the `--enable-lazy-connection` CLI flag. | +| `NB_LAZY_CONN` | All | Local override for the lazy connection feature, which opens WireGuard tunnels to peers only when traffic is detected. `on` forces it enabled, `off` forces it disabled, unset defers to the management setting. Overrides the management configuration in both directions. Replaces the removed `NB_ENABLE_EXPERIMENTAL_LAZY_CONN`. | | `NB_LAZY_CONN_INACTIVITY_THRESHOLD` | All | How long a lazy connection can be idle before it is torn down (Go duration, default: `15m`). Only applies when lazy connections are enabled. | ## DNS diff --git a/src/pages/manage/peers/lazy-connection.mdx b/src/pages/manage/peers/lazy-connection.mdx index 660d07fb..1b0b1d8b 100644 --- a/src/pages/manage/peers/lazy-connection.mdx +++ b/src/pages/manage/peers/lazy-connection.mdx @@ -42,29 +42,18 @@ Once a connection between two peers is established, it will remain open only if The default inactivity threshold is 60 minutes, and can be configured via the NB_LAZY_CONN_INACTIVITY_THRESHOLD environment variable (`60`). -## Enabling via the system tray +## Overriding Lazy Connections on the agent -You can toggle Lazy Connections directly from the NetBird system tray: - -1. Click the NetBird icon in the system tray. -2. Go to **Settings**. -3. Click **Enable Lazy Connections** to toggle the setting. - -## Enabling Lazy Connections on agent - -Lazy connections are disabled by default. You can enable Lazy Connections using the following environment variable: +Whether lazy connections are enabled is controlled by your management settings (see the Dashboard section below). You can override that decision locally on an agent with the `NB_LAZY_CONN` environment variable: ```bash -export NB_ENABLE_EXPERIMENTAL_LAZY_CONN=true +export NB_LAZY_CONN=on # force enabled +export NB_LAZY_CONN=off # force disabled ``` -Or pass the flag directly via the CLI when running the agent: - -```bash -netbird up --enable-lazy-connection -``` +Both `on` and `off` override the management setting; leave the variable unset to defer to management. On managed devices, the same override can be applied through an MDM policy using the `lazyConnection` key (`on` / `off`). - This configuration is not persistent. You must reapply the flag or environment variable after each restart unless it is built into your service definition (e.g., systemd or Docker). + The environment variable is not persistent. You must reapply it after each restart unless it is built into your service definition (e.g., systemd or Docker). ## Enabling Lazy Connections in the NetBird Dashboard