Free Hotspot user time limitation

I configured the hotspot on my mikrotik and everything works fine.
What I need now is a way to limit hotspot users to a 30 minutes per day usage.
I configured one hotspot user which can have 5 people in the same time logged in. But I need something that will disconnect every user that exceeds 30 minute per day time limit, but will not block that user account if first user exceeds 30min. So in general that a bunch of people can log in using same username and password but each of them can stay online only for 30 minutes per day.

Thanks.

The hotspot “trial user” feature of RouterOS does exactly this!
See the MikroTik Hotspot docs: http://www.mikrotik.com/docs/ros/2.9/ip/hotspot.

If you put “30m/1d” as value for the trial-uptime parameter and active (only) the trial login method, each user (which is identified by his MAC address) can login for 30 minutes every day without having to authenticate.

Does that help?

Best regards,
Christian Meis

But I also need some of the users to have full access without limiting time, the diference will be made through login accounts.
Users that will use internet for free will be limited to 5kB download and that time limitation of 30min, but I need other users to have access according to user account settings I provide.

You can configure the hotspot to allow the free trial users and assign a special profile for the trial (free) users (limiting to 5 kb, for example).

If you configure “normal” hotspot users, those will of course be able to use your service without limitations (or only the limitation you impose on them)…

Best regards,
Christian Meis

I’ve been trying to do this for the last couple hours…exactly How does one have the trial users and the regular subscribers on the same hotspot?

Login methods checked for my hotspot are: http chap, cookie, trial

I made a trial user profile with username “guest” and password “guest” and linked it to a trial user profile which, in turn, is linked to the trial login config parameters. but when I log in to this “guest” user it does not shut off after 10 minutes (the amount I set on the ‘trial’ login configuration.). When I set an uptime limitation of 10 minutes directly on the trial user’s profile also (to match the trial login config parameters) the “guest” user name stops working (of course) after 10 minutes, but no other “guest” can ever log in…I know why this does not work…want to know what will…

Help please…

Username for trial user is in format:
T-
where is replaced with MAC address of a client.

Trial users are not added by hand. They are created automatically by hotspot
on first trial login for every MAC. Those trial users appear as dynamic
under “/ip hotspot user”. limit-uptime is set for each of them automatically
from trial-uptime setting.
Trial (dynamic) users are automatically deleted after some time (second half
or trial-uptime setting). It allows the same client (MAC address) to use
trial method again.

ok, when I check the “trial” login method, clear out the cookies and active users and then try to “surf on in” to my hotspot “clean” like someone just stumbling on the hotspot for the first time, I still get a login screen… Where’s the “trial” feature? Hotspot won’t let me on = no free trial. again, what am I doing wrong?

Are you using the default login page or a custom one? There’s a dynamic variable on the default one that detects whether the trial user feature is enabled or not and provides a link if it is enabled.

What I like to know is what is the best way to enable the trial user feature using a remote server - do I send back the T- user/pass to the MT as a post/get as per usual?

Thanks, I’m getting closer to this…
I did customize the “login” page and Looks like I may have, out of ignorance, crippled or removed that trial user link…any one have an example of what the html code looks like that allows the trial user access on the login page? I can use the info to compair it to my “customized” login page & fix what I broke.

<div class="notice" style="color: #c1c1c1; font-size: 9px">Please log on to use the mikrotik hotspot service<br />$(if trial == 'yes')Free trial available, <a style="color: #FF8080"href="$(link-login-only)?dst=$(link-orig-esc)&username=T-$(mac-esc)">click here</a>.$(endif)</div><br />



And I just got that working - pretty easy, works well. Just sent back the URL similar to:

Of course that could be made tidy by using more appropriate variables from the MT Router.

It’d be nice to have trial data limits as well.

Howdy,

We’re having issues taking payments from redirection outside of our walled garden.

