question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wireless: Modifications to wifi-iface or wifi-device can change network.$NET.ifname

See original GitHub issue

Tested 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 is wlan0-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: Screenshot_2021-05-25_11-44-42

“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:

Screenshot_2021-05-25_12-04-00

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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jow-commented, Nov 10, 2021

Thanks, the naming was significant. Fixes pushed to all relevant branches.

0reactions
pmelangecommented, Nov 10, 2021

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!!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

[OpenWrt Wiki] Wi-Fi /etc/config/wireless
wifi-iface - defines a wireless network on top of the wifi-device ... does not effect wireless configuration and ifname continues to be ...
Read more >
Configuring wireless network on ESPRESSObin
wifi-iface [0].ssid='My ESPRESSObin AP' uci set wireless. ... Once the changes are saved, restart the network with the wifi command:
Read more >
Renaming my wlan network interface - Unix Stack Exchange
I never knew you could rename an interface using the "ip" utility, worked great! I'll try the net.ifnames=0 boot parameter to make it...
Read more >
How to set Channel Width and data rate on RouterStation Pro ...
Everything in the firewall is on ACCEPT. And here is the wireless file: config wifi-device wifi0. option type atheros. option channel 1. option...
Read more >
Change Wifi router or point name - Google Nest Help
Open the Google Home app . Tap Wi-Fi . Tap Wifi devices. Under “Points,” tap your router or point. Tap Settings and then...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found