Community discussions

MikroTik App
 
kraic
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 76
Joined: Tue Oct 19, 2010 10:31 am
Location: Croatia
Contact:

Best way to limit wireless dinamic users to 5M

Fri May 06, 2016 5:28 pm

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
 
0ldman
Forum Guru
Forum Guru
Posts: 1447
Joined: Thu Jul 27, 2006 5:01 am

Re: Best way to limit wireless dinamic users to 5M

Fri May 06, 2016 7:54 pm

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 
 
gius64
Member Candidate
Member Candidate
Posts: 213
Joined: Tue Jan 14, 2014 3:43 pm

Re: Best way to limit wireless dinamic users to 5M

Sat May 07, 2016 2:29 pm

You can use a script on DHCP Lease.

Read here:
http://forum.mikrotik.com/viewtopic.php?t=87219

The last posts from boen_robot!
 
User avatar
dgnevans
Member
Member
Posts: 463
Joined: Fri Mar 08, 2013 11:24 am
Location: Zimbabwe
Contact:

Re: Best way to limit wireless dinamic users to 5M

Sat May 07, 2016 3:02 pm

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.
 
kraic
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 76
Joined: Tue Oct 19, 2010 10:31 am
Location: Croatia
Contact:

Re: Best way to limit wireless dinamic users to 5M

Mon May 09, 2016 1:07 pm

Ok. Thank you. Can you make a copy of your export file where I can see firewall rools and queue tree for this example.
 
User avatar
dgnevans
Member
Member
Posts: 463
Joined: Fri Mar 08, 2013 11:24 am
Location: Zimbabwe
Contact:

Re: Best way to limit wireless dinamic users to 5M

Mon May 09, 2016 2:02 pm

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.
 
kraic
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 76
Joined: Tue Oct 19, 2010 10:31 am
Location: Croatia
Contact:

Re: Best way to limit wireless dinamic users to 5M

Mon May 09, 2016 2:04 pm

Do I need packet marking in ip/firewall ?
Or this is working without it ?

Ty
 
User avatar
dgnevans
Member
Member
Posts: 463
Joined: Fri Mar 08, 2013 11:24 am
Location: Zimbabwe
Contact:

Re: Best way to limit wireless dinamic users to 5M

Mon May 09, 2016 3:17 pm

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
 
kraic
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 76
Joined: Tue Oct 19, 2010 10:31 am
Location: Croatia
Contact:

Re: Best way to limit wireless dinamic users to 5M

Tue May 10, 2016 11:31 pm

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 ??
 
kraic
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 76
Joined: Tue Oct 19, 2010 10:31 am
Location: Croatia
Contact:

Re: Best way to limit wireless dinamic users to 5M

Fri May 13, 2016 8:38 pm

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

Who is online

Users browsing this forum: xrayd and 41 guests