Community discussions

MikroTik App
 
in4ni
Member Candidate
Member Candidate
Topic Author
Posts: 191
Joined: Thu Dec 09, 2004 4:22 am
Location: Jax, Fl USA

Create Schedule for WiFi

Wed Jun 17, 2009 4:45 am

How can i create a schedule to disable Wifi Access at 8:00pm and enable Access at 6:00am?

What i would like to is shutdown the Wifi Vlan interface on my router. How would i use the system scheduler to do this?



Thank you
 
User avatar
Eskimo
newbie
Posts: 47
Joined: Thu Mar 22, 2007 9:57 am
Location: Oklahoma, USA
Contact:

Re: Create Schedule for WiFi

Thu Jun 18, 2009 1:19 am

 
in4ni
Member Candidate
Member Candidate
Topic Author
Posts: 191
Joined: Thu Dec 09, 2004 4:22 am
Location: Jax, Fl USA

Re: Create Schedule for WiFi

Thu Jun 18, 2009 3:33 am

Im looking for a script example
 
csickles
Forum Guru
Forum Guru
Posts: 1255
Joined: Fri May 28, 2004 8:46 pm
Location: Phoenix, AZ
Contact:

Re: Create Schedule for WiFi

Thu Jun 18, 2009 8:13 pm

Do you wish to turn the radio off?
Or do you want to redirrect to a "we are closed" page?

Buth are doable....
 
in4ni
Member Candidate
Member Candidate
Topic Author
Posts: 191
Joined: Thu Dec 09, 2004 4:22 am
Location: Jax, Fl USA

Re: Create Schedule for WiFi

Thu Jun 18, 2009 9:39 pm

all i want to do is disable the wifi vlan inteface on the router


Thank you
 
csickles
Forum Guru
Forum Guru
Posts: 1255
Joined: Fri May 28, 2004 8:46 pm
Location: Phoenix, AZ
Contact:

Re: Create Schedule for WiFi

Sat Jun 20, 2009 12:01 am

Create two schedualed Jobs.

1) runs a script called "open" (or something like it). at 08:00
Script "Open" = interface wireless enable wlan1 (Where wlan1 = name of wireless interface)

2) runs a script called "Closed" (or something like it). at 16:00
Script "Closed" = interface wireless disable wlan1 (Where wlan1 = name of wireless interface)


This will turn off the interface at 16:00 and turn it back on at 08:00 (Local Router Time)..
 
in4ni
Member Candidate
Member Candidate
Topic Author
Posts: 191
Joined: Thu Dec 09, 2004 4:22 am
Location: Jax, Fl USA

Re: Create Schedule for WiFi

Sat Jun 20, 2009 1:56 am

Im looking for the proper script code
 
csickles
Forum Guru
Forum Guru
Posts: 1255
Joined: Fri May 28, 2004 8:46 pm
Location: Phoenix, AZ
Contact:

Re: Create Schedule for WiFi

Sat Jun 20, 2009 5:46 am

interface wireless disable wlan1
This will work.
 
RK
Long time Member
Long time Member
Posts: 565
Joined: Tue Nov 21, 2006 11:22 am
Location: Winnipeg, Canada and Central America

Re: Create Schedule for WiFi

Sat Jun 20, 2009 7:27 am

Im looking for the proper script code
csickles has been very helpful and gave you almost everything. You just need to add 5 minutes of thinking.

If you are not willing to put in the effort to help yourself, you should pay someone to do it for you.
 
in4ni
Member Candidate
Member Candidate
Topic Author
Posts: 191
Joined: Thu Dec 09, 2004 4:22 am
Location: Jax, Fl USA

Re: Create Schedule for WiFi

Sat Jun 20, 2009 2:01 pm

I have tried to create the scrips to no avail, thats why I posted in the forum.

Evidently creating the script isnt that easy or someone probably would have posted the code.
 
csickles
Forum Guru
Forum Guru
Posts: 1255
Joined: Fri May 28, 2004 8:46 pm
Location: Phoenix, AZ
Contact:

Re: Create Schedule for WiFi

Sat Jun 20, 2009 5:58 pm

OK..

What is the name of the interface (Wireless) that you want to cycle off and on?

I will create the scrips (In CLI format and drop them here)..
 
in4ni
Member Candidate
Member Candidate
Topic Author
Posts: 191
Joined: Thu Dec 09, 2004 4:22 am
Location: Jax, Fl USA

