diff options
author | Christian Breunig <christian@breunig.cc> | 2023-11-16 14:05:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-16 14:05:16 +0100 |
commit | 181c8d5c5715567486d7e9bfc71b0b7c1af71f37 (patch) | |
tree | 616b7dc2e591fa29eac227c5a191292eb47fcf35 /python | |
parent | c3d96163b3e674c20e4c856a18f8765626663f21 (diff) | |
parent | dc3906f04fbfe8014531e092a77c1c8c2d10dfe0 (diff) | |
download | vyos-1x-181c8d5c5715567486d7e9bfc71b0b7c1af71f37.tar.gz vyos-1x-181c8d5c5715567486d7e9bfc71b0b7c1af71f37.zip |
Merge pull request #2491 from sever-sever/T5747
T5747: op-mode add show interfaces summary
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/ifconfig/interface.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py index 050095364..31640385c 100644 --- a/python/vyos/ifconfig/interface.py +++ b/python/vyos/ifconfig/interface.py @@ -571,6 +571,16 @@ class Interface(Control): self._cmd(f'ip link set dev {self.ifname} netns {netns}') return True + def get_vrf(self): + """ + Get VRF from interface + + Example: + >>> from vyos.ifconfig import Interface + >>> Interface('eth0').get_vrf() + """ + return self.get_interface('vrf') + def set_vrf(self, vrf: str) -> bool: """ Add/Remove interface from given VRF instance. |