diff options
author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2023-11-15 23:48:58 +0000 |
---|---|---|
committer | Viacheslav Hletenko <v.gletenko@vyos.io> | 2023-11-16 12:48:07 +0000 |
commit | dc3906f04fbfe8014531e092a77c1c8c2d10dfe0 (patch) | |
tree | e6227d88a751bb25f253f0ebd86a28e325ea5b49 /python/vyos/ifconfig | |
parent | e085f3e6c21a41beee2c23d8525c2029a8e0b250 (diff) | |
download | vyos-1x-dc3906f04fbfe8014531e092a77c1c8c2d10dfe0.tar.gz vyos-1x-dc3906f04fbfe8014531e092a77c1c8c2d10dfe0.zip |
T5747: op-mode add MAC and MTU for show interfaces summary
Add op-mode "show interfaces summary"
Add MAC, VRF and MTU options:
vyos@r4# run show interfaces summary
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface IP Address MAC VRF MTU S/L Description
----------- ----------------- ----------------- ------- ----- ----- -------------
dum0 203.0.113.1/32 96:44:ad:c5:a1:a5 default 1500 u/u
eth0 192.168.122.14/24 52:54:00:f1:fd:77 default 1500 u/u WAN
eth1 192.0.2.1/24 52:54:00:04:33:2b foo 1500 u/u LAN-eth1
eth2 - 52:54:00:40:2e:af default 1504 u/u LAN-eth2
eth3 - 52:54:00:09:a4:b4 default 1500 A/D
Diffstat (limited to 'python/vyos/ifconfig')
-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. |