diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-11-18 19:10:33 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-11-18 19:12:17 +0100 |
commit | d588a968f8d8beb22d36b5e4afa627b643511ca3 (patch) | |
tree | 1f4019bf7f1cbc99622611ab8fdca5dbbfa4c2c5 | |
parent | 013da8c0b138ce917460650bf3440a0cffb718b6 (diff) | |
download | vyos-1x-d588a968f8d8beb22d36b5e4afa627b643511ca3.tar.gz vyos-1x-d588a968f8d8beb22d36b5e4afa627b643511ca3.zip |
wwan: T3620: place interface in A/D state when removed
(cherry picked from commit 61e4d75abb1129f63df5a47b9c9bf0553850d893)
-rw-r--r-- | python/vyos/ifconfig/wwan.py | 16 |
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() |