diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-08-22 18:39:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-22 18:39:52 +0200 |
commit | 2c7fe635994f81a4a8dd9708264b791ebc2a106b (patch) | |
tree | 056cac076aff79b754b6c29434254485ef558b51 /python/vyos | |
parent | 7cd7b6e27c29f72b79979f4d6f999def89309504 (diff) | |
parent | 3b6f8bf8f7499af4a6841e5e1f1dafae9db55c38 (diff) | |
download | vyos-1x-2c7fe635994f81a4a8dd9708264b791ebc2a106b.tar.gz vyos-1x-2c7fe635994f81a4a8dd9708264b791ebc2a106b.zip |
Merge pull request #1484 from c-po/bridge-fixes
bridge: T4632: vlan aware bridge lacks CPU forwarding
Diffstat (limited to 'python/vyos')
-rw-r--r-- | python/vyos/ifconfig/bridge.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/python/vyos/ifconfig/bridge.py b/python/vyos/ifconfig/bridge.py index eef02f21f..79192b480 100644 --- a/python/vyos/ifconfig/bridge.py +++ b/python/vyos/ifconfig/bridge.py @@ -274,8 +274,24 @@ class BridgeIf(Interface): self.del_port(member) # enable/disable Vlan Filter - vlan_filter = '1' if 'enable_vlan' in config else '0' - self.set_vlan_filter(vlan_filter) + tmp = '1' if 'enable_vlan' in config else '0' + self.set_vlan_filter(tmp) + + # add VLAN interfaces to local 'parent' bridge to allow forwarding + if 'enable_vlan' in config: + for vlan in config.get('vif_remove', {}): + # Remove old VLANs from the bridge + cmd = f'bridge vlan del dev {self.ifname} vid {vlan} self' + self._cmd(cmd) + + for vlan in config.get('vif', {}): + cmd = f'bridge vlan add dev {self.ifname} vid {vlan} self' + self._cmd(cmd) + + # VLAN of bridge parent interface is always 1. VLAN 1 is the default + # VLAN for all unlabeled packets + cmd = f'bridge vlan add dev {self.ifname} vid 1 pvid untagged self' + self._cmd(cmd) tmp = dict_search('member.interface', config) if tmp: |