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:11:03 +0100 |
commit | 61e4d75abb1129f63df5a47b9c9bf0553850d893 (patch) | |
tree | 872b44127dea4fbe4aff754c7f584eb449c5e940 /python/vyos/ifconfig/wwan.py | |
parent | eb6247e4b464c36fa7441627b221d0db39429251 (diff) | |
download | vyos-1x-61e4d75abb1129f63df5a47b9c9bf0553850d893.tar.gz vyos-1x-61e4d75abb1129f63df5a47b9c9bf0553850d893.zip |
wwan: T3620: place interface in A/D state when removed
Diffstat (limited to 'python/vyos/ifconfig/wwan.py')
-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() |