limit user connection

I have RB951G with 1 wan (eth01) and dhcp server (eth02 - eth05) with address 10.0.0.1-10.0.0.254
I want to config so that only 40 users can connect to the internet. the other user still received ip from dhcp server but can’t connect to the internet.
Thanks in advance and sorry for my bad english

40 listed individuals or randomly selected first 40?

randomly selected first 40

Set two dhcp pools, one with 40 addresses, second with the rest. Set short lease time (10-20s). Use firewall rules to enable the first pool and disable the scond pool internet access. Should be working.

Tks but if one of the 40 users left. That leaves 1 empty spot in the first dhcp pool right ? that means the other user from 2nd dhcp pool will have to reconect to receive ip from first dhcp pool right ??

No. It is not like queue for stepping forward. When one leaves the first pool, the newly connected client gets the released ip address. So whoever connects at the right time when ip is free, gets it. In practical it still keeps the random approach with lease time as parameter you can tweak to see the real behaviour.

Thanks. Btw can u help me with your config i’m still new to this.

that means 2 dhcp in 2 different bridge right?

can u show me how. Thanks

No, two pools (ip ranges) in the same dhcp (as jarda wrote).

Firewall rules are simple, allow internet from “40-ip-pool” (use an address list) and block the rest.

Kay i understand the firewall rules but i still don’t know how to add 2 pools in the same dhcp. Can u be more specific please. I created 2 pool, the first one has 40 ip and the other has the rest. How can i add two of them in the same dhcp ???
Sorry for my bad english

Just open the first pool and set the second to be continued in it…

In other words, set pool2 as “next pool” of pool1. In dhcp server set only pool1. The pool2 should be used automatically when pool1 is exhausted.

Thanks a lot bajodel and jarda for helping me solved this problem :slight_smile:

With pleasure. Please share with us how it works and what is the practical experience.

Still don’t know yet, but i thinks it will worked fine.
Btw is my firewall rules correct ??
Firstly, I added 2 address list 10.0.0.2-10.0.0.42 and 10.0.0.42-10.0.0.254
then i created rules in firewall filter > advanced: address list(first 40 ip) > out interface: eth01 >action: accept
(all the ip left) > eth01 > drop
Thanks in advance and sorry for my bad english.

You can try by fix ip assignment to testing device…

it 's worked perfectly guys =]]]. First 40 ip can connect to the internet but the rest of the ip can’t. The firewall rules are same as above. Tks for the help guys :slight_smile:

Your welcome. Enjoy it.

Please keep in mind that RB951G is shipped with L4 license, so only 20 users of hotspot can online on the same time; unless you buy the additional L5 license and load it into your RB951G.

Paul

There is no relation to hotspot in this topic.

eh only 20 users at the same time ? But i checked it on this website and it says 200 users ???
http://wiki.mikrotik.com/wiki/Manual:License