Page MenuHomeVyOS Platform

WiFi interface configured as station can not be added to bridge
Closed, WontfixPublicBUG

Description

Properly adding a WiFi interface to a bridge requires a lot more steps than adding a simple ethernet interface.

Currently the CLI allows it, but it results in an error:

Architecture:     x86_64
Boot via:         installed image
System type:      Unknown hypervisor guest

Hardware vendor:  QEMU
Hardware model:   Standard PC (Q35 + ICH9, 2009)

Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/interfaces-bridge.py", line 139, in <module>
apply(c)
  File "/usr/libexec/vyos/conf_mode/interfaces-bridge.py", line 130, in apply
br.update(bridge)
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/bridge.py", line 244, in update
self.add_port(interface)
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/bridge.py", line 179, in add_port
return self.set_interface('add_port', interface)
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 184, in set_interface
return self._set_command(self.config, name, value)
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 109, in _set_command
return self._commandset[name].get('format', lambda : _)(self._cmd(cmd))
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 51, in _cmd
return cmd(command, self.debug)
  File "/usr/lib/python3/dist-packages/vyos/util.py", line 179, in cmd
raise OSError(code, feedback)
FileNotFoundError: [Errno 2] failed to run command: ip link set dev wlan0 master br0
returned:
exit code: 2

noteworthy:
cmd 'ip link set dev wlan0 master br0'
returned (out):

returned (err):
Error: Device does not allow enslaving to a bridge.

It's possible to do, but it requires a number of extra steps:

https://wiki.debian.org/BridgeNetworkConnections#Bridging_with_a_wireless_NIC

Details

Difficulty level
Unknown (require assessment)
Version
1.3
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

Which CLI commands did you use to trigger this error?

c-po triaged this task as High priority.
set interfaces bridge br0 member interface wlan0

Should be the command

c-po renamed this task from Cannot add WiFi interface to Bridge to WiFi interface configured as station can not be added to bridge.Sep 19 2020, 8:08 PM

Proper handle OS exceptions for the user:

vyos@vyos# set interfaces bridge br10 member interface wlan0
[edit]
vyos@vyos# commit
[ interfaces bridge br10 ]
Error: Device does not allow enslaving to a bridge.
c-po closed this task as Wontfix.EditedNov 23 2020, 3:12 PM

This is actually a "wontfix" b/c it depends on the users hardware

Please note that the card must be configured to be in AP mode first. The link @c-po mentions highlights that you can't add a wireless interface to a bridge if it is in client mode.

I just tested 1.3-rolling-202012141037. It actually seems to be a bug. When applying wifi settings and adding to a bridge in the same commit, I'm hit with

Error: Device does not allow enslaving to a bridge.
[[interfaces bridge br0]] failed
Error: Device does not allow enslaving to a bridge.
[[interfaces wireless wlan0]] failed

Setting the wifi settings, committing, then adding the wireless interface to a bridge works until a reboot (when it tries to apply everything again in the same commit) and then it fails.

I know this used to work in (significantly) older builds but I'm lead to believe that something changed with the new on demand bridge creation. (https://phabricator.vyos.net/T2985) ?

Furthermore, I've attempted changing the interfaces-wireless.xml.in priority to a value before interfaces-bridge.xml.in and it still fails. Not sure how else I can debug.

erkin set Issue type to Bug (incorrect behavior).Sun, Aug 29, 1:08 PM
erkin removed a subscriber: Active contributors.