fbpx

Can MikroTik limit the bandwidth for days?

The MikroTik firewall from the extra tab in filter rules has the time option which will allow you to establish days and hours to allow or deny client connections.

You can also achieve day-by-day bandwidth control using MikroTik's scripting tools and firewall rules along with queues to manipulate bandwidth based on specific days.

Here's how you could set up a solution that limits bandwidth based on specific days using MikroTik's scripting and task scheduling capabilities:

Step 1: Create the Queues

First, you need to configure simple queues to limit bandwidth. These queues can then be adjusted using scripts.

/queue simple add name="weekday-limit" target=192.168.88.0/24 max-limit=1M/1M
/queue simple add name="weekend-limit" target=192.168.88.0/24 max-limit=5M/5M

In this example, there are two different limits: one for weekdays and one for weekends.

Step 2: Create Scripts to Change the Rules

Now, you must create scripts that activate or deactivate the queues depending on the day. You can use MikroTik scripting to query the current day and adjust the queues as necessary.

/system script add name="apply-weekday-limits" source={
    /queue simple set [find name="weekday-limit"] disabled=no
    /queue simple set [find name="weekend-limit"] disabled=yes
}

/system script add name="apply-weekend-limits" source={
    /queue simple set [find name="weekday-limit"] disabled=yes
    /queue simple set [find name="weekend-limit"] disabled=no
}

Step 3: Program the Scripts

Use the MikroTik scheduler to run these scripts on the corresponding days.

/system scheduler
add name="enable-weekday-limits" on-event="apply-weekday-limits" start-time=startup interval=1d day=mon,tue,wed,thu,fri
add name="enable-weekend-limits" on-event="apply-weekend-limits" start-time=startup interval=1d day=sat,sun

These scheduled events will ensure that the rules are automatically applied based on the day of the week.

Final Considerations

  • Testing: Be sure to test your configuration in a controlled environment before deploying it to production to ensure that scripts and queues work as you expect.
  • Security and Maintenance: Regularly check queues and scripts to ensure there are no conflicts or performance issues.
  • Documentation: Documents all scripts and configuration well for future reference or new personnel.

This solution is not native and requires some familiarity with MikroTik scripting, but it is an example of how you can extend the capabilities of RouterOS to meet specific network management requirements.

There are no tags for this post.
Did this content help you?
Facebook
Twitter
LinkedIn
WhatsApp
Telegram

Other documents in this category

Leave your comment

Your email address will not be published. Required fields are marked with *

Tutorials available at MikroLABs

No Courses Found!

DISCOUNT CODE

AN24-LIB

applies to MikroTik books and book packs

Days
Hours
Minutes
Seconds

Introduction to
OSPF - BGP - MPLS

Sign up for this Free course

MAE-RAV-ROS-240118
Days
Hours
Minutes
Seconds

Sign up for this Free course

MAS-ROS-240111

Promo for Three Kings Day!

KINGS24

15%

all the products

MikroTik courses
Academy courses
MikroTik books

Take advantage of the Three Kings Day discount code!

* promotion valid until Sunday January 7, 2024
** the code (KINGS24) applies to shopping cart
*** buy your course now and take it until March 31, 2024

New Year's Eve Promo!

NY24

20%

all the products

MikroTik courses
Academy courses
MikroTik books

Take advantage of the New Year's Eve discount code!

* promotion valid until Monday, January 1, 2024
** the code (NY24) applies to shopping cart
*** buy your course now and take it until March 31, 2024

Christmas discounts!

XMAS23

30%

all the products

MikroTik courses
Academy courses
MikroTik books

Take advantage of the discount code for Christmas!!!

**codes are applied in the shopping cart
Promo valid until Monday December 25, 2023

CYBER WEEK DISCOUNTS

CW23-MK

17%

all MikroTik OnLine courses

CW23-AX

30%

all Academy courses

CW23-LIB

25%

all MikroTik Books and Book Packs

Take advantage of the discount codes for Cyber ​​Week!!!

**codes are applied in the shopping cart
Promo valid until Sunday December 3, 2023

BLACK FRIDAY DISCOUNTS

BF23-MX

22%

all MikroTik OnLine courses

BF23-AX

35%

all Academy courses

BF23-LIB

30%

all MikroTik Books and Book Packs

Take advantage of the discount codes for Black Friday!!!

**Codes are applied in the shopping cart

codes are applied in the shopping cart
valid until Sunday November 26, 2023

Days
Hours
Minutes
Seconds

Sign up for this Free course

MAE-VPN-SET-231115

Halloween promo

Take advantage of discount codes for Halloween.

Codes are applied in the shopping cart

HW23-MK

11% discount on all MikroTik OnLine courses

11%

HW23-AX

30% discount on all Academy courses

30%

HW23-LIB

25% discount on all MikroTik Books and Book Packs

25%

Register and participate in the free course Introduction to Advanced Routing with MikroTik (MAE-RAV-ROS)

Today (Wednesday) October 11, 2023
7pm to 11pm (Colombia, Ecuador, Peru)

MAE-RAV-ROS-231011