Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[change] When adding a Wireless config, should it add an interface? #289

Closed
thiagohflima opened this issue Nov 30, 2023 · 3 comments · Fixed by #298
Closed

[change] When adding a Wireless config, should it add an interface? #289

thiagohflima opened this issue Nov 30, 2023 · 3 comments · Fixed by #298
Assignees

Comments

@thiagohflima
Copy link

Scenario

Consider the following network configuration:

  • Two VLANs: 10 and 20
  • Bridges named vlan10 using eth0.10 and vlan20 using eth0.20

The goal is to create two SSIDs for each VLAN:

  • Wifi_VLAN10
  • Wifi_VLAN20

NetJSON Configuration

[
  {
    "wireless": {
      "network": ["vlan10"],
      "mode": "access_point",
      "radio": "radio0",
      "ssid": "WifiVLAN10"
    },
    "type": "wireless",
    "name": "wlan0"
  },
  {
    "wireless": {
      "network": ["vlan20"],
      "mode": "access_point",
      "radio": "radio0",
      "ssid": "WifiVLAN20"
    },
    "type": "wireless",
    "name": "wlan1"
  }
]

This configuration generates the following (showing only wireless-related settings):

Package Network

config device 'device_wlan0'
	option name 'wlan0'

config interface 'wlan0'
	option device 'wlan0'
	option proto 'none'

config device 'device_wlan1'
	option name 'wlan1'

config interface 'wlan1'
	option device 'wlan1'
	option proto 'none'

Package Wireless

config wifi-iface 'wifi_wlan0'
	option device 'radio0'
	option ifname 'wlan0'
	option mode 'ap'
	option network 'vlan10'
	option ssid 'WifiVLAN10'

config wifi-iface 'wifi_wlan1'
	option device 'radio0'
	option ifname 'wlan1'
	option mode 'ap'
	option network 'vlan20'
	option ssid 'WifiVLAN20'

When manually configuring in OpenWRT, it is simplified as follows:

Package Network

There's no config added in network

Package Wireless

config wifi-iface 'wifi_wlan0'
	option device 'radio0'
	option mode 'ap'
	option network 'vlan10'
	option ssid 'WifiVLAN10'

config wifi-iface 'wifi_wlan1'
	option device 'radio0'
	option mode 'ap'
	option network 'vlan20'
	option ssid 'WifiVLAN20'

As observed, the manual configuration lacks the ifname attribute in the wireless package, and no interfaces are created in the network package. While the current configuration works, there's a consideration about simplifying the OpenWisp-generated config. Does this simplification make sense?

@nemesifier
Copy link
Member

I ran into a situation in which the additional configuration in /etc/config/network caused issues.
I am investigating the possibility of removing that.

@nemesifier nemesifier self-assigned this May 20, 2024
@nemesifier nemesifier changed the title [bug?] When adding a Wireless config, should it add an interface? [change] When adding a Wireless config, should it add an interface? Jun 7, 2024
@nemesifier
Copy link
Member

I don't think we can remove ifname from the wireless configuration for different reasons, it doens't hurt having it defined explicitly.
So I am focusing on removing the unnecessary definitions in the /etc/config/network.

nemesifier added a commit that referenced this issue Jun 7, 2024
Avoid generating unnecessary config in /etc/config/network
when defining wireless interfaces.

Closes #289
nemesifier added a commit that referenced this issue Jun 7, 2024
Avoid generating unnecessary config in /etc/config/network
when defining wireless interfaces.

Closes #289
@nemesifier
Copy link
Member

#298 should fix this. I am testing it.

nemesifier added a commit that referenced this issue Jul 9, 2024
Avoid generating unnecessary config in /etc/config/network
when defining wireless interfaces.

Closes #289
nemesifier added a commit that referenced this issue Jul 9, 2024
Avoid generating unnecessary config in /etc/config/network
when defining wireless interfaces.

Closes #289
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

2 participants