Yes, in MikroTik's RouterOS it is possible to automate tasks, such as disabling or changing the browsing speed of a queue, through the use of scripts and the scheduler.
This allows you to dynamically manage bandwidth and access policies without the need for ongoing manual intervention. Next, I explain how it can be done:
Create a Script
First, you need to create a script that performs the desired action, such as modifying the speed of a specific queue or disabling it. You can do this from the “System” → “Scripts” menu in WinBox or through the command line.
For example, a script to change the speed of a queue could look like this:
:local newSpeed "1M/1M";
/queue simple set [find name="nombreCola"] max-limit=$newSpeed;
And a script to disable a queue:
/queue simple disable [find name="nombreCola"];
Make sure to replace "nombreCola"
with the name of the queue you want to modify and adjust the value of newSpeed
at the desired speed.
Schedule the Task
After creating the script, you can use the Scheduler to run this script automatically at a time or frequency that you choose. This is done from “System” → “Scheduler”.
Here you can add a new task, specify when it should run (for example, at a specific time of day or at a certain frequency), and which script it should run. For example:
/start-time=00:00:00
/interval=1d
/on-event="nombreScript"
This example would schedule the task to run every day at midnight, using the name of the script you created.
Considerations
- Testing: Before fully relying on scripts and scheduler for critical tasks, it is advisable to test them in a test environment to ensure that they work as expected.
- Security and Stability: Keep in mind the impact these changes may have on your network, especially if you are adjusting bandwidth during peak hours or disabling important queues.
- Structural: Although automation can save a lot of time, it is still essential to monitor the performance and health of your network to ensure that these automatic adjustments are having the desired effect.
Using scripts and the scheduler in RouterOS is a powerful way to automate bandwidth management and other network administration tasks, allowing you to optimize network performance according to the changing needs of your organization or your customers.
There are no tags for this post.