change rate limit

I have Mikrotik v4.11 with hot spot account. I want each user to have two speed limit: one when there is few users login and other if the server is croweded.

for example if the user rate rate limit is 42k/600k, I want it to drop to 42k/512k.

It can be done, but it is too complicated to say ‘here’s how you do it’.

There is another thread by gunther01 looking to do something similar, and he says he’s working on it.

How are you going to decide if the router is ‘crowded’? How does that condition reset?

You will either have to use RADIUS CoA (http://wiki.mikrotik.com/wiki/Manual:RADIUS_Client#Change_of_Authorization) or use PCQ in HTB attached to global-in and global-out completely bypassing the Hotspot rate limits and doing everything manually.

Beware !

COA will only work for you if the RADIUS server has access to your network, and you have allowed Incoming Radius on the mikrotik.

You’ll also need something to actually push the COA requests.

Following instructions are for download traffic:

  1. packet mark normal_traffic traffic when there’s no congestion
    and packet mark heavy_traffic traffic during congestion. Decision when to mark_heavy is up to you.

  2. create pcq_normal_traffic with rate limit 640 with dst address as classifier
    3)create pcq_heavy_traffic with rate limit 512 with dst address as classifier

4)create HTB with two leafs: normal and heavy
assign normal_traffic packet mark and pcq_normal queue to normal leaf
assign heavy_traffic packet mark and pcq_heavy queue to heavy leaf

the speed I mention is example. I have other user profiles with different speeds

Attach address lists to the profiles, mark packets based on address list.

Or, If user IP addresses are not static - mark traffic from given traffic group with unique DSCP (on user’s station or AP). Mark packets, where HTB resides (GW?), according to DSCP marks.

then I think that I will just leave it at 600kbps

Both local and AAA Hotspot users can be given dynamic address listst that they will be added to on login, and removed from on logout.