Auto Disabling and Enabling Interface using Script

Hello <>
I have an Issue with my interface named “bond1” , ( It is Bonding 3 Interfaces)
The speed suddenly goes down to 100kb/s from 30 mb/s !
and If I want it back to 30 mb/s I have to Disable the interface “Bond1” and Enable it MANUALLY !


Is there a Script that does the the following automatically :
1.Check if bond1 Speed is less than 1 mb/s .
2.disable bond1
3. delay 3 s
4.enable Bond 1 ?
I want it in Scheduler in Mikrotik and I want it to be done Auto every like 10 mints , so it checks always the traffic .
Can You help me to write the script please …
Thanks for your help :slightly_smiling_face:

Why not disabling and enabling interface let’s say every couple of hours for 1 second?

If I do that ; The users will get annoyed because the traffic flow will keep on disconnecting.
So I can not disable it every hour because the interface traffic is 2Gb/s..
Thanks for your reply .

So you have 30 mbit/s or 2 gb/s link?
Take into consideration if your link is really saturated due to high usage from user side (video streaming or downloading) and your script sees available bandwidth is around 100 kb/s it will automatically initiate disable/enable command.

Can you run ping towards google.com or some other server and check what is the latency when the bandwidth drops to 100 kb/s, maybe that could be set as a trigger for interface restart.

You can use:

  • tools/netwatch, works when connection gets lost (like PING)


  • tools/traffic monitor, works on connection condition/throughput

and then trigger a script (disable / enable) your interface.

Got it , Thanks my Friend !
DONE .