/etc/config/wireless getting overwritten on reboot

I modified /etc/config/wireless but it is getting overwritten on reboot.

[brioja@Desktop knight]$ ssh root@ cat /etc/config/wireless
root@'s password: 

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'platform/soc/c000000.wifi'
        option band '5g'
        option htmode 'HE80'
        option country 'US'
        option disabled '0'
        option channel 'auto'
        option cell_density '0'
        option channels '36,40,44,48,149,153,157,161'

config wifi-device 'radio1'
        option type 'mac80211'
        option path 'platform/soc/c000000.wifi+1'
        option band '2g'
        option country 'US'
        option disabled '0'
        option channel 'auto'
        option htmode 'HE40'
        option cell_density '0'

config wifi-iface 'wifinet0'
        option ssid 'Home'
        option encryption 'psk2'
        option device 'radio0'
        option mode 'sta'
        option key '<Removed>'
        option network 'wwan2'

When I reboot, the wifinet0 is gone.

When you added these, did you do so by manually editing the conf or did you do it via UCI? If the latter I wonder if uci commit wireless didn’t do what it need to do.

I used Luci to do it.

After running uci commit wireless it doesn’t save the configuration either after rebooting.

It also looks like I only need to run this after running the uci commands. If the file is already modified, that command won’t do anything.

commit [<config>] Writes changes of the given configuration file, or if none is given, all configuration files, to the filesystem. All “uci set”, “uci add”, “uci rename” and “uci delete” commands are staged into a temporary location and written to flash at once with “uci commit”. This is not needed after editing configuration files with a text editor, but for scripts, GUIs and other programs working directly with UCI files.

I’ll take your word for it. I tend to stay away fr UCI as I’m just so conditioned to directly edit the conf on my various Linux boxes. You may want to do the same; opkg update && opkg install nano is a Helluva lot easier for editing if you’re not intending to spend a lot of time in sysadmin/programming work.

A good SSH client app will let you just paste your above conf directly into the file as needed. See the References & Resources of

Same here.
I use GL-A1300 (FW: 4.4.6 release1, OpenWrt 21.02.2, r16495-bf0c965af0).

Here are the reproducible steps:

  • Factory reset
  • Login SSH
  • Edit /etc/config/wireless:
config wifi-iface 'default_radio0'
        # option mode 'ap'
        option mode 'sta'
        # option ssid 'GL-A1300-xxx'
        option ssid 'arbitrary'
        # option key 'XXXXXXXXX'
        option key 'YYYYYYYYYY'
  • Run wifi command to apply the changed configuration → You can connect to the network
  • Reboot
  • You will find that the entry `config wifi-iface ‘default_radio0’ is removed

I would say this is because of the GL.iNET GUI which will enforce the own settings.

You can disable the repeater manager so that it will not change sta settings.

/etc/init.d/repeater disable