Hello,
what is the best way to limit 500 users in one hotel, where there is one CCR that gives DHCP addresses, and everything is bridged. Users are dinamic, changing all the time APs and DHCP addresses every 2 hours.
I don’t wanna use Hotspot.
I tried PCQ, but not working so far.
Thank You
Quick and dirty copy, paste and edit of my PCQ. This should limit each connection to 5M, though each client can still have multiple connections.
It is hard to deal with dynamic like that. I haven’t had to deal with that yet.
You’d still need the Queue tree or simple queues set to use the PCQ type.
5 name="PCQ_Upload" kind=pcq pcq-rate=5M pcq-limit=2000KiB pcq-classifier=src-address pcq-total-limit=8000KiB pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s
pcq-src-address-mask=32 pcq-dst-address-mask=32 pcq-src-address6-mask=128 pcq-dst-address6-mask=128
6 name="PCQ_Download" kind=pcq pcq-rate=1M pcq-limit=2000KiB pcq-classifier=dst-address pcq-total-limit=8000KiB pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s
pcq-src-address-mask=32 pcq-dst-address-mask=32 pcq-src-address6-mask=128 pcq-dst-address6-mask=128
You can use a script on DHCP Lease.
Read here:
http://forum.mikrotik.com/t/script-dhcp-lease-to-simple-queues/79196/1
The last posts from boen_robot!
setup your queue types.
Then create a simple queue and apply it to a whole subnet.
eg
name="GUESTS" target=172.17.18.0/23 parent=none packet-marks=""
priority=8/8 queue=pcq-upload-default/pcq-down-1.5M limit-at=0/0
max-limit=0/0 burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s
bucket-size=0.1/0.1
each of the clients will be limited to the pcq upload and download you have associated.
Ok. Thank you. Can you make a copy of your export file where I can see firewall rools and queue tree for this example.
Which users firewall rules and queue tree are you requesting.
Do I need packet marking in ip/firewall ?
Or this is working without it ?
Ty
Mine is using the ip address of the computer you are browsing of the device you are browsing to carry out limiting. If you would like to go through queue tree have a look at these videos
https://www.youtube.com/watch?v=BOtX2QA10ak
https://www.youtube.com/watch?v=n4QZl_9pubo
Yeah, I did everything same but nothing. How important is to setup maxlimit provided by my ISP, and how to set limit if I sometimes have 200 users and sometimes 500 users.
/ip firewall mangle
add action=mark-connection chain=forward new-connection-mark=NET1-CM src-address=192.168.80.0/24
add action=mark-packet chain=forward connection-mark=NET1-CM new-packet-mark=NET1-PM
/queue tree
add name=queue1 packet-mark=NET1-PM parent=bridge-local queue=pcq_downsteam
add name=queue2 packet-mark=NET1-PM parent=ether1-gateway queue=pcq_upstream
/queue type
add kind=pcq name=pcq_downsteam pcq-classifier=dst-address pcq-dst-address6-mask=64 pcq-limit=2000KiB
pcq-src-address6-mask=64 pcq-total-limit=8000KiB
add kind=pcq name=pcq_upstream pcq-classifier=src-address pcq-dst-address6-mask=64 pcq-limit=2000KiB
pcq-src-address6-mask=64 pcq-total-limit=8000KiB
What did I miss ??
I found the best way is to make dynamic Queues using this script, that is pasted in
ip/dhcp-server/ DHCP and double click on your DHCP server.
In box named lease-script just put:
#Lease to Simple Queues
#V.1 By Virtual IT Export
:local queueName “kraicClient- $leaseActMAC”;
:if ($leaseBound = “1”) do={
/queue simple add name=$queueName target=($leaseActIP . “/32”) limit-at=1024k/5120k max-limit=1024k/5120k comment=[/ip dhcp-server lease get [find where active-mac-address=$leaseActMAC && active-address=$leaseActIP] host-name];
} else={
/queue simple remove $queueName
}
It’s working after MT router reboot.
Good Luck