From cc82ca6a0f78ddeb7e4b33d2f69062d884901e22 Mon Sep 17 00:00:00 2001 From: Paul Donald Date: Sat, 2 Dec 2023 20:52:12 +0100 Subject: [PATCH] Add global PersistentKeepalive setting to wg.conf template. If set, this will insert PersistentKeepalive into the server side config Peer sections. PersistentKeepalive is not permissible under Interface sections. Only Peer sections. Refer to man page or source: https://git.zx2c4.com/wireguard-tools/tree/src/config.c Resolves issue #432. --- templates/wg.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/wg.conf b/templates/wg.conf index 2e67844..8ef7bd5 100644 --- a/templates/wg.conf +++ b/templates/wg.conf @@ -22,4 +22,5 @@ PrivateKey = {{ .serverConfig.KeyPair.PrivateKey }} PublicKey = {{ .Client.PublicKey }} {{if .Client.PresharedKey }}PresharedKey = {{ .Client.PresharedKey }} {{end}}AllowedIPs = {{$first :=true}}{{range .Client.AllocatedIPs }}{{if $first}}{{$first = false}}{{else}},{{end}}{{.}}{{end}}{{range .Client.ExtraAllowedIPs }},{{.}}{{end}} +{{if $.globalSettings.PersistentKeepalive}}PersistentKeepalive = {{ $.globalSettings.PersistentKeepalive }}{{end}} {{end}}{{end}}