From 530d27a11889ed476cf1a291a49a0819bb93efe0 Mon Sep 17 00:00:00 2001 From: Roberto Almeida Silva Date: Thu, 7 May 2026 09:01:01 +0100 Subject: [PATCH] wireguard-tools: increase watchdog idle timeout to 180s The current 150s watchdog timeout is too aggressive, leading to premature hostname re-resolution on alive connections. Even with a 25s keepalive, handshakes may not occur within the 150s window. Increasing the timeout to 180s aligns the watchdog with WireGuard's REJECT_AFTER_TIME constant, ensuring we only re-resolve when the connection is truly considered dead. Signed-off-by: Roberto Almeida Silva Link: https://github.com/openwrt/openwrt/pull/23248 Signed-off-by: Robert Marko --- package/network/utils/wireguard-tools/files/wireguard_watchdog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/utils/wireguard-tools/files/wireguard_watchdog b/package/network/utils/wireguard-tools/files/wireguard_watchdog index fc90f4a25b..1b46e6178c 100644 --- a/package/network/utils/wireguard-tools/files/wireguard_watchdog +++ b/package/network/utils/wireguard-tools/files/wireguard_watchdog @@ -53,7 +53,7 @@ check_peer_activity() { last_handshake=$(wg show ${iface} latest-handshakes | grep ${public_key} | awk '{print $2}') [ -z ${last_handshake} ] && return 0; idle_seconds=$(($(date +%s)-${last_handshake})) - [ ${idle_seconds} -lt 150 ] && return 0; + [ ${idle_seconds} -lt 180 ] && return 0; logger -t "wireguard_monitor" "${iface} endpoint ${endpoint_host}:${endpoint_port} is not responding for ${idle_seconds} seconds, trying to re-resolve hostname" wg set ${iface} peer ${public_key} endpoint "${endpoint_host}:${endpoint_port}" }