summaryrefslogtreecommitdiff
path: root/python/vyos/ifconfig.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/vyos/ifconfig.py')
-rw-r--r--python/vyos/ifconfig.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/python/vyos/ifconfig.py b/python/vyos/ifconfig.py
index 90b8fc169..12ab4548d 100644
--- a/python/vyos/ifconfig.py
+++ b/python/vyos/ifconfig.py
@@ -1060,6 +1060,17 @@ class VLANIf(Interface):
super().remove()
+ def set_state(self, state):
+ """
+ Change individual VLAN interface state.
+
+ It makes only sense to change the state of an individual VLAN if the
+ parent interface is up
+ """
+ parent_state = self.get_state()
+ if parent_state == 'up':
+ super().set_state(state)
+
def add_vlan(self, vlan_id, ethertype='', ingress_qos='', egress_qos=''):
"""
A virtual LAN (VLAN) is any broadcast domain that is partitioned and