From fb2b3c48a47f2f6c28dbe7420eb1a1f691085db1 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 20 Feb 2021 19:52:22 +0100 Subject: op-mode: bgp: T1513: no need for "sudo" Commit 68f7d1474d ("op-mode: bgp: T1513: add "show bgp" tree containing l2vpn evpn") added the required XML definitions and a bash helper script. The helper always got invoked using "sudo" which is not necessary for vtysh. Calling "sudo" only slows down the system when e.g. RADIUS backed accounts are used. --- op-mode-definitions/include/bgp-afi-common.xml.i | 10 ++-- .../include/bgp-afi-ipv4-ipv6-common.xml.i | 68 +++++++++++----------- .../include/bgp-prefix-bestpath-multipath.xml.i | 6 +- .../include/vtysh-generic-detail.xml.i | 2 +- op-mode-definitions/show-bgp.xml.in | 56 +++++++++--------- 5 files changed, 71 insertions(+), 71 deletions(-) (limited to 'op-mode-definitions') diff --git a/op-mode-definitions/include/bgp-afi-common.xml.i b/op-mode-definitions/include/bgp-afi-common.xml.i index b496e910a..06cfc42a5 100644 --- a/op-mode-definitions/include/bgp-afi-common.xml.i +++ b/op-mode-definitions/include/bgp-afi-common.xml.i @@ -11,10 +11,10 @@ Exact match of the communities - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ @@ -23,18 +23,18 @@ AA:BB:CC - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ RIB advertisement statistics - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Summary of BGP neighbor status - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ 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 6de666603..dc0926375 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 @@ -8,94 +8,94 @@ Should accept local VPN route if exported and imported into different VRF (well-known community) - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Should accept VPN route with local nexthop (well-known community) - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Inform EBGP peers to blackhole traffic to prefix (well-known community) - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Exact match of the communities - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Graceful shutdown (well-known community) - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Staled Long-lived Graceful Restart VPN route (well-known community) - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Do not send outside local AS (well-known community) - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Do not advertise to any peer (well-known community) - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Do not export to next AS (well-known community) - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Removed because Long-lived Graceful Restart was not enabled for VPN route (well-known community) - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Do not export to any peer (well-known community) - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ RT translated VPNv4 route filtering (well-known community) - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ RT translated VPNv6 route filtering (well-known community) - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ RT VPNv4 route filtering (well-known community) - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ RT VPNv6 route filtering (well-known community) - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ @@ -109,10 +109,10 @@ Show BGP routes exactly matching specified community list - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ @@ -123,19 +123,19 @@ Display paths suppressed due to dampening - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Display flap statistics of routes - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Display detail of configured dampening parameters - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ @@ -151,13 +151,13 @@ Show BGP routes matching the specified large-communities - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Detailed information on TCP and BGP neighbor connections - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ @@ -166,31 +166,31 @@ - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Show routes advertised to a BGP neighbor - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Show dampened routes received from BGP neighbor - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Show flap statistics of the routes learned from BGP neighbor - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Show detailed prefix count information for BGP neighbor - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ @@ -201,7 +201,7 @@ Show prefixlist filter - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ @@ -209,13 +209,13 @@ Show received routes from BGP neighbor - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Show routes learned from BGP neighbor - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ @@ -223,13 +223,13 @@ Display routes conforming to the prefix-list - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Display routes matching the AS path regular expression - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ @@ -238,6 +238,6 @@ policy route-map - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ diff --git a/op-mode-definitions/include/bgp-prefix-bestpath-multipath.xml.i b/op-mode-definitions/include/bgp-prefix-bestpath-multipath.xml.i index 3bea5cf13..224fa6b45 100644 --- a/op-mode-definitions/include/bgp-prefix-bestpath-multipath.xml.i +++ b/op-mode-definitions/include/bgp-prefix-bestpath-multipath.xml.i @@ -3,18 +3,18 @@ Display only the bestpath - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Display only multipaths - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Display route and more specific routes - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ diff --git a/op-mode-definitions/include/vtysh-generic-detail.xml.i b/op-mode-definitions/include/vtysh-generic-detail.xml.i index 9e1f90649..5a3097a77 100644 --- a/op-mode-definitions/include/vtysh-generic-detail.xml.i +++ b/op-mode-definitions/include/vtysh-generic-detail.xml.i @@ -3,6 +3,6 @@ Detailed information - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ diff --git a/op-mode-definitions/show-bgp.xml.in b/op-mode-definitions/show-bgp.xml.in index 506af68b3..cd0c5a9e5 100644 --- a/op-mode-definitions/show-bgp.xml.in +++ b/op-mode-definitions/show-bgp.xml.in @@ -6,7 +6,7 @@ BGP information - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ #include @@ -19,7 +19,7 @@ #include - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ @@ -40,7 +40,7 @@ #include - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ @@ -63,7 +63,7 @@ <x.x.x.x> <x.x.x.x/x> <h:h:h:h:h:h:h:h> <h:h:h:h:h:h:h:h/x> - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ @@ -80,13 +80,13 @@ Display BGP Overlay Information for prefixes - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Display BGP tags for prefixes - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ @@ -94,7 +94,7 @@ Ethernet Segment - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ #include @@ -103,14 +103,14 @@ Ethernet Segment per EVI - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ #include VxLAN Network Identifier - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ @@ -118,7 +118,7 @@ Show import route target - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ @@ -127,19 +127,19 @@ - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Show routes advertised to a BGP neighbor - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Show routes learned from BGP neighbor - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ @@ -150,19 +150,19 @@ ASN:NN IPADDRESS:NN - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Display BGP Overlay Information for prefixes - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Display BGP tags for prefixes - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ @@ -170,7 +170,7 @@ EVPN route information - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ #include @@ -182,61 +182,61 @@ EAD (Type-1) route - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ MAC-IP (Type-2) route - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Multicast (Type-3) route - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Ethernet Segment (Type-4) route - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Prefix (Type-5) route - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ EAD (Type-1) route - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Ethernet Segment (Type-4) route - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ MAC-IP (Type-2) route - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Multicast (Type-3) route - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ Prefix (Type-5) route - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ @@ -247,7 +247,7 @@ 1-16777215 all - sudo ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ -- cgit v1.2.3