Community discussions

MikroTik App
 
christianahiauzu
just joined
Topic Author
Posts: 4
Joined: Tue Jan 06, 2009 2:32 pm

Dially uptime limit for registered users

Tue Jan 06, 2009 6:42 pm

Hello,
I need assistance from any one who has an idea. I need to restrict the number of hours a user should be up and browsing per day. ie, if a user is to be allowed access for say, one month, i need to be able to restrict his/her uptime to say, 2hrs per day for the one month. Once this uptime limit is reached, the hotspot should log the user out, and allow the user access again only on the next day.

please hw do i do this...? Am quite new to mikrotik...
 
User avatar
sergejs
MikroTik Support
MikroTik Support
Posts: 6694
Joined: Thu Mar 31, 2005 3:33 pm
Location: Riga, Latvia
Contact:

Re: Dially uptime limit for registered users

Wed Jan 07, 2009 11:04 am

Here you can read about User Manager limitations options,
http://wiki.mikrotik.com/wiki/User_Manager/Limiting

It is easy to setup 2H of Internet access per day, however to make 2H of Internet access per day within a month, you need to run script, which resets HotSpot users usage, when new day begings,
tool user-manager user reset-counters
 
Megateq
newbie
Posts: 38
Joined: Thu Jan 08, 2009 12:33 am
Location: Nigeria
Contact:

Re: Dially uptime limit for registered users

Thu Jan 08, 2009 12:44 am

Hi, pls l need more information on how to run script, which resets HotSpot users usage, when new day begings. If possible typical examples
 
gtrappmann
Frequent Visitor
Frequent Visitor
Posts: 67
Joined: Fri Nov 03, 2006 7:42 am
Location: germany
Contact:

Re: Dially uptime limit for registered users

Thu Jan 08, 2009 1:57 pm

hi

i have a problem with that ... reset-counters resets only "used" not "left" so the users get "credit time left" in hotspot login

what did i wrong ??

regards

gerd
 
User avatar
sergejs
MikroTik Support
MikroTik Support
Posts: 6694
Joined: Thu Mar 31, 2005 3:33 pm
Location: Riga, Latvia
Contact:

Re: Dially uptime limit for registered users

Thu Jan 15, 2009 4:01 pm

tool user-manager user reset-counters
This command would work, if user already reached uptime limit and it is disconnected from the HotSpot.
Otherwise it will not work correctly.
RADIUS incoming message support is required for User Manager to work only with user reset-configuration, currently you may additionally clear all information about the users in
/ip hotspot active table
and reset counters in
/ip hotspot user
menus.
 
gtrappmann
Frequent Visitor
Frequent Visitor
Posts: 67
Joined: Fri Nov 03, 2006 7:42 am
Location: germany
Contact:

Re: Dially uptime limit for registered users

Thu Jan 15, 2009 6:44 pm

thanks for the reply......

but you cannot reset users you created with usermanger in /ip hotspot users ...
you have to reset them in /tool userman users....

we work with usermanager and hotspot .... we create users in usermanager (not in hotspot) ...
uptime-limit is reached.... user is diconnected ... active table is empty ..

/tool userman user reset-counter free1

resets only "used" .. and not "left" .... left=0 ... so after this, user gets "uptime-limit reached"
when he tries to login next time
 
christianahiauzu
just joined
Topic Author
Posts: 4
Joined: Tue Jan 06, 2009 2:32 pm

Re: Dially uptime limit for registered users

Thu Jan 22, 2009 7:04 pm

Thanks for all your comments regarding my problem. i have tried out some of your suggestions, but dont seem to be able to solve the problem. Infact the script has refused to run on the router. I have not been the one managing the routing for long, i just took over from a colleage who is not available to help. Can i get any other suggestion, most especially as i cant run the script. ie nothing seem to have happen even after the script is run.
 
User avatar
sergejs
MikroTik Support
MikroTik Support
Posts: 6694
Joined: Thu Mar 31, 2005 3:33 pm
Location: Riga, Latvia
Contact:

Re: Dially uptime limit for registered users

Mon Jan 26, 2009 4:22 pm

Please, post the script which is not working for you.
 
christianahiauzu
just joined
Topic Author
Posts: 4
Joined: Tue Jan 06, 2009 2:32 pm

Re: Dially uptime limit for registered users

Mon Jan 26, 2009 5:37 pm

i have run the following script, but it doesnt seem to create any effect
"tool user-manager user reset-counters"
 
User avatar
JP_Wireless
Member Candidate
Member Candidate
Posts: 276
Joined: Thu Dec 13, 2007 4:31 pm
Location: Lagos Nigeria
Contact:

Re: Dially uptime limit for registered users

Thu Jan 29, 2009 8:27 pm

Is the reset intended for all users or a particular user? because i doubt if all your customer require the same access as described. If it is for a particular user, then i think the script need to be specific.
 
gtrappmann
Frequent Visitor
Frequent Visitor
Posts: 67
Joined: Fri Nov 03, 2006 7:42 am
Location: germany
Contact:

Re: Dially uptime limit for registered users

Wed Feb 04, 2009 6:50 pm

your script is right if you want to reset uptime and traffic counters. it does not reset the "left" time. the "left" time stays on "0" .... so the user cannot connect once more. it seems that nobody nows for what this "reset" really is....
sorry, i have the same problem with this, but nobody should have an answer.

