What's new

Time-of-Day limits on Guest access

  • 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!

The easiest way I know how to do this, which is not very flexible, is to setup Parental Controls for each device that'll use the guest network...
 
Is there some way to put time-of-day restrictions on guest access, such as permitting it only from 9am to 5pm?

Create two scripts:
guest_wifi_start.sh
Code:
#!/bin/sh

####################################################################################
#                                                                                  #
# Start / Stop Guest WIFI                                                          #
# L. de Bles, 2014                                                                 #
#                                                                                  #
# Called via init-start                                                            #
#                                                                                  #
# 2.4 Ghz Radio                                                                    #
# wl0.1 ---> Guest Network 1                                                       #
# wl0.2 ---> Guest Network 2                                                       #
# wl0.3 ---> Guest Network 3                                                       #
#                                                                                  #
# 5 Ghz Radio                                                                      #
# wl1.1 ---> Guest Network 1                                                       #
# wl1.2 ---> Guest Network 2                                                       #
# wl1.3 ---> Guest Network 3                                                       #
#                                                                                  #
####################################################################################

# start: enabled=1
# stop: enabled=0

   nvram set wl0.1_bss_enabled=1
   service restart_wireless

and

guest_wifi_stop.sh
Code:
#!/bin/sh

####################################################################################
#                                                                                  #
# Start / Stop Guest WIFI                                                          #
# L. de Bles, 2014                                                                 #
#                                                                                  #
# Called via init-start                                                            #
#                                                                                  #
# 2.4 Ghz Radio                                                                    #
# wl0.1 ---> Guest Network 1                                                       #
# wl0.2 ---> Guest Network 2                                                       #
# wl0.3 ---> Guest Network 3                                                       #
#                                                                                  #
# 5 Ghz Radio                                                                      #
# wl1.1 ---> Guest Network 1                                                       #
# wl1.2 ---> Guest Network 2                                                       #
# wl1.3 ---> Guest Network 3                                                       #
#                                                                                  #
####################################################################################

# start: enabled=1
# stop: enabled=0

   nvram set wl0.1_bss_enabled=0
   service restart_wireless

Example is for wl0.1 (Guest Network 1 2,4Ghz)

Create cronjobs with help of init-start script

init-start

Code:
#!/bin/sh


# L. de Bles, 2014
#
# * * * * *  command to execute
# - - - - -
# | | | | |
# | | | | |
# | | | | +----- day of week (0 - 7) (0 to 6 are Sunday to Saturday, or use names; 7 is Sunday,
# | | | +------- month (1 - 12)
# | | +--------- day of month (1 - 31)
# | +----------- hour (0 - 23)
# +------------- min (0 - 59)
#
# --------------------------------------------------------------------------------------------------

cru a Start-Guest-WIFI "00 09 * * * /jffs/scripts/guest_wifi_start.sh"
cru a Stop-Guest-WIFI "00 17 * * * /jffs/scripts/guest_wifi_stop.sh"

Place all (three) scripts in /jffs/scripts.
Don't forget to chmod a+rx /jffs/scripts/*

After rebooting the router guest wifi starts and stops.
 
Last edited:

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

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