[GH-ISSUE #5373] Hardcoded persistent keepalive value for Wireguard interfaces #10462

Open
opened 2026-08-05 01:25:59 -04:00 by saavagebueno · 0 comments
Owner

Originally created by @mtdcr on GitHub (Feb 17, 2026).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/5373

Hi everyone,

thanks for putting all your time into this project! I'm new to netbird, so please bear with my ignorance. ;-)

I noticed that all Wireguard interfaces on my clients show a setting of persistent keepalive: every 25 seconds. Looking through the code, I found it's a hardcoded value:

e9b2a6e808/client/internal/peer/endpoint.go (L14)

I'd like to understand the reason behind this value and, if possible, would like it to become adjustable and even optional (for manually configured groups of peers) in the future.

From the perspective of a long time Wireguard user, my observation is that persistent keepalive is only required for a tunnel if both (a) NAT is in between the two peers and (b) the NATed peer(s) need(s) to stay reachable through this tunnel. Therefore, the keepalive value should be below the connection tracking timeout for these tunnels. In other cases, Wireguard is able to recreate connections on demand. I'm not sure whether these are properties that could be automatically detected by netbird, but a manual override would be great anyway.

Ideally I'd like to be able to disable the keepalive setting for battery powered devices like mobile phones and laptops. I suspect there's at least some potential for power savings.

Best regards,
Andreas

Originally created by @mtdcr on GitHub (Feb 17, 2026). Original GitHub issue: https://github.com/netbirdio/netbird/issues/5373 Hi everyone, thanks for putting all your time into this project! I'm new to netbird, so please bear with my ignorance. ;-) I noticed that all Wireguard interfaces on my clients show a setting of `persistent keepalive: every 25 seconds`. Looking through the code, I found it's a hardcoded value: https://github.com/netbirdio/netbird/blob/e9b2a6e80892ade6925e156690f86e758d42ceee/client/internal/peer/endpoint.go#L14 I'd like to understand the reason behind this value and, if possible, would like it to become adjustable and even optional (for manually configured groups of peers) in the future. From the perspective of a long time Wireguard user, my observation is that persistent keepalive is only required for a tunnel if both (a) NAT is in between the two peers and (b) the NATed peer(s) need(s) to stay reachable through this tunnel. Therefore, the keepalive value should be below the connection tracking timeout for these tunnels. In other cases, Wireguard is able to recreate connections on demand. I'm not sure whether these are properties that could be automatically detected by netbird, but a manual override would be great anyway. Ideally I'd like to be able to disable the keepalive setting for battery powered devices like mobile phones and laptops. I suspect there's at least some potential for power savings. Best regards, Andreas
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#10462