Community discussions

MikroTik App
 
drnitinarora
newbie
Topic Author
Posts: 32
Joined: Fri Sep 25, 2009 6:08 pm

Restricting Active User count in hotspot

Fri May 13, 2016 11:48 am

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
 
User avatar
Sinan
Trainer
Trainer
Posts: 129
Joined: Tue Sep 01, 2015 7:00 am

Re: Restricting Active User count in hotspot

Sun May 15, 2016 5:05 am

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"]
}
}
 
drnitinarora
newbie
Topic Author
Posts: 32
Joined: Fri Sep 25, 2009 6:08 pm

Re: Restricting Active User count in hotspot

Sun May 15, 2016 1:34 pm

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.
 
User avatar
Sinan
Trainer
Trainer
Posts: 129
Joined: Tue Sep 01, 2015 7:00 am

Re: Restricting Active User count in hotspot

Mon May 16, 2016 10:10 am

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

Who is online

Users browsing this forum: Neojie and 18 guests