Router MikroTik often hangs and loses connection and does not automatically reconnect. The best way is to create a script that automatically detects and restarts the network interface. H2Ttool will guide you How to create auto reboot/reset interface when lost connection on MikroTik RouterOS.
Idea: Create a script that automatically pings google regularly. When detecting ping not reaching the destination, it will automatically restart the interface connecting to the internet.
Mục lục
Login to your MikroTik router
Use Winbox to access your MikroTik router device. Fill in the form: Connect To, Login, Password and press Connect.

Setup Netwatch – Create auto reboot/reset interface when lost connection
Step 1: Look at the toolbar on the left, choose Tools -> Netwatch

Netwatch window appears, select the + to add new Netwatch Host.

In Net Netwatch Host window you can enter as shown below:

- Host: IP to ping check connection, i choose google ip (8.8.8.8). You can choose any ip you want to check.
- Interval: hh:mm:ss – ping test execution time.
- Timeout: Maximum response time, default is 1s = 1000ms. If the response time from the Host exceeds the above time, Netwatch will execute the command in the Down tab, if not use Up tab.
Install the script in the Up and Down tabs -> Click OK to finish:
:log info "NETWATCH--Auto check ping google..."
:if ([/ping 8.8.8.8 count=5]=0) do={
log info "NETWATCH--Check ping down, auto reset Interface/Wireless Port!" ; /interface disable ether2 ; delay 5000ms ; /interface enable ether2}

/ping 8.8.8.8 count=5 -> You can choose another IP and number of ping packets
/interface disable ether2 and /interface enable ether2 -> You need to choose the correct interface or wireless connection to the internet to check.
- If you use INTERFACES use this example: /interface disable ether2
- If you use WIRELESS use this example: /interface wireless disable wlan1
Watch tutorials on youtube
Good luck! If there are configuration problems or need to be discussed, do not hesitate to leave a comment below the article!
Hi, my problem is the following, as the tutorial says, I follow the steps, but it doesn’t run the script again within the time I put it, let me run it again in a minute to check that it’s online and it doesn’t.
Check Install the script in the UP AND DOWN tabs
There is a redundant check for 8.8.8.8, in Netwatch and also in the script.
Down-Script:
/interface disable ether1; :delay 15000ms; /interface enable ether1; :log info “8.8.8.8 is down, restart ether1”
I am am excited too with this question.
Hey there,
Want your business showcased in Google News?
Our hyper-targeted content gets distributed across Google News and similar platforms, bringing you increased exposure, calls, and clients.
Reply with “YES” to learn more.
Best regards,
Pas