I.E.

  1. User trials. Likes the service and goes to sign up.
  2. Pays via our local payment gateway
  3. RE-directs to third party site for confirmation (i.e. http://www.mycardsecure.com)
  4. then back to our local payment gateway
  5. then confrimed and able to login.

However, at step 3, there are sites not within our walled garden and the whole payment process freezes and I get support calls.

The Question:
how do I get a trial assigned to someone who has already trialed (or reset the trial) so they can make payment using the trial time without getting stuck at step 3?

Thanks in advance.

Hello,

You could do two things…

1.- when you get the support call (not if but when) you can figure out what is the address they are trying to reach for step 3 and add it to the walled garden, then they can continue on with the registration and any new user that tries to go to the same place will not have the problem.

2.- To reset the trial you only have to find the MAC of the trying customer and delete from the “users” tab in the hotspot… that will efectively remove the restrictions to that user and they can go in their merry way to pay you for the service and continue to step 4

With procedure 2 though you’d have to do that over and over for every customer that freezes on step 3… whilst with procedure 1 problem is solved for good..

Hope this helps some…

Hello i need some thing like this but in my own case the place a a school e-learning center were the student are only allowed to use only 2hour a day and the system will have to be use by another student, note the PC has the same Mac-address and am using the usermanager. it this possible?

We’re revisiting this.

We did step one. But it wasn’t pleasant, 80% of our support calls are people giving us money (or not as the case may be).

Is there a way to implement this from the signup.

I.e.
User connects
Performs a Trial (HA!, how likely is that)
Trial runs out.
Redirected to login Page,
Chooses to signup,
Selects Payment,
Payment Selection tells Hotspot to remove trial User (if Exists) and re-initiate Trial
User Makes Payment.
Trial is logged out and user time run out
Redirected to Login, or auto logged in as part of above…

Thoughts?

I assume that everybody is trying to access the same payment method and so everybody is having the same problem.

Am I right in understanding that there are some sites that cannot be accessed because they are not added to the walled garden? If so, am I correct in understanding that the reason they’re not in the walled garden is because you can’t work out what they are?

If this is the case, why not put a proxy between you and the payment site and log every site you visit when you make a payment and then add these to the walled garden?

If this is not the case, could you explain exactly what the problem is?

Cheers,

Nick.

Hi Nick,

Thanks for your comments. Seems like a good idea.

I don’t know how it is for the rest of the world, but our payment providers (I can’t use Paypal, Netcash, Authorize.net etc.. NZD is not a very well supported currency) provide 3DES, when a credit card is used it goes to the banks (or third party site) for verification, depending on their Bank / Credit card, this could be a number of sites.

We have over 70 Hotspots and they are not centrally managed, so we need to add to every walled garden. We have been collecting a list of sites and adding them in, especially now whilst performing upgrades. But it is still tedious. I will look into your proxy idea also :slight_smile:

Cheers

hi guys
with this is possible tou have 5 group of shared users (trial users) with different limit time ??

http://forum.mikrotik.com/viewtopic.php?f=10&t=61668&p=315309#p315309

can any body help me ?

let say if i configure “Trial uptime time 1d 00:10:00” and “trial uptime reset 30d 00:10:00” what does that means i’m a little confused with this…

It means the user can use ten minutes of internet, then will be locked out. After one month, he can use 10 minutes again.

{
:local offset 7
:global today
{
:local date [ /system clock get date ]
:local montharray ( “jan”,“feb”,“mar”,“apr”,“may”,“jun”,“jul”,“aug”,“sep”,“oct”,“nov”,“dec” )
:local monthdays ( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 )
:local days [ :pick $date 4 6 ]
:local monthtxt [ :pick $date 0 3 ]
:local year [ :pick $date 7 11 ]
:local months ([ :find $montharray $monthtxt] )
:for nodays from=0 to=$months do={
:set days ( $days + [ :pick $monthdays $nodays ] )
}
:set days ($days + $year * 365)
:set today $days
}
:foreach i in=[/ip hotspot user find where profile=PRIVATE disabled=no] do={
:if ([ :find [ /ip hotspot user get $i comment ] ] = 0 ) do={
:local date [ /ip hotspot user get $i comment ]
:local montharray ( “jan”,“feb”,“mar”,“apr”,“may”,“jun”,“jul”,“aug”,“sep”,“oct”,“nov”,“dec” )
:local monthdays ( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 )
:local days [ :pick $date 4 6 ]
:local monthtxt [ :pick $date 0 3 ]
:local year [ :pick $date 7 11 ]
:local months ( [ :find $montharray $monthtxt ] )
:for nodays from=0 to=$months do={
:set days ( $days + [ :pick $monthdays $nodays ] )
}
:set days ($days + $year * 365)
:if ( ($days + $offset) < $today ) do={
:local name [/ip hotspot user get $i name]
:log info “HOTSPOT EXPIRE SCRIPT: Setting Profile=ERROR to Hotspot user $name first logged in $date”
/ip hotspot user set profile=ERROR [/ip hotspot user find comment=“$date”]
}
}
}
}

\

Now it works

EXPIRE USER

{
:global offset
:global today
:global getprof
{
:local date [ /system clock get date ]
:local montharray ( “jan”,“feb”,“mar”,“apr”,“may”,“jun”,“jul”,“aug”,“sep”,“oct”,“nov”,“dec” )
:local monthdays ( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 )
:local days [ :pick $date 4 6 ]
:local monthtxt [ :pick $date 0 3 ]
:local year [ :pick $date 7 11 ]
:local months ([ :find $montharray $monthtxt] )
:for nodays from=0 to=[:tonum $months] do={
:set days ( $days + [ :pick $monthdays $nodays ] )
}
:set days ($days + $year * 365)
:set today $days
}

:foreach i in [ /ip hotspot user find where (comment~“jan” || comment~“feb” || comment~“mar” || comment~“apr”
|| comment~“may” || comment~“jun” || comment~“jul” || comment~“aug” || comment~“sep” || comment~“oct”
|| comment~“nov” || comment~“dec” ) ] do={
:if ([/ip hotspot user get $i comment ] != “” ) do={
:local date [/ip hotspot user get $i comment ]
:local montharray ( “jan”,“feb”,“mar”,“apr”,“may”,“jun”,“jul”,“aug”,“sep”,“oct”,“nov”,“dec” )
:local monthdays ( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 )
:local days [ :pick $date 4 6 ]
:local monthtxt [ :pick $date 0 3 ]
:local year [ :pick $date 7 11 ]
:local months ( [ :find $montharray $monthtxt ] )
:for nodays from=0 to=[:tonum $months] do={
:set days ( $days + [ :pick $monthdays $nodays ] )
:set getprof [/ip hotspot user get $i profile ]
:if (“$getprof” = “10”) do={
:set offset 2
} else={
:if (“$getprof” = “30”) do={
:set offset 7
} else={
:if (“$getprof” = “60”) do={
:set offset 14
} else={
:if (“$getprof” = “100”) do={
:set offset 21
} else={
:if (“$getprof” = “110”) do={
:set offset 31
}}}}}}}
:set days ($days + $year * 365)
:if ( ($days + $offset) < $today ) do={
:local name [/ip hotspot user get $i name]
:log error “HOTSPOT EXPIRE SCRIPT: Removing Hotspot user $name Profile → $getprof Offset is $offset Days first logged in $date”
[/ip hotspot user remove $i ]
}}}}