logo elektroda
logo elektroda
X
logo elektroda

Mikrotik - Is it possible to turn off wifi during certain hours of the night?

kukiz1986 10185 16
Best answers

How can I automatically disable my MikroTik Wi‑Fi interface at certain hours of the night, or turn off the router from 1 am to 5 am?

Yes—use RouterOS scripts together with the Scheduler to disable and re-enable the wireless interface at the desired times [#16710886][#16711514] Create one script with `/interface disable wlan1` and another with `/interface enable wlan1`, where `wlan1` is your Wi‑Fi interface name [#16711514] Then schedule the scripts for the night and morning hours; if you want them to repeat every day, set the interval to `1d 0:0:0` [#16770518] An interval of `0` means the task runs only once, not daily [#16748929]
Generated by the language model.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 16710839
    kukiz1986
    Level 27  
    Posts: 1840
    Help: 17
    Rate: 409
    Hello, is there any rule that allows you to disable the wifi card at certain times?
    Alternatively, when there is no such option, the whole mikrotika, say from 1 am to 5 am.
  • ADVERTISEMENT
  • Helpful post
    #2 16710886
    tplewa
    Level 39  
    Posts: 6727
    Help: 222
    Rate: 988
    you can do scripts to turn on / off the wireless interface and run from scheduller ...
  • ADVERTISEMENT
  • Helpful post
    #3 16711514
    m.jastrzebski
    Network and Internet specialist
    Posts: 5246
    Help: 679
    Rate: 863
    kukiz1986 wrote:
    Hello, is there any rule that allows you to disable the wifi card at certain times?
    Alternatively, when there is no such option, the whole mikrotika, say from 1 am to 5 am.

    As CI is written, the script and scheduler. But what the secret includes excluding the commands that you can issue in the moment of your finger. Test in the terminal if it works and how it works and save as a script.

    So 1 script contain:
    / interface disable wlan1

    Second script:
    / interface enable wlan1

    wlan1 is the name of your WiFi interface on mikrotik. It doesn't have to be exactly what your name is.

    The rest is the scheduler when it's going to bang.
  • #4 16711589
    kukiz1986
    Level 27  
    Posts: 1840
    Help: 17
    Rate: 409
    Scheduler works. Thanks to everyone for your help.
  • #5 16748907
    kukiz1986
    Level 27  
    Posts: 1840
    Help: 17
    Rate: 409
    I think something is wrong. It only works for me once. One day after adding. Nothing turns off for the next one.


    Mikrotik - Is it possible to turn off wifi during certain hours of the night?
  • ADVERTISEMENT
  • Helpful post
    #6 16748929
    Loker
    Level 39  
    Posts: 3368
    Help: 575
    Rate: 720
    Interval is set to 0 so it will only run once.
  • #7 16748947
    kukiz1986
    Level 27  
    Posts: 1840
    Help: 17
    Rate: 409
    Ok, correct. thx
  • #8 16770290
    kukiz1986
    Level 27  
    Posts: 1840
    Help: 17
    Rate: 409
    It still doesn't work for me. I do not know what's going on. Can someone take a look at the settings?

    Mikrotik - Is it possible to turn off wifi during certain hours of the night?
  • #9 16770418
    bogiebog
    Level 43  
    Posts: 24793
    Help: 2569
    Rate: 1528
    There he writes that intervał is 365 days, it should turn off once a year?
  • #10 16770506
    kukiz1986
    Level 27  
    Posts: 1840
    Help: 17
    Rate: 409
    when I was at 0, I was told it would only be done once. It added more. WHAT should I set? "1"?
  • Helpful post
    #11 16770518
    bogiebog
    Level 43  
    Posts: 24793
    Help: 2569
    Rate: 1528
    kukiz1986 wrote:
    WHAT should I set? "1"?

    how is it supposed to fuck every 1 day it
    1d 0: 0: 0

    Added after 2 [minutes]:

    kukiz1986 wrote:
    when I was at 0, I was told it would only be done once. It added more.

    And you were told well, but this forum is not just a roller coaster, _Y_ you must think too.

    Added after 1 [minutes]:

    Try to test yourself, on / off where interval = 0d 0: 10: 0
    maybe it's better not to, because you'll end up dying again.
  • Helpful post
    #12 16776186
    tplewa
    Level 39  
    Posts: 6727
    Help: 222
    Rate: 988
    @ kukiz1986

    Mikrotik has a great Wiki https://wiki.mikrotik.com/wiki/Main_Page and a good forum https://forum.mikrotik.com/ - how to deal with this equipment, it's nice to sit there for a while.

    I dealt with CIsco / Juniper equipment for more time in my life ... I bought MT first for my home and now I recommend it wherever inexpensive and good equipment is needed. I practically started with zero knowledge about RouterOS and thanks to both the forum and wiki, the first and not a trivial configuration (in commandline because I hate www or WinBOX) I did in a few days ... so I recommend that you even read the topics from time to time happens in the world of MT - a person involuntarily remembers many things (from the problems of others) :)
  • #13 16776246
    kukiz1986
    Level 27  
    Posts: 1840
    Help: 17
    Rate: 409
    Okay, I put it on 1 and it works :) In general, I know Mikrotik a bit, but this was my first time with the scheduler. Thank you for your help.
  • #14 16776280
    bogiebog
    Level 43  
    Posts: 24793
    Help: 2569
    Rate: 1528
    kukiz1986 wrote:
    but this was my first time dealing with the scheduler.

    And the big problem would it be to put some effort into solving your problem?
    Review the scheduler documentation, only 3 parameters to cover, which means each, perdyliony examples, for me you can catch a lazy and demanding attitude, "tell me what to do because I can't read what the manufacturer wrote in the documentation"
  • ADVERTISEMENT
  • #15 16776290
    kukiz1986
    Level 27  
    Posts: 1840
    Help: 17
    Rate: 409
    bogiebog wrote:
    capisz lazy and demanding attitude


    Serious allegations.

    But that's not about that. The problem was solved thanks to you. Subject exhausted.
  • #16 16776296
    bogiebog
    Level 43  
    Posts: 24793
    Help: 2569
    Rate: 1528
    kukiz1986 wrote:
    Serious allegations.

    After the Loker gave you the hint, you still haven't read the documentation (and did you read it?), You just typed what came to your mind without thinking and then yelling again on the forum "that it's not working again".

    This is not a "pay and require" forum
    Advice and tips are free but we require own contribution and effort from the author of the topic.

    Claiming or lazy attitudes will be 'blunted' in this forum.
  • #17 16776425
    tplewa
    Level 39  
    Posts: 6727
    Help: 222
    Rate: 988
    kukiz1986 wrote:
    Okay, I put it on 1 and it works :) In general, I know Mikrotik a bit, but this was my first time with the scheduler. Thank you for your help.


    That's why I recommend reading forums, etc. :) You avoid problems with, for example, some errors that sometimes sneak into RouterOS and sometimes you can read about interesting solutions that people do - always some patent may come in handy ...

    Besides, playing with networks is still learning :) when a man does not develop and is not up to date, after a year he is 100 years behind blacks as they say :) Personally, I do not deal with networks anymore (well, now you can only earn money in a corporation, and I avoid it) - but I try not to get out of circulation, because life is different :)

