From f931a8703c7b9d421ded01636cd201bc3c466da5 Mon Sep 17 00:00:00 2001 From: Berik Ashimov Date: Fri, 18 Sep 2026 14:10:41 +0500 Subject: openvpn: T9334: stop rendering "keepalive 0 0" An interval of 0 is how the CLI turns keepalive off, and it rendered "keepalive 0 0" because OpenVPN skipped its own sanity checks on that pair. OpenVPN 2.7.6 dropped the exception and now refuses to start: "keepalive ping: Must be an integer between 1 and 86400, not 0". Leave the directive out of the file instead. Nothing then sets ping or ping-restart, which is the keepalive-off the interval asked for, and a saved configuration still commits untouched. --- data/templates/openvpn/server.conf.j2 | 2 ++ 1 file changed, 2 insertions(+) (limited to 'data') diff --git a/data/templates/openvpn/server.conf.j2 b/data/templates/openvpn/server.conf.j2 index b0acf828a..ee05f9bfd 100644 --- a/data/templates/openvpn/server.conf.j2 +++ b/data/templates/openvpn/server.conf.j2 @@ -107,7 +107,9 @@ max-clients {{ server.max_connections }} client-config-dir /run/openvpn/ccd/{{ ifname }} {% endif %} {% endif %} +{% if keep_alive.interval | int > 0 %} keepalive {{ keep_alive.interval }} {{ keep_alive.interval | int * keep_alive.failure_count | int }} +{% endif %} management /run/openvpn/openvpn-mgmt-intf unix {% if server is vyos_defined %} {% if server.reject_unconfigured_clients is vyos_defined %} -- cgit v1.2.3