well I have a question, I have a small WISP in a town with 25 Customers, problem is that these days my ISP has been with his high Latency DNS that creates disconnections, the only solution is to slow down my clients who are simply queued to at least do not feel them Latency, single story with 2MB so is peru jejeje. can do so Automatic? a ruler to measure the MS and if it is under a rule is met.
Thank you.
If I understand what you are looking for: you can use the Ping Command in a script, and set the ping timeout to whatever you want it to be. If a number of pings out of a certain number “fail” then trigger a rule that will redirect guests DNS quires to another DNS server, and then once it pings successfully for another number of times, disable that rule and allow them to use the ISP DNS servers again. If you are looking to enable the queues upon ping failures, you can do that as well.
The only real limitation is that a script can only have 4096 characters in it I believe, but you can call a script from another one to get around that if needed. The interval setting is the timeout, without specifying ms I believe it defaults to seconds, so 1 = 1000ms. This script will send out 3 ping 3 times, and if 2 or more fail it will increment a variable by one, if this variable has been incremented 3 times, it will run the fail portion script, if it has not it will run the success portion of the script.
Something like this should get you started:
:local x 0; {:do {:set x ($x + 1)} while (($x < 3) && ([/ping 4.2.2.1 interval=1 interval=100ms count=3]<=1))};
:if ($x=3) do={:log error "DNS servers have high latency"; Put in what actions/script you want to take place if pings "fail";
} else { Put in what actions to take if the pings succeed.;
}
You can have it check to see if the action has already taken affect on later running of the script to save on resources and so it doesn’t keep on logging the same thing and repeating the same action. I use a similar script to monitor if a gateway connection is up, and to preform an action if it’s not or if it’s come back up after a failure.