Page 1 of 1

Restricting Active User count in hotspot

Posted: Fri May 13, 2016 11:48 am
by drnitinarora
Is there a way we can restrict the Active user sessions in Hotspot?

Eg.
- If we have 100 connected hosts to mikrotik
- If we set active users to 10 , then only 10 active users are allowed to login out of 100 connected hosts at any given time.

Thanks in anticipation

Re: Restricting Active User count in hotspot

Posted: Sun May 15, 2016 5:05 am
by Sinan
you can kick them out of the active as soon as they enter if the total limit of the active users exceed the required one
try to add this in your user profiles >>> script on login
{
#add the total allowed number in the end of the next line
:local no 10
:local act [:len [ip hotspot active find]]
:if ($act >$no) do={
/ip hotspot active remove [find user="$username"]
}
}

Re: Restricting Active User count in hotspot

Posted: Sun May 15, 2016 1:34 pm
by drnitinarora
Thank you for your reply Sinan!

We have added a script already which monitors number of active sessions.

Our concern is how will the user know why he/she is not allowed to login.

Looking out for a way to show some message or redirect user to a url where we can display prefabricated messages.

Re: Restricting Active User count in hotspot

Posted: Mon May 16, 2016 10:10 am
by Sinan
Thank you for your reply Sinan!

We have added a script already which monitors number of active sessions.

Our concern is how will the user know why he/she is not allowed to login.

Looking out for a way to show some message or redirect user to a url where we can display prefabricated messages.
ok try to do this also on "script on login"

{
#add the total allowed number in the end of the next line
:local no 10
:local act [:len [ip hotspot active find]]
:if ($act >$no) do={
/ip firewall address-list add address=$address list=blocked
}
}

and then add a firewall rule to redirect ips of the list "blocked" to your page you wanna