Optional VPN (WG) peer settings via Cockpit - ie PersistentKeepalive = 25

Built my Wireguard VPN tunnel between two node/sites via Cockpit network settings. I'd like to add PersistentKeepalive = 25statement under the [Peer] section of the Cockpit network wireguard interface (wg0) like in a client configuration file. Is there a location to do this outside of Cockpit?

Matt - N0GIK

All NetworkManager connections, including Wireguard tunnels, are stored in /etc/NetworkManager/system-connections. Find the .nmconnection file that relates to your VPN connection. Under the [wireguard-peer.{{KEY}}] stanza, you can add persistent-keepalive=25. After saving the file, do a nmcli connection reload. The only thing I can't say for sure is of Cockpit will keep that directive if you edit there later.

I will test that scenario tonight and report back.
Thank you!

Someone replied to your post.

| N8EI ASL Community Admin
September 22 |

  • | - |

All NetworkManager connections, including Wireguard tunnels, are stored in /etc/NetworkManager/system-connections. Find the .nmconnection file that relates to your VPN connection. Under the [wireguard-peer.{{KEY}}] stanza, you can add persistent-keepalive=25. After saving the file, do a nmcli connection reload. The only thing I can't say for sure is of Cockpit will keep that directive if you edit there later.

···

On Monday, September 21, 2026 at 10:03:02 PM CDT, N8EI [email protected] wrote:


Visit Topic or reply to this email to respond.

To unsubscribe from these emails, click here.

Good Morning,

It appears that the persistent-keepalive=25 does get deleted at some point. I lost connection to the VPN tunnel to the remote site after an apt update;apt upgrade on the 29th. I've not been to the remote site to look at its peer config, but the local site with identical config was missing its keepalive statement after same update/upgrade action. My plan is to travel to remote today and check its connection file.

Matt N0GIK