fbpx

How can we ensure that the bandwidth is automatically distributed according to the number of users in HotSpot MikroTik? For example 10MB, 2 users connected and it is divided into 5MB each?

In the Server profile configurations you can indicate that the Queue is generated within a Parent Queue and in addition to this you can indicate a Queue Type such as PCQ so that the bandwidth is distributed.

Another option is to use the dynamic queue functionality. The idea is that each connected user receives an equal share of the total available bandwidth, automatically adjusting as users connect or disconnect.

We explain how to achieve this:

Step 1: Set up HotSpot

First, you need to have a HotSpot configured on your MikroTik device. You can configure it from WinBox or WebFig by following these basic steps:

  1. Navigate to IP > HotSpot and click “HotSpot Setup”.
  2. Choose the interface where you want the HotSpot to operate.
  3. Follow the steps of the wizard to configure the HotSpot network, including HotSpot IP address, DHCP address range, etc.

Step 2: Configure the HotSpot User Profile

To have bandwidth distributed automatically, you can use HotSpot user profiles to define dynamic bandwidth limits:

  1. Go to IP > HotSpot > User Profiles.
  2. Create a new profile or edit an existing one.
  3. Set the speed limit:
    • En Rate Limit (rx/tx), you can define specific limits, but to make it dynamic based on logged in users, use a script or mangle along with queues that adjust this value.

Step 3: Use Scripts to Dynamically Adjust Bandwidth

Since MikroTik does not have a built-in functionality that automatically adjusts bandwidth per user based on the total number of connected users, you would need a method to calculate and adjust these values ​​dynamically, possibly through scripting:

  1. Create a script that:
    • Count the number of users connected to the HotSpot.
    • Divide the total available bandwidth by the number of users.
    • Adjust the Rate Limit in the HotSpot user profile according to the connected users.
:local totalBW 10000; # 10 Mbps total
:local usersCount [/ip hotspot active print count-only];
:local userBW ($totalBW / $usersCount);
:local rate ($userBW."k/".$userBW."k");
/ip hotspot user profile set [find name="default"] rate-limit=$rate;

  1. Program the script to run at regular intervals or every time a user logs in or out:
    • Go to System > Scheduler and create a new task to run the script every minute for example.

Final Considerations

  • Performance: Please note that running scripts frequently can affect device performance, especially if there are many users.
  • Testing: Be sure to test the configuration in a controlled environment to adjust the script and parameters as necessary before deploying it to production.

This method provides a way to dynamically adjust bandwidth per user on a MikroTik HotSpot, although it requires additional manual configuration and scripting knowledge in RouterOS.

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