summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorl0crian1 <ryan.claridge13@gmail.com>2025-04-12 11:35:45 -0400
committerl0crian1 <ryan.claridge13@gmail.com>2025-04-12 11:35:45 -0400
commit63e2ac54a920b164a474f924d6aad597a73b454b (patch)
treea553c1ca853abb103cc772d22af1c008a7800cf7
parentd1e8dbd33ad84999ea4feea075d723068628ab1d (diff)
downloadvyos-1x-63e2ac54a920b164a474f924d6aad597a73b454b.tar.gz
vyos-1x-63e2ac54a920b164a474f924d6aad597a73b454b.zip
interfaces: T7268: Add op-mode command for show all interfaces on system
This creates a command to show all interfaces on the system in both human readable and JSON format. This includes non-VyOS interfaces like those created by containers. Syntax: show interfaces kernel show interfaces kernel json show interfaces kernel <interface> show interfaces kernel <interface> json
-rw-r--r--op-mode-definitions/show-interfaces.xml.in30
1 files changed, 30 insertions, 0 deletions
diff --git a/op-mode-definitions/show-interfaces.xml.in b/op-mode-definitions/show-interfaces.xml.in
index 09466647d..126ce6311 100644
--- a/op-mode-definitions/show-interfaces.xml.in
+++ b/op-mode-definitions/show-interfaces.xml.in
@@ -26,6 +26,36 @@
</properties>
<command>${vyos_op_scripts_dir}/interfaces.py show_summary</command>
</leafNode>
+ <tagNode name="kernel">
+ <properties>
+ <completionHelp>
+ <script>ip -j link show | jq -r '.[].ifname'</script>
+ </completionHelp>
+ </properties>
+ <command>sudo ip -s link show dev $4</command>
+ <children>
+ <leafNode name="json">
+ <properties>
+ <help>Show system interface in JSON format</help>
+ </properties>
+ <command>ip -j -s -d link show dev $4</command>
+ </leafNode>
+ </children>
+ </tagNode>
+ <node name="kernel">
+ <properties>
+ <help>Show all interfaces on this system</help>
+ </properties>
+ <command>sudo ip -s link show</command>
+ <children>
+ <leafNode name="json">
+ <properties>
+ <help>Show all interfaces in JSON format</help>
+ </properties>
+ <command>ip -j -s -d link show</command>
+ </leafNode>
+ </children>
+ </node>
</children>
</node>
</children>