summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjack9603301 <jack9603301@163.com>2020-11-13 13:13:40 +0800
committerjack9603301 <jack9603301@163.com>2020-11-13 13:13:40 +0800
commitbbfa1efcda80e904188413bf815f2eb428cee0c4 (patch)
tree415c24e58aaf564ce2cac9522c5ad46384b1bca1
parentf9e0fb6bffd41c143ff5454c3b73cca4a588ca86 (diff)
downloadvyos-1x-bbfa1efcda80e904188413bf815f2eb428cee0c4.tar.gz
vyos-1x-bbfa1efcda80e904188413bf815f2eb428cee0c4.zip
bridge: T3042: Fix VLAN filter invalid work
1. Due to the previous focus on the implementation of VLAN filter, it was not considered to include MTU settings, which will lead to MTU setting errors in some cases 2. In order to make VLAN aware of the work of the bridge, it is necessary to specify the allowed VLAN ID range for the bridge itself, and forget to join it before
-rw-r--r--interface-definitions/interfaces-bridge.xml.in1
-rw-r--r--python/vyos/ifconfig/bridge.py7
2 files changed, 8 insertions, 0 deletions
diff --git a/interface-definitions/interfaces-bridge.xml.in b/interface-definitions/interfaces-bridge.xml.in
index 678d3806c..778acda78 100644
--- a/interface-definitions/interfaces-bridge.xml.in
+++ b/interface-definitions/interfaces-bridge.xml.in
@@ -40,6 +40,7 @@
#include <include/interface-disable-link-detect.xml.i>
#include <include/interface-disable.xml.i>
#include <include/interface-vrf.xml.i>
+ #include <include/interface-mtu-68-16000.xml.i>
<leafNode name="forwarding-delay">
<properties>
<help>Forwarding delay</help>
diff --git a/python/vyos/ifconfig/bridge.py b/python/vyos/ifconfig/bridge.py
index 772db3543..7eac9b886 100644
--- a/python/vyos/ifconfig/bridge.py
+++ b/python/vyos/ifconfig/bridge.py
@@ -317,6 +317,13 @@ class BridgeIf(Interface):
cmd = f'bridge vlan add dev {interface} vid {vlan} master'
self._cmd(cmd)
+
+ vif = dict_search('vif', config)
+ if vif:
+ for vlan_id,vif_config in vif.items():
+ cmd = f'bridge vlan add dev {ifname} vid {vlan_id} self master'
+ self._cmd(cmd)
+
# enable/disable Vlan Filter
self.set_vlan_filter(vlan_filter)