Community discussions

MikroTik App
 
erlt
just joined
Topic Author
Posts: 9
Joined: Sun Oct 12, 2014 3:51 pm

Block hotspot user timebased

Fri Nov 28, 2014 12:20 pm

Is there a way to block a hotspot user based on time? Like weekly from 2am to 10am every monday?
 
User avatar
aacable
Member
Member
Posts: 435
Joined: Wed Sep 17, 2008 11:58 am
Location: ISLAMIC Republic of PAKISTAN
Contact:

Re: Block hotspot user timebased

Mon Dec 01, 2014 7:15 am

You cannot do it with builtin hotspot or with user manager. You have to create a script and schedule it to disable the user account on Monday 2am and then another script which will enable the account on 10am. Something like following...


Script-1 to disable user test
Script-2 to disable user test
/system script
add name=script1 policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api source="/ip hotspot user disable test"
add name=script2 policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api source="/ip hotspot user enable test"
Now Schedule it like.
/system scheduler
add disabled=no interval=1w name=disable-test-user on-event="/ip hotspot user disable test\r\
    \n" policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api start-date=dec/01/2014 start-time=02:00:00
add disabled=no interval=1w name=enable-test-user on-event="/ip hotspot user enable test\r\
    \n" policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api start-date=dec/01/2014 start-time=10:00:00


Don't forget to change the Date according to your need. :shock:

HTH,
 
erlt
just joined
Topic Author
Posts: 9
Joined: Sun Oct 12, 2014 3:51 pm

Re: Block hotspot user timebased

Mon Jan 19, 2015 3:33 am

Thank you for that.

What if I want to suspend users authenticating through external radius on a particular period of a week? Like no internet access from 2 am to 10 am of Monday weekly?

Who is online

Users browsing this forum: Bing [Bot], pfturner, wangmauler and 20 guests