mikrotik:wgbugwatchdog
Questa è una vecchia versione del documento!
Wireguard Bug - Watchdog automatico per reset peer
:local timeoutSec 130
:foreach i in=[/interface wireguard peers find] do={
:local hs [/interface wireguard peers get $i last-handshake] :local name [/interface wireguard peers get $i name]
:if ([:len $hs] > 0) do={ :local h [:tonum [:pick $hs 0 2]] :local m [:tonum [:pick $hs 3 5]] :local s [:tonum [:pick $hs 6 8]] :local age ($h * 3600 + $m * 60 + $s) :if ($age > $timeoutSec) do={ /interface wireguard peers disable $i :delay 1 /interface wireguard peers enable $i :log warning "WG peer $name riavviato: handshake $age sec fa" } } else={ :log debug "WG peer $name mai connesso: handshake assente" }
}
mikrotik/wgbugwatchdog.1754208196.txt.gz · Ultima modifica: da djbx83