From 1edacb9c1788db06de570d25e274a7a7df8e81e8 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 4 Dec 2021 07:35:53 +0100 Subject: xml: op-mode: add "show bfd" alias node to "show protocols bfd" --- op-mode-definitions/include/bfd-common.xml.i | 54 ++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 op-mode-definitions/include/bfd-common.xml.i (limited to 'op-mode-definitions/include') diff --git a/op-mode-definitions/include/bfd-common.xml.i b/op-mode-definitions/include/bfd-common.xml.i new file mode 100644 index 000000000..eebfbdad4 --- /dev/null +++ b/op-mode-definitions/include/bfd-common.xml.i @@ -0,0 +1,54 @@ + + + + Show Bidirectional Forwarding Detection (BFD) + + + + + Show all Bidirectional Forwarding Detection (BFD) peer status + + vtysh -c "show bfd peers" + + + + Show Bidirectional Forwarding Detection (BFD) peer counters + + vtysh -c "show bfd peers counters" + + + + + + Show Bidirectional Forwarding Detection (BFD) peer status + + + + + vtysh -c "show bfd peers" | awk -v BFD_PEER=$5 'BEGIN { regex = sprintf("(peer %s.*)vrf", BFD_PEER) } { if (match($0, regex, bfd_peer_value)) peer=bfd_peer_value[1] } END { if (peer) system("vtysh -c \"show bfd " peer "\"") }' + + + + Show Bidirectional Forwarding Detection (BFD) peer counters + + vtysh -c "show bfd peers" | awk -v BFD_PEER=$5 'BEGIN { regex = sprintf("(peer %s.*)vrf", BFD_PEER) } { if (match($0, regex, bfd_peer_value)) peer=bfd_peer_value[1] } END { if (peer) system("vtysh -c \"show bfd " peer " counters\"") }' + + + + + + Show Bidirectional Forwarding Detection peers + + vtysh -c "show bfd peers" + + + + Show Bidirectional Forwarding Detection (BFD) peers brief + + vtysh -c "show bfd peers brief" + + + + + + -- cgit v1.2.3 From 3f2173873e0519ea253759e7e119b2bcaea596bb Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 13 Dec 2021 21:06:47 +0100 Subject: op-mode: xml: refactor "show ip(v6) route" to use #include building blocks This change then adds supper to filter for given route types under a VRF instance. You will have "show ip route bgp" in the global VRF and "show ip route vrf red bgp" in the red VRF. Same commands apply to IPv6 routes. --- op-mode-definitions/include/show-route-bgp.xml.i | 8 ++ .../include/show-route-connected.xml.i | 8 ++ op-mode-definitions/include/show-route-isis.xml.i | 8 ++ .../include/show-route-kernel.xml.i | 8 ++ op-mode-definitions/include/show-route-ospf.xml.i | 8 ++ .../include/show-route-ospfv3.xml.i | 8 ++ op-mode-definitions/include/show-route-rip.xml.i | 8 ++ op-mode-definitions/include/show-route-ripng.xml.i | 8 ++ .../include/show-route-static.xml.i | 8 ++ .../include/show-route-summary.xml.i | 8 ++ .../include/show-route-supernets-only.xml.i | 8 ++ op-mode-definitions/include/show-route-table.xml.i | 17 ++++ op-mode-definitions/include/show-route-tag.xml.i | 16 +++ op-mode-definitions/show-ip-route.xml.in | 109 +++++---------------- op-mode-definitions/show-ipv6-route.xml.in | 97 +++++------------- 15 files changed, 172 insertions(+), 155 deletions(-) create mode 100644 op-mode-definitions/include/show-route-bgp.xml.i create mode 100644 op-mode-definitions/include/show-route-connected.xml.i create mode 100644 op-mode-definitions/include/show-route-isis.xml.i create mode 100644 op-mode-definitions/include/show-route-kernel.xml.i create mode 100644 op-mode-definitions/include/show-route-ospf.xml.i create mode 100644 op-mode-definitions/include/show-route-ospfv3.xml.i create mode 100644 op-mode-definitions/include/show-route-rip.xml.i create mode 100644 op-mode-definitions/include/show-route-ripng.xml.i create mode 100644 op-mode-definitions/include/show-route-static.xml.i create mode 100644 op-mode-definitions/include/show-route-summary.xml.i create mode 100644 op-mode-definitions/include/show-route-supernets-only.xml.i create mode 100644 op-mode-definitions/include/show-route-table.xml.i create mode 100644 op-mode-definitions/include/show-route-tag.xml.i (limited to 'op-mode-definitions/include') diff --git a/op-mode-definitions/include/show-route-bgp.xml.i b/op-mode-definitions/include/show-route-bgp.xml.i new file mode 100644 index 000000000..5c26bf43f --- /dev/null +++ b/op-mode-definitions/include/show-route-bgp.xml.i @@ -0,0 +1,8 @@ + + + + Border Gateway Protocol (BGP) + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + diff --git a/op-mode-definitions/include/show-route-connected.xml.i b/op-mode-definitions/include/show-route-connected.xml.i new file mode 100644 index 000000000..37364de64 --- /dev/null +++ b/op-mode-definitions/include/show-route-connected.xml.i @@ -0,0 +1,8 @@ + + + + Connected routes (directly attached subnet or host) + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + diff --git a/op-mode-definitions/include/show-route-isis.xml.i b/op-mode-definitions/include/show-route-isis.xml.i new file mode 100644 index 000000000..9ff2ccdc5 --- /dev/null +++ b/op-mode-definitions/include/show-route-isis.xml.i @@ -0,0 +1,8 @@ + + + + Intermediate System to Intermediate System (IS-IS) + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + diff --git a/op-mode-definitions/include/show-route-kernel.xml.i b/op-mode-definitions/include/show-route-kernel.xml.i new file mode 100644 index 000000000..8c5ac414e --- /dev/null +++ b/op-mode-definitions/include/show-route-kernel.xml.i @@ -0,0 +1,8 @@ + + + + Kernel routes (not installed via the zebra RIB) + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + diff --git a/op-mode-definitions/include/show-route-ospf.xml.i b/op-mode-definitions/include/show-route-ospf.xml.i new file mode 100644 index 000000000..1122aaba5 --- /dev/null +++ b/op-mode-definitions/include/show-route-ospf.xml.i @@ -0,0 +1,8 @@ + + + + Open Shortest Path First (OSPFv2) + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + diff --git a/op-mode-definitions/include/show-route-ospfv3.xml.i b/op-mode-definitions/include/show-route-ospfv3.xml.i new file mode 100644 index 000000000..c7a11b7ba --- /dev/null +++ b/op-mode-definitions/include/show-route-ospfv3.xml.i @@ -0,0 +1,8 @@ + + + + Open Shortest Path First (IPv6) (OSPFv3) + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + diff --git a/op-mode-definitions/include/show-route-rip.xml.i b/op-mode-definitions/include/show-route-rip.xml.i new file mode 100644 index 000000000..3c2fede28 --- /dev/null +++ b/op-mode-definitions/include/show-route-rip.xml.i @@ -0,0 +1,8 @@ + + + + Routing Information Protocol (RIP) + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + diff --git a/op-mode-definitions/include/show-route-ripng.xml.i b/op-mode-definitions/include/show-route-ripng.xml.i new file mode 100644 index 000000000..6e59cb054 --- /dev/null +++ b/op-mode-definitions/include/show-route-ripng.xml.i @@ -0,0 +1,8 @@ + + + + Routing Information Protocol next-generation (IPv6) (RIPng) + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + diff --git a/op-mode-definitions/include/show-route-static.xml.i b/op-mode-definitions/include/show-route-static.xml.i new file mode 100644 index 000000000..c2e396763 --- /dev/null +++ b/op-mode-definitions/include/show-route-static.xml.i @@ -0,0 +1,8 @@ + + + + Statically configured routes + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + diff --git a/op-mode-definitions/include/show-route-summary.xml.i b/op-mode-definitions/include/show-route-summary.xml.i new file mode 100644 index 000000000..471124562 --- /dev/null +++ b/op-mode-definitions/include/show-route-summary.xml.i @@ -0,0 +1,8 @@ + + + + Summary of all routes + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + diff --git a/op-mode-definitions/include/show-route-supernets-only.xml.i b/op-mode-definitions/include/show-route-supernets-only.xml.i new file mode 100644 index 000000000..4d1e7c51f --- /dev/null +++ b/op-mode-definitions/include/show-route-supernets-only.xml.i @@ -0,0 +1,8 @@ + + + + Show supernet entries only + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + diff --git a/op-mode-definitions/include/show-route-table.xml.i b/op-mode-definitions/include/show-route-table.xml.i new file mode 100644 index 000000000..c3cf82a86 --- /dev/null +++ b/op-mode-definitions/include/show-route-table.xml.i @@ -0,0 +1,17 @@ + + + + Table to display + + + + + The table number to display + + all + protocols static table + + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + diff --git a/op-mode-definitions/include/show-route-tag.xml.i b/op-mode-definitions/include/show-route-tag.xml.i new file mode 100644 index 000000000..8bfa0ae4e --- /dev/null +++ b/op-mode-definitions/include/show-route-tag.xml.i @@ -0,0 +1,16 @@ + + + + Show only routes with tag + + + + + Tag value + + <1-4294967295> + + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + diff --git a/op-mode-definitions/show-ip-route.xml.in b/op-mode-definitions/show-ip-route.xml.in index fdbb6859d..1e906672d 100644 --- a/op-mode-definitions/show-ip-route.xml.in +++ b/op-mode-definitions/show-ip-route.xml.in @@ -13,12 +13,7 @@ vtysh -c "show ip route" - - - Show IP BGP routes - - vtysh -c "show ip route bgp" - + #include Show kernel route cache @@ -34,12 +29,7 @@ ip -s route list cache $5 - - - Show IP connected routes - - vtysh -c "show ip route connected" - + #include Show kernel route table @@ -55,76 +45,15 @@ ip -s route list $5 - - - Show IP IS-IS routes - - vtysh -c "show ip route isis" - - - - Show IP kernel routes - - vtysh -c "show ip route kernel" - - - - Show IP OSPF routes - - vtysh -c "show ip route ospf" - - - - Show IP RIP routes - - vtysh -c "show ip route rip" - - - - Show IP static routes - - vtysh -c "show ip route static" - - - - Show IP routes summary - - vtysh -c "show ip route summary" - - - - Show IP supernet routes - - vtysh -c "show ip route supernets-only" - - - - Show IP routes in policy table - - - - - Show IP routes in policy table - - <1-200> - - - vtysh -c "show ip route table $5" - - - - Show only routes with tag - - - - - Tag value - - <1-4294967295> - - - vtysh -c "show ip route tag $5" - + #include + #include + #include + #include + #include + #include + #include + #include + #include Show IP routes in VRF @@ -133,7 +62,19 @@ vrf name - vtysh -c "show ip route vrf $5" + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + @@ -144,7 +85,7 @@ <x.x.x.x> <x.x.x.x/x> - vtysh -c "show ip route $4" + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ diff --git a/op-mode-definitions/show-ipv6-route.xml.in b/op-mode-definitions/show-ipv6-route.xml.in index 8624574ac..2c5024991 100644 --- a/op-mode-definitions/show-ipv6-route.xml.in +++ b/op-mode-definitions/show-ipv6-route.xml.in @@ -13,12 +13,7 @@ vtysh -c "show ipv6 route" - - - Show IPv6 BGP routes - - vtysh -c "show ipv6 route bgp" - + #include Show kernel IPv6 route cache @@ -34,12 +29,7 @@ ip -s -f inet6 route list cache $5 - - - Show IPv6 connected routes - - vtysh -c "show ipv6 route connected" - + #include Show kernel IPv6 route table @@ -55,71 +45,36 @@ ip -s -f inet6 route list $5 - - - Show IPv6 IS-IS routes - - vtysh -c "show ipv6 route isis" - - - - Show IPv6 Kernel routes - - vtysh -c "show ipv6 route kernel" - - - - Show IPv6 OSPF routes - - vtysh -c "show ipv6 route ospf6" - - - - Show IPv6 RIPNG routes - - vtysh -c "show ipv6 route ripng" - - - - Show IPv6 static routes - - vtysh -c "show ipv6 route static" - - - - Show IPv6 routes summary - - vtysh -c "show ipv6 route summary" - - - - Show IPv6 routes in policy tables - - vtysh -c "show ipv6 route table all" - - - - Show IPv6 routes in specific policy table - - protocols static table - - - vtysh -c "show ipv6 route table $5" - - - - Show IPv6 routes in VRFs - - vtysh -c "show ipv6 route vrf all" - + #include + #include + #include + #include + #include + #include + #include + #include - Show IPv6 routes in specific VRF + Show IPv6 routes in VRF + all vrf name - vtysh -c "show ipv6 route vrf $5" + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + -- cgit v1.2.3 From a6f951ed7f4669b7601f5f7e6c37451ed855d40b Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 13 Dec 2021 21:40:19 +0100 Subject: op-mode: BGP wide option is not availbale for L2VPN/EVPN AFI --- op-mode-definitions/include/bgp/afi-common.xml.i | 1 - op-mode-definitions/include/bgp/afi-ipv4-ipv6-common.xml.i | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'op-mode-definitions/include') diff --git a/op-mode-definitions/include/bgp/afi-common.xml.i b/op-mode-definitions/include/bgp/afi-common.xml.i index 4d5f56656..acf20d950 100644 --- a/op-mode-definitions/include/bgp/afi-common.xml.i +++ b/op-mode-definitions/include/bgp/afi-common.xml.i @@ -61,5 +61,4 @@ -#include diff --git a/op-mode-definitions/include/bgp/afi-ipv4-ipv6-common.xml.i b/op-mode-definitions/include/bgp/afi-ipv4-ipv6-common.xml.i index a51595b7f..084f5da83 100644 --- a/op-mode-definitions/include/bgp/afi-ipv4-ipv6-common.xml.i +++ b/op-mode-definitions/include/bgp/afi-ipv4-ipv6-common.xml.i @@ -230,4 +230,5 @@ ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ +#include -- cgit v1.2.3 From 25d95b1f73f3e5e0fd2dfc9199f46d808c68af43 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Wed, 15 Dec 2021 22:18:34 +0100 Subject: op-mode: T4073: drop "show protocols bfd" in favour of "show bfd" --- op-mode-definitions/include/bfd-common.xml.i | 54 ---------------------------- op-mode-definitions/show-protocols.xml.in | 1 - 2 files changed, 55 deletions(-) delete mode 100644 op-mode-definitions/include/bfd-common.xml.i (limited to 'op-mode-definitions/include') diff --git a/op-mode-definitions/include/bfd-common.xml.i b/op-mode-definitions/include/bfd-common.xml.i deleted file mode 100644 index eebfbdad4..000000000 --- a/op-mode-definitions/include/bfd-common.xml.i +++ /dev/null @@ -1,54 +0,0 @@ - - - - Show Bidirectional Forwarding Detection (BFD) - - - - - Show all Bidirectional Forwarding Detection (BFD) peer status - - vtysh -c "show bfd peers" - - - - Show Bidirectional Forwarding Detection (BFD) peer counters - - vtysh -c "show bfd peers counters" - - - - - - Show Bidirectional Forwarding Detection (BFD) peer status - - - - - vtysh -c "show bfd peers" | awk -v BFD_PEER=$5 'BEGIN { regex = sprintf("(peer %s.*)vrf", BFD_PEER) } { if (match($0, regex, bfd_peer_value)) peer=bfd_peer_value[1] } END { if (peer) system("vtysh -c \"show bfd " peer "\"") }' - - - - Show Bidirectional Forwarding Detection (BFD) peer counters - - vtysh -c "show bfd peers" | awk -v BFD_PEER=$5 'BEGIN { regex = sprintf("(peer %s.*)vrf", BFD_PEER) } { if (match($0, regex, bfd_peer_value)) peer=bfd_peer_value[1] } END { if (peer) system("vtysh -c \"show bfd " peer " counters\"") }' - - - - - - Show Bidirectional Forwarding Detection peers - - vtysh -c "show bfd peers" - - - - Show Bidirectional Forwarding Detection (BFD) peers brief - - vtysh -c "show bfd peers brief" - - - - - - diff --git a/op-mode-definitions/show-protocols.xml.in b/op-mode-definitions/show-protocols.xml.in index 48bfa10dc..698001b76 100644 --- a/op-mode-definitions/show-protocols.xml.in +++ b/op-mode-definitions/show-protocols.xml.in @@ -7,7 +7,6 @@ Show protocol specific information - #include Show static protocol parameters -- cgit v1.2.3