Automatically disable guest WiFi on boot possible (or similar)

Hello all,

is there a function that disables guest WiFi automatically when a GL.Inet router is booting? I would like to provide guest WiFi sometimes but tend to forget to disable it after it is not needed anymore so the people having the password could use it when I do not want it.

Try adding this to /etc/rc.local above exit 0:

uci set wireless.guest5g.disabled='1'
uci set wireless.guest2g.disabled='1'
uci commit wireless
/etc/init.d/network restart

Then use the GL GUI to turn them back on or just use disabled='0' in the same sequence.

uci show wireless | grep 'guest' will get you the full details.

Yeah, that's a better idea.

@mbg

/etc/init.d/network boots at 20. This will then disable the guest WLAN interfaces & restart the network at 90 so expect a couple of extra seconds of delay for a complete boot:

  • chmod +x /etc/init.d/wlan-guest
  • /etc/init.d/wlan-guest {enable, disable} to dis/enable on boot
  • /etc/init.d/wlan-guest {stop, start} or service wlan-guest {stop, start} to manually control
#!/bin/sh /etc/rc.common
# shellcheck shell=sh

START=90

commit(){
	uci commit wireless
	/etc/init.d/network restart
}

disable_wlan_guest(){
	uci set wireless.guest5g.disabled='1'
	uci set wireless.guest2g.disabled='1'
	commit
}

enable_wlan_guest(){
	uci set wireless.guest5g.disabled='0'
	uci set wireless.guest2g.disabled='0'
	commit
}

boot(){
	stop "${@}"
}

start(){
	enable_wlan_guest
}

stop(){
	disable_wlan_guest
}

Untested but should work.

tags: disable wlan, disable guest, disable wifi, disable guest wifi, disable guest wi-fi, disable guest wlan, disable wlan on boot