summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-11-18 19:10:33 +0100
committerChristian Poessinger <christian@poessinger.com>2021-11-18 19:12:17 +0100
commitd588a968f8d8beb22d36b5e4afa627b643511ca3 (patch)
tree1f4019bf7f1cbc99622611ab8fdca5dbbfa4c2c5 /python
parent013da8c0b138ce917460650bf3440a0cffb718b6 (diff)
downloadvyos-1x-d588a968f8d8beb22d36b5e4afa627b643511ca3.tar.gz
vyos-1x-d588a968f8d8beb22d36b5e4afa627b643511ca3.zip
wwan: T3620: place interface in A/D state when removed
(cherry picked from commit 61e4d75abb1129f63df5a47b9c9bf0553850d893)
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ifconfig/wwan.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/python/vyos/ifconfig/wwan.py b/python/vyos/ifconfig/wwan.py
index f18959a60..295f8bc2e 100644
--- a/python/vyos/ifconfig/wwan.py
+++ b/python/vyos/ifconfig/wwan.py
@@ -26,3 +26,19 @@ class WWANIf(Interface):
'eternal': 'wwan[0-9]+$',
},
}
+
+ def remove(self):
+ """
+ Remove interface from operating system. Removing the interface
+ deconfigures all assigned IP addresses.
+ Example:
+ >>> from vyos.ifconfig import WWANIf
+ >>> i = WWANIf('wwan0')
+ >>> i.remove()
+ """
+
+ if self.exists(self.ifname):
+ # interface is always A/D down. It needs to be enabled explicitly
+ self.set_admin_state('down')
+
+ super().remove()