summaryrefslogtreecommitdiff
path: root/python/vyos/ifconfig/bridge.py
diff options
context:
space:
mode:
authorjack9603301 <jack9603301@163.com>2021-01-16 21:54:51 +0800
committerjack9603301 <jack9603301@163.com>2021-01-16 21:54:51 +0800
commitaef8f45290ee156e600fb647cf02e911787404d9 (patch)
tree2b97726a571cf01e1529d8c16d5354eae359c03b /python/vyos/ifconfig/bridge.py
parent461a106cdaf892a067bcd5630952822242edd411 (diff)
downloadvyos-1x-aef8f45290ee156e600fb647cf02e911787404d9.tar.gz
vyos-1x-aef8f45290ee156e600fb647cf02e911787404d9.zip
bridge: T3137: Support disable native VLAN
Diffstat (limited to 'python/vyos/ifconfig/bridge.py')
-rw-r--r--python/vyos/ifconfig/bridge.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/python/vyos/ifconfig/bridge.py b/python/vyos/ifconfig/bridge.py
index 85b5335de..a565d37a6 100644
--- a/python/vyos/ifconfig/bridge.py
+++ b/python/vyos/ifconfig/bridge.py
@@ -342,10 +342,6 @@ class BridgeIf(Interface):
vlan_id = interface_config['native_vlan']
add_vlan.append(vlan_id)
native_vlan_id = vlan_id
- else:
- # VLAN 1 is the default VLAN for all unlabeled packets
- add_vlan.append(1)
- native_vlan_id = 1
if 'allowed_vlan' in interface_config:
for vlan in interface_config['allowed_vlan']:
@@ -367,8 +363,9 @@ class BridgeIf(Interface):
cmd = f'bridge vlan add dev {interface} vid {vlan} master'
self._cmd(cmd)
# Setting native VLAN to system
- cmd = f'bridge vlan add dev {interface} vid {native_vlan_id} pvid untagged master'
- self._cmd(cmd)
+ if native_vlan_id:
+ cmd = f'bridge vlan add dev {interface} vid {native_vlan_id} pvid untagged master'
+ self._cmd(cmd)
# Enable/Disable of an interface must always be done at the end of the
# derived class to make use of the ref-counting set_admin_state()