At times due to load balancing,a vpn connection stops working and crm systems,radius servers or remote access may stop working.Here is a script to disable vpn and re enable
Navigate to scheduler,
Click add new scheduler.
Paste the following code on Event
Set time to run every 1 minute
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
{ :global ovpnClientName “VPN NAME ON INTERFACES” :local ovpnStatus [/interface ovpn-client get [find name=$ovpnClientName] running] :if ($ovpnStatus ~ “false”) do={ :put “here” /interface ovpn–client disable [find name=$ovpnClientName] :delay 1s /interface ovpn–client enable [find name=$ovpnClientName] :put “2” } } |
Expected on mikrotik