You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pages/how-to/lazy-connection.mdx
+20-15Lines changed: 20 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -1,24 +1,29 @@
1
1
import {Note} from"@/components/mdx";
2
2
3
-
# Overview
3
+
# Lazy Connections
4
4
NetBird now includes an experimental lazy connection feature designed to improve performance and reduce resource usage by connecting to peers only when needed. Instead of maintaining always-on connections, NetBird activates them on-demand based on activity or signaling.
5
5
6
6
This guide walks you through enabling and configuring this feature in your NetBird client.
This or higher version must also be installed on the peers you are trying to access for lazy connections to function.
10
11
</Note>
11
12
12
13
<Note>
13
-
<strong>Self-hosted only:</strong> This feature also requires an upgraded NetBird management server. Make sure your server is updated to the <strong>v0.45.0</strong> version that supports lazy connections.
14
+
This feature also requires an upgraded NetBird Management server.
15
+
If you're self-hosting NetBird, ensure your server is updated to version <strong>v0.45.0</strong>, which adds support for lazy connections.
14
16
</Note>
15
17
18
+
<Note>
19
+
This feature is currently under active development and will continue to evolve. Future releases will enhance disconnection logic and add support for accessing resources through routing peers, which is not yet available.
20
+
</Note>
16
21
17
22
## What Are Lazy Connections?
18
23
19
-
When enabled, Lazy Connections allow the NetBird agent to:
24
+
When enabled, lazy connections allow the NetBird agent to:
20
25
21
-
- Establish peer-to-peer connections **only when required** (e.g., when ping the remote peer).
26
+
- Establish peer-to-peer connections **only when needed** (e.g., when pinging a remote peer).
22
27
- Monitor peer activity and **automatically disconnect peers** that remain inactive **and unreachable** for a specified time.
23
28
- Keep critical peers (such as routers or excluded peers) **always connected** to ensure uninterrupted communication.
24
29
@@ -41,11 +46,9 @@ In other words, the inactivity timer only triggers a disconnect if the peer is b
41
46
42
47
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.
43
48
44
-
## Enabling Lazy Connections
45
-
46
-
Lazy connections are disabled by default. To enable them:
49
+
## Enabling Lazy Connections on agent
47
50
48
-
You can enable Lazy Connections using the following environment variable:
51
+
Lazy connections are disabled by default. You can enable Lazy Connections using the following environment variable:
49
52
50
53
```bash
51
54
export NB_ENABLE_EXPERIMENTAL_LAZY_CONN=true
@@ -56,18 +59,20 @@ Or pass the flag directly via the CLI when running the agent:
56
59
```bash
57
60
netbird up --enable-lazy-connection
58
61
```
59
-
<Note>
62
+
<Note>
60
63
This configuration is <strong>not persistent</strong>. You must reapply the flag or environment variable after each restart unless it is built into your service definition (e.g., systemd or Docker).
61
64
</Note>
62
65
63
-
### Platform-Specific Examples
64
-
For platform-specific examples of how to configure this:
65
-
66
-
-[See Windows example](/how-to/troubleshooting-client#windows)
67
-
-[See Linux with systemd example](/how-to/troubleshooting-client#on-linux-with-systemd)
66
+
## Enabling Lazy Connections in the NetBird Dashboard
68
67
68
+
The lazy connection feature can also be configured through the NetBird Dashboard. Here’s how it works once the setting is updated:
69
69
70
+
Setting enabled:
71
+
* The client’s lazy connection manager is now active. Existing peer connections and ongoing connection attempts will remain unchanged for one hour.
72
+
After that, any connection that couldn't be established due to unavailable remote peers will transition to an idle state.
70
73
74
+
Setting disabled:
75
+
* The lazy connection manager is now disabled. The client will immediately attempt to establish connections with all remote peers.
0 commit comments