Can I change wireless interface names in /etc/config/wireless?

On my router (TD-Link C7 Version 5), I get two WIFI devices: radio0, radio1.

For radio1, I created two wireless interfaces. I did not have to give them any names (unless we think of the ESSID as a wireless interface name).

On opening /etc/config/wireless, however, I see these two entries for radio1:

config wifi-iface 'default_radio1'
     option device 'radio1'
     [other options not shown]

config wifi-iface 'wifinet2'
     option device 'radio1'
     [other options not shown]

Where default_radio1 and wifinet2 look very much like names of the interface. They don't show up in LuCI.

My question is: Can I change those strings (default_radio1, wifinet2) to anything else I liked?

Which is to say, are they just there for convenience?

Or do they carry some technical significance so that changing them to a random string will "break" the interface?

Or maybe only default_radio1 has a special status as the "default" interface (and shouldn't be changed)? It is indeed the first one I created.

afaik the "interface name" that is used in OpenWrt interface is the SSID aka the actual name you see in the wifi page.
As you can see the wifi is assigned to an interface by using the wifi config file, it's not listed in the /etc/confing/network or firewall files so the interface name isn't doing all that much.
For example this line in the config options of the wifi network says the wifi is in the lan bridge (and will be handled like lan interface by firewall)
option network 'lan'

The only requirement for those is that they need to be different from each other and not contain symbols or spaces, because they are interface names and uci uses that to separate the blocks of options
see here I have renamed the last one to "securewifinet1"
Wifi might drop when you change the names (it's still an interface name change so the existing wifi is torn down and re-created), but if you restart the wifi (or the device) it is all fine.

uci show wireless
wireless.radio0=wifi-device
wireless.radio0.type='mac80211'
wireless.radio0.channel='11'
wireless.radio0.hwmode='11g'
wireless.radio0.path='platform/soc/a000000.wifi'
wireless.radio0.htmode='HT20'
wireless.radio0.cell_density='0'
wireless.default_radio0=wifi-iface
wireless.default_radio0.device='radio0'
wireless.default_radio0.mode='ap'
wireless.default_radio0.ssid='REDACTED'
wireless.default_radio0.hidden='1'
wireless.default_radio0.isolate='1'
wireless.default_radio0.encryption='sae-mixed'
wireless.default_radio0.key='REDACTED'
wireless.default_radio0.ieee80211w='1'
wireless.default_radio0.network='wan'
wireless.securewifinet1=wifi-iface
wireless.securewifinet1.device='radio0'
wireless.securewifinet1.mode='ap'
wireless.securewifinet1.ssid='OpenWrt'
wireless.securewifinet1.encryption='sae'
wireless.securewifinet1.ieee80211w='2'
wireless.securewifinet1.network='lan'
1 Like

Thank you. Just to make sure, you could have changed default_radio0 also, to something like securewifinet0 (subject to the "no space or special character" rule), without "breaking" anything?

I have had problems with interfaces failing to start after putting names there. Now I use just config wifi-iface with no name at all on that line, and let automatic naming take over. If the purpose of the interface is not clear by its SSID and network attachment, add a comment line.

Now I use just config wifi-iface with no name at all on that line, and let automatic naming take over

Thank you. Does "automatic naming" mean that, after authoring a "nameless" config wifi-iface line, you later find that the system has supplied a name on that line?

Or does it mean the system's continuing to manage without a name on that line in the config file?

In uci show each interface block will have simple consecutive numbers not any names. However I edit the config files directly so that is not a concern. The UCI CLI is there mostly to support LUCI and scripts. I find it confusing as a direct user interface.

The interfaces themselves will be named wlan0-1 etc regardless of any naming (or not) on the top line. Those names can be overridden with an option ifname within the block (not on the definition line) but again that is not recommended.

If you never run LUCI or UCI then the /etc/config/wireless file is not ever changed by the system, unless a new radio is detected then a new block will be added for it.