Community discussions

MikroTik App
 
ASRCH
just joined
Topic Author
Posts: 10
Joined: Fri Sep 23, 2016 8:42 pm

how i can disable and then enable pppoe users automatic ?

Sat Aug 12, 2017 9:38 am

Hi everyone :

In our company there are about 60 Internet users. The head of the company said that some users will have Internet access at certain times. Please help me with script and Schedule.

Some users will connect to the Internet at 7 o'clock in the morning and disconnect at 5 o'clock in the afternoon and then connect to the Internet again tomorrow morning at 7 o'clock in the morning.

Because I'm not a professional, please explain it in plain language and step by step.
Thanks to the distinguished engineers.
 
ASRCH
just joined
Topic Author
Posts: 10
Joined: Fri Sep 23, 2016 8:42 pm

Re: how i can disable and then enable pppoe users automatic ?

Sun Aug 13, 2017 12:18 pm

Please help me .
 
User avatar
JohnTRIVOLTA
Member
Member
Posts: 395
Joined: Sun Dec 25, 2016 2:05 pm
Location: BG/Sofia

Re: how i can disable and then enable pppoe users automatic ?

Sun Aug 13, 2017 1:00 pm

Please help me .
This is my example:
/system scheduler
add name=EnableHSusers on-event="system script run enableHSusers" policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
    start-date=aug/13/2017 start-time=08:00:00
add name=DisableHSusers on-event=" system script run disableHSusers" policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
    start-date=aug/13/2017 start-time=17:00:00
/system script
add name=enableHSusers owner=admin policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=\
    "ip hotspot user enable user1,user2,user3"
add name=disableHSusers owner=admin policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=\
    "ip hotspot user disable user1,user2,user3"
Make two scripts for enable and disable of the HS users you want and after that make two schedules for enabling and disabling for necessary time !
 
ASRCH
just joined
Topic Author
Posts: 10
Joined: Fri Sep 23, 2016 8:42 pm

Re: how i can disable and then enable pppoe users automatic ?

Sun Aug 13, 2017 3:36 pm

Mercy John
But I do not have a HotSpot. My users use ppp\secret account and DHCP pool and profile .
Thanks for helping me.
 
User avatar
JohnTRIVOLTA
Member
Member
Posts: 395
Joined: Sun Dec 25, 2016 2:05 pm
Location: BG/Sofia

Re: how i can disable and then enable pppoe users automatic ?

Sun Aug 13, 2017 5:59 pm

Mercy John
But I do not have a HotSpot. My users use ppp\secret account and DHCP pool and profile .
Thanks for helping me.
Sorry, the setting is the same, just replace with " ppp secret disable user1,user2,user3" and t "ppp secret enable user1,user2,user3" scripts .Change the name of the schedule and the scripts of your choice or change HS with PPP only !
 
DeCr0pt
just joined
Posts: 12
Joined: Wed Aug 02, 2017 1:21 pm

Re: how i can disable and then enable pppoe users automatic ?

Sun Aug 13, 2017 6:29 pm

If you are want disable multiple ppp profiles just use array and make foreach example like this:
:global ppplimit [:toarray ppp1,ppp2,ppp4]
:foreach i in $ppplimit do {
/ppp secret disable $i
}
Add this to scheduler and run it on time what you want, if you want make "enable" script too, just copy a script and just type enable instead of disable
 
ASRCH
just joined
Topic Author
Posts: 10
Joined: Fri Sep 23, 2016 8:42 pm

Re: how i can disable and then enable pppoe users automatic ?

Wed Aug 16, 2017 1:12 pm

Thank you John and DeCr0pt
This will only be done for the same date as it was set. How should change every day of Date?

Who is online

Users browsing this forum: No registered users and 11 guests