Topic summary

✨ The discussion revolves around configuring a MikroTik router to disable its WiFi interface during specific hours, particularly from 1 AM to 5 AM. Users suggest utilizing scripts and the scheduler feature in RouterOS to automate this process. A sample script to disable the WiFi interface (e.g., wlan1) is provided, along with instructions on setting the scheduler to execute the script at the desired times. Some users encounter issues with the scheduler not functioning as expected, leading to discussions about setting the correct interval parameters. Ultimately, users confirm successful implementation after adjusting the settings.
Generated by the language model.

FAQ

TL;DR: You can auto‑disable and re‑enable MikroTik Wi‑Fi with the Scheduler; it has “only 3 parameters to cover.” Create two scripts and set a daily interval. [Elektroda, bogiebog, post #16776280]

Quick Facts

How do I schedule MikroTik Wi‑Fi to turn off at night?

Create two scripts: /interface disable wlan1 and /interface enable wlan1. Add two Scheduler entries: run OFF at 01:00 and ON at 05:00. Use a daily interval so it repeats. Test each command in Terminal first, then save as scripts. 1) Test disable/enable in Terminal. 2) Save as two scripts. 3) Schedule each with start time and interval=1d. [Elektroda, m.jastrzebski, post #16711514]

Why did my schedule run only once?

Because interval was set to 0. An interval of 0 executes the job a single time and never repeats after that day. Set a non‑zero interval to make it run again automatically. For nightly Wi‑Fi off/on, use a daily interval value. [Elektroda, Loker, post #16748929]

What interval should I use for a daily Wi‑Fi schedule?

Use interval=1d 0:0:0. That format runs the task once every day. Set one task to disable Wi‑Fi at your chosen time and another to re‑enable it later. This avoids one‑time execution and ensures consistent nightly behavior. [Elektroda, bogiebog, post #16770518]

How do I write the exact commands to toggle Wi‑Fi?

Use these RouterOS commands: /interface disable wlan1 to turn Wi‑Fi off, and /interface enable wlan1 to turn it on. Replace wlan1 if your wireless interface has a different name. Test each in Terminal before scheduling. “wlan1 is the name of your WiFi interface.” [Elektroda, m.jastrzebski, post #16711514]

My quiet hours are 1–5 AM. Do I need one or two scheduler entries?

Use two entries. Schedule the OFF script at 01:00 and the ON script at 05:00. Each entry should have interval=1d so it repeats every day. Keep the scripts separate for clarity and easier troubleshooting. [Elektroda, m.jastrzebski, post #16711514]

I set a huge interval by mistake. What happens?

If you set interval=365d, the task will run only once per year. Large intervals delay the next execution by that full period. Correct the interval to 1d for a daily schedule. Then the Wi‑Fi toggles will occur every night. [Elektroda, bogiebog, post #16770418]

What if it still doesn’t repeat nightly?

Verify that interval isn’t 0 and that you used the daily format 1d 0:0:0. Edit the schedule times if needed and ensure each job points to the correct script. Avoid testing with rapid intervals if you are unsure. [Elektroda, bogiebog, post #16770518]

How can I sanity‑check my setup before relying on it?

Run the disable/enable commands manually in Terminal to confirm they work, then save them as scripts. After scheduling, watch the log at the next trigger time to see execution. This catches naming mistakes like mis‑typed interface names. [Elektroda, m.jastrzebski, post #16711514]

Where can I find authoritative MikroTik docs and community help?

Use the official MikroTik Wiki and MikroTik Forum. Many practical examples and solutions are documented there. “I recommend reading forums… you avoid problems and find interesting solutions.” Staying current reduces setup mistakes. [Elektroda, tplewa, post #16776186]

Why do forum members insist on reading the documentation first?

Because common issues are explained clearly, with examples, and only three key scheduler parameters matter. “Only 3 parameters to cover,” so learning them saves time and avoids repeat errors. It also shows your own effort. [Elektroda, bogiebog, post #16776280]

Is there a quick example schedule for 1–5 AM every day?

Yes. Script A: /interface disable wlan1. Script B: /interface enable wlan1. Scheduler entry 1: start=01:00, interval=1d, on‑event=Script A. Entry 2: start=05:00, interval=1d, on‑event=Script B. This mirrors typical quiet‑hours requests. [Elektroda, m.jastrzebski, post #16711514]

Any edge cases I should avoid while testing?

Avoid setting very short test intervals if you’re unsure, such as every 10 minutes. Rapid toggling can confuse troubleshooting and lead to unintended behavior. Set a clear daily interval instead and validate gradually. [Elektroda, bogiebog, post #16770518]
Generated by the language model.
ADVERTISEMENT