Re: Create Schedule for WiFi

Sat Jun 20, 2009 6:47 pm

Thank you

The interface name is "vlan-hotspot"


Thank you very very much


have a great weekend
 
csickles
Forum Guru
Forum Guru
Posts: 1255
Joined: Fri May 28, 2004 8:46 pm
Location: Phoenix, AZ
Contact:

Re: Create Schedule for WiFi

Sat Jun 20, 2009 9:19 pm

CLI "code" to create the scripts.

NOTE: change the name of "wlan2" to match the PHYSICAL interface you want to turn off and on...

/system script
add name=EnableWLAN policy=ftp,reboot,read,write,policy,test,winbox,password,sniff source="interface wireless enable wlan2"

add name=DisableWLAN policy=ftp,reboot,read,write,policy,test,winbox,password,sniff source="interface wireless disable wlan2"

After you paste the lines into a terminal session, go to system/scripts and verify the scripts created correctly.

You can test run the scripts by pressing run.. (remember, you will be turning off and on an interface when you test.)

Then goto system/schedual.
Next, create two scheduals. 1 will run the "EnableWLAN" the other will run the "DisableWLAN"
and be schedualed to run accordingly...

Make sure the local clock is set....
 
User avatar
semakka
Member Candidate
Member Candidate
Posts: 196
Joined: Mon Sep 11, 2006 10:59 am
Location: Moraira, Alicante, Spain
Contact:

Re: Create Schedule for WiFi

Sun Jun 21, 2009 2:03 pm

How can i create a schedule to disable Wifi Access at 8:00pm and enable Access at 6:00am?

What i would like to is shutdown the Wifi Vlan interface on my router. How would i use the system scheduler to do this?



Thank you
if you use static IP's for CPEs in your network I would create 2 block firewall filter rules based on address list and enable/disable those rules based on a scheduled enable/disable rules.

this will give you central management, easy to enable/disable clients to connect to internet.

I think is better to have your CPEs with a minimum, simple configuration and do it complicated in only one router/firewall which will have control over your network. manage your CPEs at a central level and not at CPE level. one rule can manage them all instead of creating rules for every single one.

the way you do it - at CPE level - imagine: CPE has time settings but if after the script disables the wlan interface, if CPE suffers a power cut then time settings will be the default ones, which will make CPE not enable the wlan interface at wanted hour.

do you concur? probably the setup I described is not the one you have. :)

Steven
 
in4ni
Member Candidate
Member Candidate
Topic Author
Posts: 191
Joined: Thu Dec 09, 2004 4:22 am
Location: Jax, Fl USA

Re: Create Schedule for WiFi

Tue Jun 23, 2009 10:42 pm

Thank you Craig, that was the answer i was looking for



Have a great day
 
miczx
just joined
Posts: 3
Joined: Tue Sep 08, 2015 11:01 pm

Re: Create Schedule for WiFi

Tue Sep 08, 2015 11:09 pm

I found all necessary steps here: http://mlapshin.com/index.php/2015/09/0 ... -dads-job/

How to create scripts
  • Open System -> Scripts window
    Press Add button and the script editor window will open
    Type a script name like DisableWLAN
    Select policies required by the script or check all of them
    Type script into the source text area: interface wireless disable wlan1
    Make sure you are using the proper name of the wireless interface. It could be found in the Interfaces section.
    Next you can try to test the script with “Run Script” button
    Save the script with “OK” button
    Create a similar EnableWLAN script.
How to schedule scripts
  • Open System -> Scheduler window
    Press Add button to open the Scheduler window
    Type some meaningful name for the scheduled task like DisableWLAN
    Type the name of your script into the On Event text area like DisableWLAN
    Select the start date, start time (hh:mm:ss format) and the interval for repeating the action like 1d 00:00:00 (it means one day and no hours, minutes and secs)
    Select required policies or check them all
    Save the schedule with “OK” button
    Repeat the same to schedule the enabling script
 
orelcho
just joined
Posts: 15
Joined: Wed Nov 12, 2014 3:13 pm

Re: Create Schedule for WiFi

Sat Nov 14, 2015 11:13 pm

I created a schedule for starting and stopping WiFi. But if there is no power supply when the wifi have to be enabled, the wifi will be enabled the next day :shock: . Do you have some suggestion to fix this situation? May be enable wifi every time when the router is starting?

Who is online

Users browsing this forum: No registered users and 6 guests