Wireless: Modifications to wifi-iface or wifi-device can change network.$NET.ifname
See original GitHub issueTested with 19.07.7
We have come across a problem with Freifunk. This issue is: if someone wants to change (for example) the channel width of the 5GHz radio from 20MHz to 40MHz, then in the network config the value of network.$NET.ifname gets set to the wifi-iface section name.
To reproduce this, have the following setup in wireless:
- Here the section name is
wlan0_lan_5
and the ifname iswlan0-lan-5
. - We use named sections like
wlan0_mesh_5
so that we can properly programmatically modify the setting for client/mesh interfaces.
config wifi-iface 'wlan0_lan_5'
option device 'radio0'
option network 'lan'
option mode 'ap'
option ssid 'OpenWrt'
option encryption 'none'
option ifname 'wlan0-lan-5'
And in network (standard config):
config interface 'lan'
option type 'bridge'
option ifname 'eth0.1'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
After clicking “Save” then viewing “Unsaved Changes” the following is shown:
“Save & Apply” causes the network interface to be network.lan.ifname='eth0.1 wlan0_lan_5'
which is not correct. Note, the ifname in the wireless config is wlan0-lan-5 while the section name is wlan0_lan_5. Also, the wireless section name should simply not be included in the network config.
The real problem comes with 802.11s mesh wifi-ifaces with OLSRd as the routing daemon. The interface stops working properly. Before “Save & Apply” the wifi-iface and interface section looks like this:
config wifi-iface 'wlan0_mesh_5'
option network 'wireless0'
option device 'radio0'
option ifname 'wlan0-mesh-5'
option mode 'mesh'
option encryption 'none'
option mesh_fwding '0'
option mesh_id 'Mesh-Freifunk-Berlin'
option mcast_rate '12000'
option mesh_rssi_threshold '0'
config interface 'wireless0'
option netmask '255.255.255.255'
option proto 'static'
option ipaddr '10.31.39.132'
option ip6assign '64'
and ip a
should look like this:
26: wlan0-mesh-5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
link/ether f8:1a:67:5a:a2:4c brd ff:ff:ff:ff:ff:ff
inet 10.31.39.132/32 brd 255.255.255.255 scope global wlan0-mesh-5
valid_lft forever preferred_lft forever
inet6 fddd:f2e:e74e:11::1/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::fa1a:67ff:fe5a:a24c/64 scope link
valid_lft forever preferred_lft forever
After “Save & Apply” the interface section changes to this:
config interface 'wireless0'
option netmask '255.255.255.255'
option proto 'static'
option ipaddr '10.31.39.132'
option ip6assign '64'
option ifname 'wlan0_mesh_5'
And as a visual representation:
Also, the interface no longer gets an IP address assigned
24: wlan0-mesh-5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
link/ether f8:1a:67:5a:a2:4c brd ff:ff:ff:ff:ff:ff
inet6 fe80::fa1a:67ff:fe5a:a24c/64 scope link
valid_lft forever preferred_lft forever
I see this as a critical problem which needs to be solved.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top GitHub Comments
Thanks, the naming was significant. Fixes pushed to all relevant branches.
Wonderful! I also tested the change locally, both with a wireless interface bridged to physical ports and a wireless interface which has no physical ports. Really great!!!