regards

gerd
 
christianahiauzu
just joined
Topic Author
Posts: 4
Joined: Tue Jan 06, 2009 2:32 pm

Re: Daily uptime limit for registered users

Fri Feb 06, 2009 7:25 pm

Well, a solution was given to solve my major problem. That solution is to enter the daily limits in the uptime limit column. But the problem, as i understood, was that once this limit is reached, that user cant have access anymore. To solve this problem, one has to reset the total uptime to zero everyday, so that it starts from zero afresh on that day, thus allowing the user access again. This reset can be done one by one for each user, but it can be automated for all users using a script. So, the script is actually meant to reset the total uptime every day. When i ran the suggested script on my own routerOS, nothing happened. ie,nothing was reset to zero. Thus, my problem right now is how i can make this script work....ie reset the total uptime to zero every day. My problem is not the left time, but the total uptime please. let the left time remain where it was.......i really need a solution please...
 
User avatar
sergejs
MikroTik Support
MikroTik Support
Posts: 6694
Joined: Thu Mar 31, 2005 3:33 pm
Location: Riga, Latvia
Contact:

Re: Dially uptime limit for registered users

Fri Feb 13, 2009 3:26 pm

reset-counters [find]
or reset-counters [find comment=1day]
to reset users with comment=1day.
 
gtrappmann
Frequent Visitor
Frequent Visitor
Posts: 67
Joined: Fri Nov 03, 2006 7:42 am
Location: germany
Contact:

Re: Dially uptime limit for registered users

Sat Feb 14, 2009 7:55 pm

this is a script for adding users with credit=free (its the name of the credit with 40m free time; price=0)

/tool user-manager user
add disabled=no name=para1 random-pass=yes add-credit=free subscriber=admin
add disabled=no name=para2 random-pass=yes add-credit=free subscriber=admin

and this is my script for adding free time for user who uses the free time ..

:foreach i in=[/tool user user find credit-price=0 and credit-left=0] do={:log info ("null nummer :" .[/tool user user get $i username]);/tool user user set $i add-credit=free;}

i had to do this because i wanted credits with count-down the time after first login.... "one way ticket"

in your case i think "trial" users in "hotspot" is the solution because you don´t have to do anything.... only have to place a "trial" button on the login page.
 
Alixboy
just joined
Posts: 4
Joined: Mon May 13, 2013 1:52 pm

Re: Dially uptime limit for registered users

Mon May 13, 2013 11:34 pm

The best way is to use the following script and scheduler to reset your users uptime and also left time,which means after running the script, even if your user's uptime limit has reached,it resets and that user can connect again.

I have some users which are allowed to use the internet for 45 minutes per day for 1 year. I created a 45min-named profile and assigned a limitation in which I put an uptime limit = 45m(45 minutes)

then write these two commands in New Terminal:

/ system script

add name="rst-PPPoE-cnt" source="/tool user-manager user reset-counters number=1,2,5,6" policy=ftp,reboot,read,write,policy,test,winbox,password


note: the number 1,2,5,6 are the number of users which you want to reset the counters for.
in /tool user-manager user> when you type "print" you can see the numbers assigned to users



then:

/ system scheduler
add name="rst-PPPoE-user-cnt" on-event=rst-PPPoE-cnt start-date=may/13/2013 start-time=00:00:01 interval=1d

it works perfectly!!!!
 
Alixboy
just joined
Posts: 4
Joined: Mon May 13, 2013 1:52 pm

Re: Dially uptime limit for registered users

Mon May 13, 2013 11:42 pm

Hello,
I need assistance from any one who has an idea. I need to restrict the number of hours a user should be up and browsing per day. ie, if a user is to be allowed access for say, one month, i need to be able to restrict his/her uptime to say, 2hrs per day for the one month. Once this uptime limit is reached, the hotspot should log the user out, and allow the user access again only on the next day.

please hw do i do this...? Am quite new to mikrotik...


The best way is to use the following script and scheduler to reset your users uptime and also left time,which means after running the script, even if your user's uptime limit has reached,it resets and that user can connect again.

I have some users which are allowed to use the internet for 45 minutes per day for 1 year. I created a 45min-named profile and assigned a limitation in which I put an uptime limit = 45m(45 minutes)

then write these two commands in New Terminal:

/ system script

add name="rst-PPPoE-cnt" source="/tool user-manager user reset-counters number=1,2,5,6" policy=ftp,reboot,read,write,policy,test,winbox,password


note: the number 1,2,5,6 are the number of users which you want to reset the counters for.
in /tool user-manager user> when you type "print" you can see the numbers assigned to users



then:

/ system scheduler
add name="rst-PPPoE-user-cnt" on-event=rst-PPPoE-cnt start-date=may/13/2013 start-time=00:00:01 interval=1d

it works perfectly!!!! :) :) :)
 
superman54f
just joined
Posts: 1
Joined: Sun Jul 26, 2015 6:21 pm

Re: Dially uptime limit for registered users

Fri Nov 16, 2018 3:41 am

Any one knows why uptime time is higher than limit uptime and multiple can login to 1 voucher?
example limit time each voucher is set to 1 hour and the uptime was 3hours
and i already removed the shared users in the user profiles.

Who is online

Users browsing this forum: No registered users and 12 guests