Community discussions

MikroTik App
 
User avatar
Jwan
just joined
Topic Author
Posts: 4
Joined: Sat Dec 09, 2017 1:08 pm

Auto Disabling and Enabling Interface using Script

Sat Aug 22, 2020 5:53 pm

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 🙂
 
creatin
Member Candidate
Member Candidate
Posts: 108
Joined: Sat Nov 23, 2019 2:59 am

Re: Auto Disabling and Enabling Interface using Script

Mon Aug 24, 2020 10:12 pm

Why not disabling and enabling interface let's say every couple of hours for 1 second?
 
User avatar
Jwan
just joined
Topic Author
Posts: 4
Joined: Sat Dec 09, 2017 1:08 pm

Re: Auto Disabling and Enabling Interface using Script

Mon Aug 24, 2020 10:46 pm

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 .
 
creatin
Member Candidate
Member Candidate
Posts: 108
Joined: Sat Nov 23, 2019 2:59 am

Re: Auto Disabling and Enabling Interface using Script

Tue Aug 25, 2020 11:48 am

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.
 
WeWiNet
Long time Member
Long time Member
Posts: 592
Joined: Thu Sep 27, 2018 4:11 pm

Re: Auto Disabling and Enabling Interface using Script

Tue Aug 25, 2020 1:23 pm

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.
 
User avatar
Jwan
just joined
Topic Author
Posts: 4
Joined: Sat Dec 09, 2017 1:08 pm

Re: Auto Disabling and Enabling Interface using Script

Mon Mar 15, 2021 9:15 pm

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 .

Who is online

Users browsing this forum: No registered users and 25 guests