What's new

Switching Guest network on/off wifi with SSH command

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

Freakandel

New Around Here
Hi, I would like to know if it is possible to switch on/off the WiFi Guest network (2.4 and 5 Ghz) with a SSH command or script. I want to achive an easy way (wife proof ;-)) to get control over the Guest network in combination with Domoticz and a dVent, LUA or other script. Also, if applicable, more usefull settings that can be controlled, or read by Domoticz virtual switches.
Any input would be very appreciated!
 
yes can easily be done with SSH commands.

e.g. turn on 5GHz Guest 2 (off =0 or 2GHz wl0.)
nvram set wl1.2_radio=1
 
You have to follow that with "service restart_wireless" to apply the change.
I've tried the command you stated manually with Putty, followed by the service restart command, but when I check the routers' webportal the Guest network is not turned on. Also with my mobile phone O can not see the Guest (preconfigured) network. Any suggestions?
 
If I check the setting with nvram get wl0.1_radio I can see that the setting was updated succesfully, but after a service restart I don't see the Guest network turned on or off.

PS. I want to turn on the 2.4 Ghz ID 1 network, so I have interpreted your command as wl0.1
 
PS. I want to turn on the 2.4 Ghz ID 1 network, so I have interpreted your command as wl0.1
correct
You should see Guest-SSID coming/going after service restart_wireless on your mobile.
Or connect your mobile using this guest SSID, delete all other SSID on your mobile for the test.
After turning off your mobile must loose connection (mobile data disabled).
 
correct
You should see Guest-SSID coming/going after service restart_wireless on your mobile.
Or connect your mobile using this guest SSID, delete all other SSID on your mobile for the test.
After turning off your mobile must loose connection (mobile data disabled).

maarten@RT-AC88U-2E68:/tmp/home/root# nvram set wl0.1_radio=1
maarten@RT-AC88U-2E68:/tmp/home/root# service restart_wireless

Done.
maarten@RT-AC88U-2E68:/tmp/home/root#


After this, I waited about 1 minute but there is no Guest network activated. Also in the webportal of the router I see no change:
upload_2020-1-2_21-28-23.png
 
Hi Grisu and ColinTaylor, the command 'nvram set wl0.1_bss_enabled=1 ' works! The network is switching on and off and I can follow its state with the webportal. Thanks both for your effort! Much appreciated.
 
Hi,
Sorry for resurrecting this old thread, but I was wondering if it would be possible to set the time remaining. When I switched it on with the following commands

Code:
nvram set wl0.1_radio=1
nvram set wl0.1_bss_enabled=1
service restart_wireless

It started with time remaining of < 1 minute. In reality, it's not actually switching it off after that time.

I'm on RT-AX86U with FW version 386.4

Thanks!
 
It started with time remaining of < 1 minute. In reality, it's not actually switching it off after that time.
I've just tried this and found the opposite.

If you want to reset the timeout period try this:
Code:
nvram set wl0.1_radio=1
nvram set wl0.1_bss_enabled=1
nvram set wl0.1_expire_tmp="$(nvram get wl0.1_expire)"
service restart_wireless
 
I've just tried this and found the opposite.

If you want to reset the timeout period try this:
Code:
nvram set wl0.1_radio=1
nvram set wl0.1_bss_enabled=1
nvram set wl0.1_expire_tmp="$(nvram get wl0.1_expire)"
service restart_wireless
Thanks, this worked great!
 
I've just tried this and found the opposite.

If you want to reset the timeout period try this:
Code:
nvram set wl0.1_radio=1
nvram set wl0.1_bss_enabled=1
nvram set wl0.1_expire_tmp="$(nvram get wl0.1_expire)"
service restart_wireless
I may have spoken too early. Activating the guest network with those commands seems to work, but it doesn't allow anyone to connect. It gets stuck on obtaining ip address. I had to manually disable and re-enable from the web ui to make it work properly. Any thoughts?
 
I may have spoken too early. Activating the guest network with those commands seems to work, but it doesn't allow anyone to connect. It gets stuck on obtaining ip address. I had to manually disable and re-enable from the web ui to make it work properly. Any thoughts?
Try using guest network slot #2.
 
Network slot #2 works perfectly, thanks!
Out of curiosity, what's the difference and why #1 didn't work?

Thanks a lot for your help!
Slot #1 creates it's own subnet and therefore has special routing rules. It was done that way so that the guest network can be propagated to AiMesh nodes. As such it has it's own "weird" behaviour that's not worth trying to predict, just use slots #2 or #3.
 
Slot #1 creates it's own subnet and therefore has special routing rules. It was done that way so that the guest network can be propagated to AiMesh nodes. As such it has it's own "weird" behaviour that's not worth trying to predict, just use slots #2 or #3.
Makes sense! But the fact that it works when manually enabled suggests that there are some more commands being executed when you press enable from the UI.

Anyway for my use case slot #2 works just great.

Thanks again!
 

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