What's new

Feature request: schedule guest network

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

man_at_work

New Around Here
Hi Merlin,

First of all thanks for all the firmware, thumbs up. However I have a request below.

Is it possible to have scheduler to allow guest network on RTN-66U?
It's allowing the guest network to be allowed only certain timing, e.g. from 8pm - 12am everyday to limit and control the guest connection time.

Thanks,

PS: sorry, I'm not sure whether this is the correct sub forum for such request.
 
This should be possible and pretty easy through scripting. Perhaps someone else has already done this and will post you some instructions.
 
nvram settings for the three guest 2.4 networks start with:
wl0.1
wl0.2
wl0.3

nvram settings for the three guest 5.0 networks start with:
wl1.1
wl1.2
wl1.3

To start a guest network in SSH, the command is:
nvram set wl0.1_bss_enabled=1
To stop it, the command is:
nvram set wl0.1_bss_enabled=0

After changing the nvram settings, you need to restart wireless via command:
service restart_wireless

Now you need to get those start and stop commands in a script that will start and stop them when you want. Note that you can start/stop as many as you want, so you could start all of the 2.4 guest newtorks with the commands:
nvram set wl0.1_bss_enabled=1
nvram set wl0.2_bss_enabled=1
nvram set wl0.3_bss_enabled=1
service restart_wireless
 
Last edited by a moderator:
Hi Merlin,

First of all thanks for all the firmware, thumbs up. However I have a request below.

Is it possible to have scheduler to allow guest network on RTN-66U?
It's allowing the guest network to be allowed only certain timing, e.g. from 8pm - 12am everyday to limit and control the guest connection time.

Thanks,

PS: sorry, I'm not sure whether this is the correct sub forum for such request.

The commands to stop/start both the 2.4 and 5G Guest wireless instance #1 are given here by RMerlin:

http://forums.smallnetbuilder.com/showpost.php?p=66327&postcount=2


and if you follow the User script tutorial on RMerlins Wiki:

https://github.com/RMerl/asuswrt-merlin/wiki

you should be able to modify the cron based example script which schedules the LEDs ON/OFF

https://github.com/RMerl/asuswrt-merlin/wiki/Scheduled-LED-control

to enable/disable the appropriate Guest Wireless according to your desired schedule.

Regards,
 
Hi guys!

I have one question (because I have no clue about writing a decent script).

So What I need is to create a script that turns off my Guest Network at 8pm and then Turn it on at 23:50 that runs every Monday, Tuesday and Thursday...

So I digged a little bit and found a script in "init-start" that I worked fine for me to make a scheduled reboot...

So I has the idea to add the script to the same "init-start" file.

Is this script correct? Using one gru per line/command is ok?

#!/bin/sh

cru a nvram set wl0.1_bss_enabled=1 "50 23 * * 1,2,4"
cru a nvram commit "50 23 * * 1,2,4"
cru a service restart_wireless "50 23 * * 1,2,4"
cru a nvram set wl0.1_bss_enabled=0 "0 20 * * 1,2,4"
cru a nvram commit "0 20 * * 1,2,4"
cru a service restart_wireless "0 20 * * 1,2,4"
cru a ScheduledReboot "0 7 * * * /sbin/reboot"

Tks a lot guys
 
Hi guys!

I have one question (because I have no clue about writing a decent script).

So What I need is to create a script that turns off my Guest Network at 8pm and then Turn it on at 23:50 that runs every Monday, Tuesday and Thursday...

So I digged a little bit and found a script in "init-start" that I worked fine for me to make a scheduled reboot...

So I has the idea to add the script to the same "init-start" file.

Is this script correct? Using one gru per line/command is ok?

#!/bin/sh

cru a nvram set wl0.1_bss_enabled=1 "50 23 * * 1,2,4"
cru a nvram commit "50 23 * * 1,2,4"
cru a service restart_wireless "50 23 * * 1,2,4"
cru a nvram set wl0.1_bss_enabled=0 "0 20 * * 1,2,4"
cru a nvram commit "0 20 * * 1,2,4"
cru a service restart_wireless "0 20 * * 1,2,4"
cru a ScheduledReboot "0 7 * * * /sbin/reboot"

Tks a lot guys

Here's another way. The "&&" means to continue if successful. In other words, if a command were to fail, it would not run the next command.

/jffs/scripts/services-start
Code:
cru a GuestsAllowed "50 23 * * 1,2,4 (nvram set wl0.1_bss_enabled=1 && nvram commit && service restart_wireless)"
cru a GuestsDenied "0 20 * * 1,2,4 (nvram set wl0.1_bss_enabled=0 && nvram commit && service restart_wireless)"
cru a ScheduledReboot "0 7 * * * /sbin/reboot"
 
Here's another way. The "&&" means to continue if successful. In other words, if a command were to fail, it would not run the next command.

/jffs/scripts/services-start
Code:
cru a GuestsAllowed "50 23 * * 1,2,4 (nvram set wl0.1_bss_enabled=1 && nvram commit && service restart_wireless)"
cru a GuestsDenied "0 20 * * 1,2,4 (nvram set wl0.1_bss_enabled=0 && nvram commit && service restart_wireless)"
cru a ScheduledReboot "0 7 * * * /sbin/reboot"

Thanks a lot! I'll try it and tomorrow let you know if it's working

This Forum Rocks
 
Tks! The script worked perfectly...

I'll let my script code that include multiple days and a daily restart

I used the init-start file

#!/bin/sh
cru a GuestsAllowed "59 23 * * 1,2,3,4 (nvram set wl0.1_bss_enabled=1 && nvram commit && service restart_wireless)"
cru a GuestsDenied "30 19 * * 1,2,3 (nvram set wl0.1_bss_enabled=0 && nvram commit && service restart_wireless)"
cru a GuestsDenied "30 20 * * 4 (nvram set wl0.1_bss_enabled=0 && nvram commit && service restart_wireless)"
cru a ScheduledReboot "0 7 * * * /sbin/reboot"
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top