Mikrotik watchdog or interface restarting script?

Hi,
Just wanted to share our script which helps with the situation when LTE interface is locked out (many people experience that with 4G routers) but for some reason don’t want to or simply can’t restart the device

Add the below script and run a scheduler as often as needed (we do it every 3 mins):

:global ipPing (“8.8.8.8”)
:global testpingip
:set testpingip [/ping $ipPing interval=1 count=10]
:if ($testpingip = 0) do={
:log info (“lost”)
:log warning “Disabling the interface”;
/interface ethernet disable lte1
delay 20s;
:log warning “Interface enabled again”;
/interface ethernet enable lte1} else={
:log warning “ALL is OK Nothing to do”
}

There might be a case when #Routerboard completely losses LTE interface. In such situation the best to run wachdog:
/system watchdog set watch-address=1.1.1.1 watchdog-timer=yes ping-timeout=300 ping-start-after-boot=4

Hope this will help you and save you time to drive to remote location just to put the plug out and then plug it in.

1 Like

Thanks for this script. It appears to be running OK but I can’t see any of the LOG entries appearing when the script runs?