fbpx

Is it possible to do limited time control in Wireless MikroTik? example: only from 12:00 to 14:00 every day?

If possible through access list (MAC address) or firewall rules (IP Address)

This type of control can be achieved using the MikroTik Firewall functionalities together with the mangrove rules and access policies of the Wireless Access List. The idea is to create rules that allow or block access to the wireless network depending on the time of day. Here's a basic approach on how it could be configured:

Step 1: Create a Mangrove Rule to Mark Traffic

First, you will need to mark traffic coming from the wireless network so you can apply specific policies to that traffic.

  1. Access your MikroTik device through WinBox or the web interface.
  2. Go to IP > Firewall and select the tab Mangle.
  3. Create a new rule by clicking the plus sign (+).
  4. In the section General, select the wireless interface in “In. Interface".
  5. In the Action, choose “mark connection,” and assign a name to the mark (for example, “wireless-time-control”).
  6. Apply and save the rule.

Step 2: Create Filter Rules to Control Time-Based Access

Now, using the flag created, you can define filter rules that specify when traffic is allowed or blocked.

  1. Still in IP > Firewall, go to the tab Filter Rules.
  2. Create a new rule to block traffic outside of permitted hours.
    • In the section General, choose the wireless interface in “In. Interface".
    • In the section Advanced, in “Connection Mark”, select the mark created previously (e.g., “wireless-time-control”).
    • In the Extras, sets the time in which the block will be active (outside the allowed hours). For example, to block everything except 12:00 to 14:00, you'll need two rules: one before 12:00 and one after 14:00.
    • In the Action, select “drop” to block flagged traffic outside of permitted hours.
  3. Repeat the step to cover the time slots in which you want to restrict access.

Step 3: Adjust the Rule to Allow Traffic During the Specified Hours

It is not necessary to create a specific rule to allow traffic during allowed hours if the blocking rules have been configured correctly to cover all other hours. Unmarked or unblocked traffic will be allowed automatically.

Considerations

  • This method controls traffic at the network level and affects all users connected to the specified wireless interface. For more granular control (per user or device), you could explore additional options such as MikroTik's “User Manager” to manage access based on user profiles.
  • Be sure to adjust the rules based on your network context and perform tests to confirm that access control is working as expected.

Implementing time-limited access control on MikroTik wireless networks using the “Access List” functionality is another strategy that can be used, especially when seeking to apply restrictions to individual devices or specific groups of users. Although the Access List alone does not allow direct time-based configuration, you can combine it with scripts and schedulers to enable and disable access according to defined times.

We leave you a basic approach of how you could do it:

Step 1: Configure the Access List

  1. Access your MikroTik device via WinBox or the web interface.
  2. Navigate to wireless and select the tab Access List.
  3. Click the plus sign (+) to add a new entry.
  4. In the new entry, you can specify the MAC address of the device you want to restrict access to. You can leave the rest of the options at their default values ​​or adjust them according to your specific needs.
  5. Make sure the option Disabled is marked as No. for the rule to be active.

Step 2: Create Scripts to Enable and Disable Access

You will need to create two scripts: one to disable the Access List rule (block access) and one to enable it (allow access).

  1. To disable access:
    • Go to System > Scripts.
    • Create a new script with a descriptive name, such as “DisableWiFiAccess.”
    • In the countryside Source, type the command to disable the Access List rule, for example:
    • /interface wireless access-list set [find mac-address=XX:XX:XX:XX:XX:XX] disabled=yes
    • Replace “XX:XX:XX:XX:XX:XX” with the MAC address of the corresponding device.
  2. To enable access:
    • Repeat the process by creating another script called “EnableWiFiAccess”.
    • In the countryside Source, uses:
    • /interface wireless access-list set [find mac-address=XX:XX:XX:XX:XX:XX] disabled=no
    • Make sure you use the same MAC address as before.

Step 3: Configure the Scheduler to Run Scripts

To automate the execution of these scripts according to your desired schedule (for example, only allow access from 12:00 to 14:00), you will use the MikroTik Scheduler.

  1. Go to System > Scheduler.
  2. Create a new scheduler for to disable the access. Set the Start Time at the time you want to block access (for example, 14:00 p.m.) and at On Event, calls the “DisableWiFiAccess” script.
  3. Create another scheduler to enable the access. Set the Start Time at the time you want to allow access (for example, 12:00) and at On Event, calls the “EnableWiFiAccess” script.

This approach allows you to have more granular control over individual devices' access to your MikroTik Wi-Fi network, allowing or denying access at specific times. Remember that this method requires manual management of the MAC address for each device and the creation of scripts and schedulers for each access rule you want to control.

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