What's new

Start / stop guest wifi ssh

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

lbradio

Regular Contributor
I was wondering: is it possible to start / stop a (already configured) guest wifi by SSH?

I would like to put this in a cron.
 
Kind of an ugly way. It will kill your wifi briefly. I have no idea if some clients can associate to a blank SSID, my android phone won't anyway.

Code:
# Bring down guest network
wl down
wl ssid --cfg=1  <-- make sure this is the guest network
wl ssid --cfg=1 ""   <--- blank out the ssid
wl up

# Bring up guest network
wl down
wl ssid --cfg=1 "OLD_SSID"
wl up
 
Last edited:
Kind of an ugly way. It will kill your wifi briefly. I have no idea if some clients can associate to a blank SSID, my android phone won't anyway.

Code:
# Bring down guest network
wl down
wl ssid --cfg=eth1  <-- make sure this is the guest network
wl ssid --cfg=eth1 ""   <--- blank out the ssid
wl up

# Bring up guest network
wl down
wl ssid --cfg=eth1 "OLD_SSID"
wl up

I have been playing with your solution, but it seems something is not right yet.

wl ssid --cfg=wl0.1 (wl0.1 seems to be the guest network) results in:

Code:
 ssid: could not parse "wl0.1" as an integer for the configuartion index
ssid    Set or get a configuration's SSID.
        wl ssid [-C num]|[--cfg=num] [<ssid>]
        If the configuration index 'num' is not given, configuraion #0 is assumed and
        setting will initiate an assoication attempt if in infrastructure mode,
        or join/creation of an IBSS if in IBSS mode,
        or creation of a BSS if in AP mode.

But I continued with your idea of changing SSID to "" <blank>.

After a while I've tried the following code:
Code:
wl down
nvram set wl0.1_ssid="test"
nvram commit
wl up

which actually does change ssid on the ASUS Guest Network page. However, it does not broadcast the new SSID yet. I think some services has to be stopped and started for activating. When I enable another guest network on the ASUS page, the changed SSID IS shown. So I need a trigger.

Any suggestions?
 
Sorry I messed up.

--cfg=1

not --cfg=eth1

OK, now it's working :)

For 2,4GHz it is:

Code:
wl down
wl ssid --cfg=1 ""
wl up

When disable Guest network and enable it back, old values re-appear, whitch is ok.

Two questions left:
1. what about 5GHz. Should it be as easy as change --cfg=1 to --cfg=2? (already tried that, doesn't work :) )

2. When I do want to change ssid permanently, nvram should bring the solution. But I need to activate the changes. Any ideas howto?
Code:
wl down
nvram set wl0.1_ssid="test"
nvram commit
wl up

Thanks.
 
1. 5ghz
wl -i eth2 ssid --cfg=1

2. Not sure. Reboot? :confused: You'd have to look at the source code to see how the guest page brings interfaces/ssid's up and down the correct way. This method is just the quick-n-dirty way.
 
1. 5ghz
wl -i eth2 ssid --cfg=1

2. Not sure. Reboot? :confused: You'd have to look at the source code to see how the guest page brings interfaces/ssid's up and down the correct way. This method is just the quick-n-dirty way.

Ok. Also 5Ghz is working. Thanks.

I assume this source code is not public available? :)
I know the command for restarting dnsmasq is service restart_dnsmasq. However, I couldn't find any other service names, f.i. wireless.
 
You can do a "service restart_wireless" but it will restart the whole wireless subsystem and its dependencies (such as networkmap).
 
You can do a "service restart_wireless" but it will restart the whole wireless subsystem and its dependencies (such as networkmap).

I've noticed that disable / enable guest network on the webpage also close down wifi for a few seconds, for me this is not a big issue.

Thanks for your answer, restart_wireless it is.
 

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