Prevent disabling WIFI

Hello everyone - I have an oddball question I don't know if someone else has ran into in the past (but I hope/expect they have).

I have a device that shipped with a very old, slightly custom version of OpenWrt. I want to replace it to get rid of any additional things they might have added to it. One thing I have to be careful of though is WIF. This device does NOT have any ethernet ports - it's WIF only.

So two things I have to be absolutely sure I do correctly.

  1. Make sure the build enables WIF by default - I believe I found the answer to this... create uci rules in a ...files/etc/uci-defaults file.

  2. Is there a way to make it so that WIFI cannot be disabled?

#2 is my real question for this audience. Is there a way to remove the ability to disable WIFI? It seems somewhat odd, but on this device if you accidentally disable the WIF - my guess is you'll have to open it up and do a serial flash of some sort (I believe it might be able to be flashed via TFTP) but I would like to avoid making that an easy mistake.


I don't think so, network interfaces can always be set 'down' by root, even if you patched out the UCI and IW commands to do it.

You could work around it though by including 'up' commands in rc.local - so if you did lock yourself out a power cycle would turn them back on. Also, if the image is patched with wifi enabled a reset would re-enable it.

Note: devices without ethernet ports are not supported - does it at least have usb to connect a usb ethernet adapter (with the driver built into the image)? That would be a better solution.

Yes it does have USB - haven't done any checks to make sure it's not Power only, but that is a fantastic point! Assuming it would support a usb ethernet adapter - a backdoor would exist to recover from that mistake.

I do plan to setup the image to enable wifi by default - so while not an ideal solution for most - a reset would be another fix (just make a note to keep a config backup and that isn't to bad either).

Thank you for your input - fantastic information that makes me feel much safer before proceeding with my first build.


So many options...

  1. Create a fake init script and iterate over all radios and wireless interfaces and delete disabled '1' entries (check uci changes wireless before running uci commit to figure out if you need to restart wifi).
  2. Same script but call it from /etc/rc.local
  3. Create a crontab with this script to run ever 1/5/60 minutes.