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:
- Navigate to IP > HotSpot and click “HotSpot Setup”.
- Choose the interface where you want the HotSpot to operate.
- 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:
- Go to IP > HotSpot > User Profiles.
- Create a new profile or edit an existing one.
- 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.
- En
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:
- 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;
- 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.