Limit Bandwidth to Per IP

Hi,

i am using Mikrotik hEXA Lite Router. I have 20MB speed and almost 20 users in my office, now please read very carefully becoz no one is understanding my question, they mixed it up,
I WANT TO SET 1MB FOR EACH USER, I can do it with simple queue but it takes a lot of time, write one ip and set their bandwidth for each user, i wanna set this setting for all 20 users on one command, is there any possibility ??

One Command and each user will use 1MB Download and Upload, all users have their own 1MB speed at any time…


Regards,

M.Shahid

You can use some type of script that will work with dhcp server.

For example :

:local queueName “Client- $leaseActMAC”;

:if ($leaseBound = “1”) do={
/queue simple add name=$queueName target=($leaseActIP . “/32”) max-limit=1M/1M comment=[/ip dhcp-server lease get [find where active-mac-address=$leaseActMAC && active-address=$leaseActIP] host-name];
} else={
/queue simple remove $queueName
}

This skript will automatiacly assign dinamic queue to each ip adress.

why script?? there is no any queue type method to set bandwidth limit in Mikrotik??? although it is already running in my Mikrotik but that is only manually assign IP and set for its limit. any other option???

Queues are the method for BW limiting but there is another feature in the same vein and that is rate limiting (limiting the number of concurrent connections. This may very well do the job for you but unlike queues I believe if there is excess capacity (only one person on line) that person is still limited to the quota… BUT tis a bulk quota, in other words, one rule hits all users like you want!!

/ip firewall filter
add chain=forward action=drop protocol=tcp in-interface=LAN connection-limit=100,32
In the connection-limit field the 100 number is the total connections, the 32 is the netmask, so with this you are applying a 100 connection limit to every IP on your LAN interface.

You may wish to do the same for UDP??

it will effect only connection limit?? then what will i do for bandwidth limit???

I think what you want is PCQ - please see: https://wiki.mikrotik.com/wiki/Manual:Queues_-_PCQ_Examples

its work for me. thanks a lot

I was searching for this but again found my own post on this. This works for me and I am also using Simple Queue.
Limit Bandwidth to Per IP MikroTik