Posted: Tue Feb 07, 2023 6:06 Post subject: How do I disable/enable Virtual APs from the terminal?
(Crossposting this from the dd-wrt Reddit)
Greetings. I have a Netgear WNDR3700v4 router running build 51576. In addition to the primary 2.4GHz AP wlan0, it is configured with two virtual APs, wlan0.1 and wlan0.2.
What I would like to know is if there is a way via command line where I can temporarily disable and then re-enable wlan0.2 WITHOUT affecting either wlan0 or wlan0.1. "ifconfig wlan0.2 down" does disable it, but "ifconfig wlan0.2 up" does not properly re-enable it. It claims to come back on, but the status tab on the UI reports its channel as "unknown" and nothing can detect or connect to the SSID of that VAP.
If you must know why I am wanting to do this...it's because wlan0.2 is dedicated solely to "smart" devices in my home, and some of the smart devices I have (especially thermostats) have an unfixed firmware bug where they will randomly lose connection to their C&C servers yet still claim to be connected to the internet, and I've noticed that turning the wifi off then back on (or just rebooting the router) will fix it. So, I'm wanting to set up a script on the router that automatically runs every 24 hours or so that will disable ONLY wlan0.2 for 30 seconds, then re-enable it, without affecting connectivity to wlan0 or wlan0.1 and without having to reboot the router.
Any help would be appreciated.
UPDATE TO ADD: If disabling/re-enabling wlan0.2 isn't possible, then perhaps any other scriptable method of briefly "kicking" the offending devices off of wlan0.2 and forcing them to reconnect, i.e. by temporarily changing the SSID or key long enough for them to timeout and disconnect, then changing the settings back so the devices can reconnect. This would be acceptable too, provided it's a method that does not affect wlan0 or wlan0.1 nor require rebooting the router.
I'm beginning to get the feeling that I'm barking up a non-existent tree with this request, considering this is the only post within the past 2+ weeks to get zero responses, and similar questions from other users I found via Google returned no solutions as well...
I suppose the easiest thing to do at this point would be to get a second cheap router to use solely as an IoT access point, and just program it to reboot on a regular schedule. I'd like to avoid the extra space and power utilization though. Genuinely surprised that there is seemingly no way to control VAPs from the command line though.
Just throwing it out there that a year later I'm looking to solve this same problem and have hit the same dead ends.
Code:
ifconfig wlan0.1 up; service lan restart
... will start it and shows channels in use again, so I can reconnect, but still no internet connection.
I thought it might be DHCP related because there was no IP assigned, but I set that to static and still no luck.
I have a feeling there's something that will work, so hoping this bump will get the right eyes on it.
Edit: Unrelated, but wild that this is my first post on here. I've been using DD-WRT since shortly after it was released on a WRT54GS. Love this firmware.