Page MenuHomeVyOS Platform

Wireless interface can no longer be added to the bridge after bridge VLAN support
Closed, ResolvedPublicBUG

Description

VyOS had an issue completing a command.

We are sorry that you encountered a problem while using VyOS.
There are a few things you can do to help us (and yourself):
- Make sure you are running the latest version of the code available at
  https://downloads.vyos.io/rolling/current/amd64/vyos-rolling-latest.iso
- Consult the forum to see how to handle this issue
  https://forum.vyos.io
- Join our community on slack where our users exchange help and advice
  https://vyos.slack.com

When reporting problems, please include as much information as possible:
- do not obfuscate any data (feel free to contact us privately if your
  business policy requires it)
- and include all the information presented below

Report Time:      2020-11-13 08:39:32
Image Version:    VyOS 1.3-rolling-202011130217
Release Train:    equuleus

Built by:         [email protected]
Built on:         Fri 13 Nov 2020 02:17 UTC
Build UUID:       b19e3986-7349-451b-861c-e6bbd452e4ce
Build Commit ID:  3fa7fe6926a538

Architecture:     x86_64
Boot via:         installed image
System type:      bare metal

Hardware vendor:  PC Engines
Hardware model:   apu4
Hardware S/N:     1360315
Hardware UUID:    Unknown

Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/interfaces-bridge.py", line 203, in <module>
    apply(c)
  File "/usr/libexec/vyos/conf_mode/interfaces-bridge.py", line 194, in apply
    br.update(bridge)
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/bridge.py", line 312, in update
    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)
OSError: [Errno 255] failed to run command: bridge vlan del dev wlan0 vid 1
returned:
exit code: 255

noteworthy:
cmd 'bridge vlan del dev wlan0 vid 1'
returned (out):

returned (err):
RTNETLINK answers: Operation not supported

[[interfaces bridge br0]] failed
Commit failed
[edit]
[email protected]# save
Warning: you have uncommitted changes that will not be saved.

Saving configuration to '/config/config.boot'...

Config

 bridge br0 {
     address 192.0.2.1/24
     member {
         interface eth3 {
         }
         interface eth4 {
         }
+        interface wlan0 {
+        }
     }
     vrf black
 }
 dummy dum0 {
     address 172.18.254.204/32
 }
 ethernet eth0 {
 }
 ethernet eth1 {
 }
 ethernet eth2 {
 }
 ethernet eth3 {
 }
 wireless wlan0 {
     channel 0
     country-code DE
     physical-device phy0
     security {
         wpa {
             mode wpa2
             passphrase BeMyGuest123
         }
     }
     ssid VYOS-TEST
     type access-point
 }

Wifi can be simulated loading the `mac80211_hwsim` module

Details

Difficulty level
Unknown (require assessment)
Version
1.3-rolling-202011130217
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

c-po triaged this task as High priority.
c-po created this task.
This comment was removed by jack9603301.

Strange, the problem seems to be that the interface has not been added to the bridge. I may submit a patch about VLAN awareness to refuse to operate the vlan filter setting without enabling VLAN awareness, but I am not sure whether it has any Relationship, manual operation is normal:

sudo brctl addif wlan0
sudo bridge vlan del dev wlan0 vid 1

图片.png (194×743 px, 3 KB)

I did an experiment and determined that the interface was not added to the bridge normally. The VLAN awareness setting was added to the bridge, but it did not seem to work properly.

PR: https://github.com/vyos/vyos-1x/pull/613

This patch changes the settings and does not modify the vlan filter settings when VLAN awareness is not set, but the root cause of different problems is that the following code does not set the wireless port to the bridge normally:

tmp = dict_search('member.interface', config)
        if tmp:
            for interface, interface_config in tmp.items():
                # if interface does yet not exist bail out early and
                # add it later
                if interface not in interfaces():
                    continue

                # Bridge lower "physical" interface
                lower = Interface(interface)

                # If we've come that far we already verified the interface does
                # not have any addresses configured by CLI so just flush any
                # remaining ones
                lower.flush_addrs()
                # enslave interface port to bridge
                self.add_port(interface)

Before the VLAN bridge was supported, this error was hidden until the VLAN filter setting failed.

Please merge this PR

# Bridge port handling of wireless interfaces is done by hostapd.
        if 'wlan' in interface:
            return

Why can't wlan be completed in bridge.py?

PR: https://github.com/vyos/vyos-1x/pull/613

Contains 2 patch submissions

  • You should not modify the vlan filter settings without setting VLAN awareness
  • You should not refuse to add the wlan port to the bridge in bridge.py
# Bridge port handling of wireless interfaces is done by hostapd.
        if 'wlan' in interface:
            return

Why can't wlan be completed in bridge.py?

Because hostapd and in the future also wpa_supplicant take care about this.

I can now again bridge the WIFI interface to br0, please resolve the outstanding commit message changes and then it feels good to me! Thanks

@c-po I have changed the PR to prohibit WLAN ports from joining VLAN-aware bridge ports

erkin set Issue type to Bug (incorrect behavior).Aug 29 2021, 12:16 PM
erkin removed a subscriber: Active contributors.