From 46e01016d73eb166fe6723baece4ba98df676d7d Mon Sep 17 00:00:00 2001 From: Wender Putters Date: Mon, 25 Feb 2019 15:53:14 +0100 Subject: [PATCH 1/6] add cisco_xr_show_route_vrf_all template --- .../cisco_xr_show_route_vrf_all.template | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 templates/cisco_xr_show_route_vrf_all.template diff --git a/templates/cisco_xr_show_route_vrf_all.template b/templates/cisco_xr_show_route_vrf_all.template new file mode 100644 index 0000000000..ff12c980c6 --- /dev/null +++ b/templates/cisco_xr_show_route_vrf_all.template @@ -0,0 +1,28 @@ +Value Filldown VRF (\S+) +Value Filldown PROTOCOL (\S+|\S+\s\S+) +Value Filldown NETWORK (\d+\.\d+\.\d+\.\d+) +Value Filldown MASK (\d+) +Value DISTANCE (\d+|is) +Value METRIC (\d+) +Value TYPE (directly|via) +Value Required NEXT_HOP (connected|\d+\.\d+\.\d+\.\d+) +Value INTERFACE (\S+|vrf\s\S+) +Value UPTIME (\S+) + + +Start + ^VRF?:\s${VRF} + ^Codes: C - connected, -> Route + +Route + ^\s+(\S+\s+-\s+.+[,]*)+ + ^Gateway\s+of\s+last\s+resort + ^${PROTOCOL}\s+${NETWORK}/${MASK}\s+(?:\[${DISTANCE}/${METRIC}\]|is)\s+${TYPE}\s+${NEXT_HOP},\s+${UPTIME},\s+${INTERFACE} -> Record + ^\s+(?:\[${DISTANCE}/${METRIC}\]|is)\s+${TYPE}\s+${NEXT_HOP},\s+${UPTIME},\s+${INTERFACE} -> Record + ^${PROTOCOL}\s+${NETWORK}/${MASK}\s+(?:\[${DISTANCE}/${METRIC}\]|is)\s+${TYPE}\s+${NEXT_HOP},\s+${UPTIME} -> Record + ^${PROTOCOL}\s+${NETWORK}/${MASK}\s+(?:\[${DISTANCE}/${METRIC}\]|is)\s+${TYPE}\s+${NEXT_HOP}\s+\(nexthop\sin\s${INTERFACE},\s+${UPTIME} -> Record + ^\s+(?:\[${DISTANCE}/${METRIC}\]|is)\s+${TYPE}\s+${NEXT_HOP},\s+${UPTIME} -> Record + ^\s+$$ + ^$$ + ^VRF?:\s${VRF} -> Start + ^.* -> Error "LINE NOT FOUND" \ No newline at end of file From e1443ef4bbbbbbe8aed5072e0c65d12d75850ab9 Mon Sep 17 00:00:00 2001 From: Wender Putters Date: Mon, 25 Feb 2019 18:57:14 +0100 Subject: [PATCH 2/6] added tests, updated index file, corrected small issue in template --- .../cisco_xr_show_route_vrf_all.template | 5 +- templates/index | 1 + .../cisco_xr_show_route_vrf_all.parsed | 494 ++++++++++++++++++ .../cisco_xr_show_route_vrf_all.raw | 97 ++++ 4 files changed, 595 insertions(+), 2 deletions(-) create mode 100644 tests/cisco_xr/show_route_vrf_all/cisco_xr_show_route_vrf_all.parsed create mode 100644 tests/cisco_xr/show_route_vrf_all/cisco_xr_show_route_vrf_all.raw diff --git a/templates/cisco_xr_show_route_vrf_all.template b/templates/cisco_xr_show_route_vrf_all.template index ff12c980c6..7e01c51bfa 100644 --- a/templates/cisco_xr_show_route_vrf_all.template +++ b/templates/cisco_xr_show_route_vrf_all.template @@ -20,9 +20,10 @@ Route ^${PROTOCOL}\s+${NETWORK}/${MASK}\s+(?:\[${DISTANCE}/${METRIC}\]|is)\s+${TYPE}\s+${NEXT_HOP},\s+${UPTIME},\s+${INTERFACE} -> Record ^\s+(?:\[${DISTANCE}/${METRIC}\]|is)\s+${TYPE}\s+${NEXT_HOP},\s+${UPTIME},\s+${INTERFACE} -> Record ^${PROTOCOL}\s+${NETWORK}/${MASK}\s+(?:\[${DISTANCE}/${METRIC}\]|is)\s+${TYPE}\s+${NEXT_HOP},\s+${UPTIME} -> Record - ^${PROTOCOL}\s+${NETWORK}/${MASK}\s+(?:\[${DISTANCE}/${METRIC}\]|is)\s+${TYPE}\s+${NEXT_HOP}\s+\(nexthop\sin\s${INTERFACE},\s+${UPTIME} -> Record + ^${PROTOCOL}\s+${NETWORK}/${MASK}\s+(?:\[${DISTANCE}/${METRIC}\]|is)\s+${TYPE}\s+${NEXT_HOP}\s+\(nexthop\sin\s${INTERFACE}\),\s+${UPTIME} -> Record ^\s+(?:\[${DISTANCE}/${METRIC}\]|is)\s+${TYPE}\s+${NEXT_HOP},\s+${UPTIME} -> Record ^\s+$$ ^$$ ^VRF?:\s${VRF} -> Start - ^.* -> Error "LINE NOT FOUND" \ No newline at end of file + ^.* -> Error "LINE NOT FOUND" + \ No newline at end of file diff --git a/templates/index b/templates/index index ebfdf090e5..46d7d099b1 100644 --- a/templates/index +++ b/templates/index @@ -252,6 +252,7 @@ cisco_xr_show_cdp_neighbors_detail.template, .*, cisco_xr, sh[[ow]] c[[dp]] neig cisco_xr_show_cef_drops_location.template, .*, cisco_xr, sh[[ow]] cef drops loc[[ation]] cisco_xr_show_redundancy_summary.template, .*, cisco_xr, sh[[ow]] redun[[dancy]] summ[[ary]] cisco_xr_show_interface_brief.template, .*, cisco_xr, sh[[ow]] int[[erface]] br[[ief]] +cisco_xr_show_route_vrf_all.template, .*, cisco_xr, sh[[ow]] ro[[ute]] v[[rf]] all cisco_xr_admin_show_platform.template, .*, cisco_xr, adm[[in]] sh[[ow]] pla[[tform]] cisco_xr_show_ip_bgp_summary.template, .*, cisco_xr, sh[[ow]] ip b[[gp]] s[[ummary]] cisco_xr_show_isis_neighbors.template, .*, cisco_xr, sh[[ow]] isis ne[[ighbors]] diff --git a/tests/cisco_xr/show_route_vrf_all/cisco_xr_show_route_vrf_all.parsed b/tests/cisco_xr/show_route_vrf_all/cisco_xr_show_route_vrf_all.parsed new file mode 100644 index 0000000000..8782d87f19 --- /dev/null +++ b/tests/cisco_xr/show_route_vrf_all/cisco_xr_show_route_vrf_all.parsed @@ -0,0 +1,494 @@ +--- +parsed_sample: + +- distance: '1' + interface: '' + mask: '0' + metric: '0' + network: 0.0.0.0 + next_hop: 172.16.1.1 + protocol: S* + type: via + uptime: 04:43:54 + vrf: example555 +- distance: '110' + interface: GigabitEthernet0/0/0/0 + mask: '32' + metric: '0' + network: 1.1.1.1 + next_hop: 10.1.1.9 + protocol: O + type: via + uptime: 04:43:27 + vrf: example555 +- distance: '110' + interface: GigabitEthernet0/0/0/3 + mask: '32' + metric: '9164' + network: 1.1.1.1 + next_hop: 10.1.1.34 + protocol: O + type: via + uptime: 04:43:27 + vrf: example555 +- distance: '110' + interface: GigabitEthernet0/0/0/0 + mask: '32' + metric: '0' + network: 1.1.1.3 + next_hop: 10.1.1.9 + protocol: O + type: via + uptime: 04:43:21 + vrf: example555 +- distance: '110' + interface: GigabitEthernet0/0/0/3 + mask: '32' + metric: '6564' + network: 1.1.1.3 + next_hop: 10.1.1.34 + protocol: O + type: via + uptime: 04:43:21 + vrf: example555 +- distance: '110' + interface: GigabitEthernet0/0/0/0 + mask: '32' + metric: '0' + network: 1.1.2.1 + next_hop: 10.1.1.9 + protocol: O + type: via + uptime: 04:43:40 + vrf: example555 +- distance: '110' + interface: GigabitEthernet0/0/0/3 + mask: '32' + metric: '9163' + network: 1.1.2.1 + next_hop: 10.1.1.34 + protocol: O + type: via + uptime: 04:43:40 + vrf: example555 +- distance: '110' + interface: GigabitEthernet0/0/0/0 + mask: '32' + metric: '0' + network: 1.1.2.3 + next_hop: 10.1.1.9 + protocol: O + type: via + uptime: 04:43:40 + vrf: example555 +- distance: '110' + interface: GigabitEthernet0/0/0/3 + mask: '32' + metric: '6563' + network: 1.1.2.3 + next_hop: 10.1.1.34 + protocol: O + type: via + uptime: 04:43:40 + vrf: example555 +- distance: '110' + interface: GigabitEthernet0/0/0/0 + mask: '32' + metric: '0' + network: 1.1.2.5 + next_hop: 10.1.1.9 + protocol: O + type: via + uptime: 04:43:40 + vrf: example555 +- distance: '110' + interface: GigabitEthernet0/0/0/3 + mask: '32' + metric: '639' + network: 1.1.2.5 + next_hop: 10.1.1.34 + protocol: O + type: via + uptime: 04:43:40 + vrf: example555 +- distance: '' + interface: Loopback0 + mask: '32' + metric: '' + network: 1.1.2.6 + next_hop: connected + protocol: L + type: directly + uptime: 04:43:54 + vrf: example555 +- distance: '110' + interface: GigabitEthernet0/0/0/0 + mask: '30' + metric: '0' + network: 10.1.0.0 + next_hop: 10.1.1.9 + protocol: O + type: via + uptime: 04:43:40 + vrf: example555 +- distance: '110' + interface: GigabitEthernet0/0/0/3 + mask: '30' + metric: '9163' + network: 10.1.0.0 + next_hop: 10.1.1.34 + protocol: O + type: via + uptime: 04:43:40 + vrf: example555 +- distance: '110' + interface: GigabitEthernet0/0/0/0 + mask: '30' + metric: '0' + network: 10.1.0.8 + next_hop: 10.1.1.9 + protocol: O + type: via + uptime: 04:43:40 + vrf: example555 +- distance: '110' + interface: GigabitEthernet0/0/0/3 + mask: '30' + metric: '6563' + network: 10.1.0.8 + next_hop: 10.1.1.34 + protocol: O + type: via + uptime: 04:43:40 + vrf: example555 +- distance: '110' + interface: GigabitEthernet0/0/0/0 + mask: '30' + metric: '0' + network: 10.1.1.0 + next_hop: 10.1.1.9 + protocol: O + type: via + uptime: 04:43:40 + vrf: example555 +- distance: '110' + interface: GigabitEthernet0/0/0/3 + mask: '30' + metric: '11762' + network: 10.1.1.0 + next_hop: 10.1.1.34 + protocol: O + type: via + uptime: 04:43:40 + vrf: example555 +- distance: '' + interface: GigabitEthernet0/0/0/1 + mask: '30' + metric: '' + network: 10.1.1.4 + next_hop: connected + protocol: C + type: directly + uptime: 04:43:54 + vrf: example555 +- distance: '' + interface: GigabitEthernet0/0/0/1 + mask: '32' + metric: '' + network: 10.1.1.6 + next_hop: connected + protocol: L + type: directly + uptime: 04:43:54 + vrf: example555 +- distance: '' + interface: GigabitEthernet0/0/0/0 + mask: '30' + metric: '' + network: 10.1.1.8 + next_hop: connected + protocol: C + type: directly + uptime: 04:43:54 + vrf: example555 +- distance: '' + interface: GigabitEthernet0/0/0/0 + mask: '32' + metric: '' + network: 10.1.1.10 + next_hop: connected + protocol: L + type: directly + uptime: 04:43:54 + vrf: example555 +- distance: '110' + interface: GigabitEthernet0/0/0/0 + mask: '30' + metric: '0' + network: 10.1.1.12 + next_hop: 10.1.1.9 + protocol: O + type: via + uptime: 04:43:40 + vrf: example555 +- distance: '110' + interface: GigabitEthernet0/0/0/3 + mask: '30' + metric: '9162' + network: 10.1.1.12 + next_hop: 10.1.1.34 + protocol: O + type: via + uptime: 04:43:40 + vrf: example555 +- distance: '110' + interface: GigabitEthernet0/0/0/0 + mask: '30' + metric: '0' + network: 10.1.1.20 + next_hop: 10.1.1.9 + protocol: O + type: via + uptime: 04:43:41 + vrf: example555 +- distance: '110' + interface: GigabitEthernet0/0/0/3 + mask: '30' + metric: '6562' + network: 10.1.1.20 + next_hop: 10.1.1.34 + protocol: O + type: via + uptime: 04:43:41 + vrf: example555 +- distance: '110' + interface: GigabitEthernet0/0/0/0 + mask: '30' + metric: '0' + network: 10.1.1.24 + next_hop: 10.1.1.9 + protocol: O + type: via + uptime: 04:43:40 + vrf: example555 +- distance: '110' + interface: GigabitEthernet0/0/0/3 + mask: '30' + metric: '709' + network: 10.1.1.24 + next_hop: 10.1.1.34 + protocol: O + type: via + uptime: 04:43:40 + vrf: example555 +- distance: '' + interface: GigabitEthernet0/0/0/2 + mask: '30' + metric: '' + network: 10.1.1.28 + next_hop: connected + protocol: C + type: directly + uptime: 04:43:54 + vrf: example555 +- distance: '' + interface: GigabitEthernet0/0/0/2 + mask: '32' + metric: '' + network: 10.1.1.30 + next_hop: connected + protocol: L + type: directly + uptime: 04:43:54 + vrf: example555 +- distance: '' + interface: GigabitEthernet0/0/0/3 + mask: '30' + metric: '' + network: 10.1.1.32 + next_hop: connected + protocol: C + type: directly + uptime: 04:43:54 + vrf: example555 +- distance: '' + interface: GigabitEthernet0/0/0/3 + mask: '32' + metric: '' + network: 10.1.1.33 + next_hop: connected + protocol: L + type: directly + uptime: 04:43:54 + vrf: example555 +- distance: '' + interface: MgmtEth0/0/CPU0/0 + mask: '24' + metric: '' + network: 172.16.1.0 + next_hop: connected + protocol: C + type: directly + uptime: 04:43:54 + vrf: example555 +- distance: '' + interface: MgmtEth0/0/CPU0/0 + mask: '32' + metric: '' + network: 172.16.1.120 + next_hop: connected + protocol: L + type: directly + uptime: 04:43:54 + vrf: example555 +- distance: '' + interface: Loopback44 + mask: '32' + metric: '' + network: 10.1.0.10 + next_hop: connected + protocol: L + type: directly + uptime: 1w1d + vrf: VRF10 +- distance: '200' + interface: vrf default + mask: '32' + metric: '0' + network: 10.1.0.15 + next_hop: 10.1.0.15 + protocol: B + type: via + uptime: 3w1d + vrf: VRF10 +- distance: '200' + interface: vrf default + mask: '32' + metric: '0' + network: 10.1.0.20 + next_hop: 10.1.0.20 + protocol: B + type: via + uptime: 3w1d + vrf: VRF10 +- distance: '110' + interface: GigabitEthernet0/0/0/0 + mask: '29' + metric: '110' + network: 10.7.1.0 + next_hop: 10.2.2.3 + protocol: O + type: via + uptime: 1w5d + vrf: ThirdExample +- distance: '110' + interface: GigabitEthernet0/0/0/0 + mask: '29' + metric: '110' + network: 10.7.1.0 + next_hop: 10.2.2.4 + protocol: O + type: via + uptime: 1w5d + vrf: ThirdExample +- distance: '110' + interface: GigabitEthernet0/0/0/0 + mask: '24' + metric: '110' + network: 10.2.0.0 + next_hop: 10.2.2.3 + protocol: O + type: via + uptime: 1w5d + vrf: ThirdExample +- distance: '110' + interface: GigabitEthernet0/0/0/0 + mask: '24' + metric: '110' + network: 10.2.0.0 + next_hop: 10.2.2.4 + protocol: O + type: via + uptime: 1w5d + vrf: ThirdExample +- distance: '110' + interface: GigabitEthernet0/0/0/0 + mask: '29' + metric: '110' + network: 10.2.1.0 + next_hop: 10.2.2.3 + protocol: O + type: via + uptime: 1w5d + vrf: ThirdExample +- distance: '110' + interface: GigabitEthernet0/0/0/0 + mask: '29' + metric: '110' + network: 10.2.1.0 + next_hop: 10.2.2.4 + protocol: O + type: via + uptime: 1w5d + vrf: ThirdExample +- distance: '' + interface: GigabitEthernet0/0/0/0 + mask: '29' + metric: '' + network: 10.2.2.0 + next_hop: connected + protocol: C + type: directly + uptime: 1w5d + vrf: ThirdExample +- distance: '' + interface: GigabitEthernet0/0/0/0 + mask: '32' + metric: '' + network: 10.2.2.1 + next_hop: connected + protocol: L + type: directly + uptime: 1w5d + vrf: ThirdExample +- distance: '110' + interface: GigabitEthernet0/0/0/0 + mask: '32' + metric: '110' + network: 10.2.10.2 + next_hop: 10.2.2.3 + protocol: O E1 + type: via + uptime: 1w5d + vrf: ThirdExample +- distance: '110' + interface: GigabitEthernet0/0/0/0 + mask: '32' + metric: '110' + network: 10.2.10.2 + next_hop: 10.2.2.4 + protocol: O E1 + type: via + uptime: 1w5d + vrf: ThirdExample +- distance: '200' + interface: vrf default + mask: '24' + metric: '110' + network: 10.3.0.0 + next_hop: 10.1.0.25 + protocol: B + type: via + uptime: 1w5d + vrf: ThirdExample +- distance: '200' + interface: vrf default + mask: '29' + metric: '0' + network: 10.3.1.0 + next_hop: 10.1.0.25 + protocol: B + type: via + uptime: 1w5d + vrf: ThirdExample + \ No newline at end of file diff --git a/tests/cisco_xr/show_route_vrf_all/cisco_xr_show_route_vrf_all.raw b/tests/cisco_xr/show_route_vrf_all/cisco_xr_show_route_vrf_all.raw new file mode 100644 index 0000000000..c8f5de96be --- /dev/null +++ b/tests/cisco_xr/show_route_vrf_all/cisco_xr_show_route_vrf_all.raw @@ -0,0 +1,97 @@ +Mon Jan 29 19:00:32.892 UTC +VRF: example555 + + +Codes: C - connected, S - static, R - RIP, B - BGP, (>) - Diversion path + D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area + N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 + E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP + i - ISIS, L1 - IS-IS level-1, L2 - IS-IS level-2 + ia - IS-IS inter area, su - IS-IS summary null, * - candidate default + U - per-user static route, o - ODR, L - local, G - DAGR, l - LISP + A - access/subscriber, a - Application route + M - mobile route, r - RPL, (!) - FRR Backup path + +Gateway of last resort is 172.16.1.1 to network 0.0.0.0 + +S* 0.0.0.0/0 [1/0] via 172.16.1.1, 04:43:54 +O 1.1.1.1/32 [110/0] via 10.1.1.9, 04:43:27, GigabitEthernet0/0/0/0 (!) + [110/9164] via 10.1.1.34, 04:43:27, GigabitEthernet0/0/0/3 +O 1.1.1.3/32 [110/0] via 10.1.1.9, 04:43:21, GigabitEthernet0/0/0/0 (!) + [110/6564] via 10.1.1.34, 04:43:21, GigabitEthernet0/0/0/3 +O 1.1.2.1/32 [110/0] via 10.1.1.9, 04:43:40, GigabitEthernet0/0/0/0 (!) + [110/9163] via 10.1.1.34, 04:43:40, GigabitEthernet0/0/0/3 +O 1.1.2.3/32 [110/0] via 10.1.1.9, 04:43:40, GigabitEthernet0/0/0/0 (!) + [110/6563] via 10.1.1.34, 04:43:40, GigabitEthernet0/0/0/3 +O 1.1.2.5/32 [110/0] via 10.1.1.9, 04:43:40, GigabitEthernet0/0/0/0 (!) + [110/639] via 10.1.1.34, 04:43:40, GigabitEthernet0/0/0/3 +L 1.1.2.6/32 is directly connected, 04:43:54, Loopback0 +O 10.1.0.0/30 [110/0] via 10.1.1.9, 04:43:40, GigabitEthernet0/0/0/0 (!) + [110/9163] via 10.1.1.34, 04:43:40, GigabitEthernet0/0/0/3 +O 10.1.0.8/30 [110/0] via 10.1.1.9, 04:43:40, GigabitEthernet0/0/0/0 (!) + [110/6563] via 10.1.1.34, 04:43:40, GigabitEthernet0/0/0/3 +O 10.1.1.0/30 [110/0] via 10.1.1.9, 04:43:40, GigabitEthernet0/0/0/0 (!) + [110/11762] via 10.1.1.34, 04:43:40, GigabitEthernet0/0/0/3 +C 10.1.1.4/30 is directly connected, 04:43:54, GigabitEthernet0/0/0/1 +L 10.1.1.6/32 is directly connected, 04:43:54, GigabitEthernet0/0/0/1 +C 10.1.1.8/30 is directly connected, 04:43:54, GigabitEthernet0/0/0/0 +L 10.1.1.10/32 is directly connected, 04:43:54, GigabitEthernet0/0/0/0 +O 10.1.1.12/30 [110/0] via 10.1.1.9, 04:43:40, GigabitEthernet0/0/0/0 (!) + [110/9162] via 10.1.1.34, 04:43:40, GigabitEthernet0/0/0/3 +O 10.1.1.20/30 [110/0] via 10.1.1.9, 04:43:41, GigabitEthernet0/0/0/0 (!) + [110/6562] via 10.1.1.34, 04:43:41, GigabitEthernet0/0/0/3 +O 10.1.1.24/30 [110/0] via 10.1.1.9, 04:43:40, GigabitEthernet0/0/0/0 (!) + [110/709] via 10.1.1.34, 04:43:40, GigabitEthernet0/0/0/3 +C 10.1.1.28/30 is directly connected, 04:43:54, GigabitEthernet0/0/0/2 +L 10.1.1.30/32 is directly connected, 04:43:54, GigabitEthernet0/0/0/2 +C 10.1.1.32/30 is directly connected, 04:43:54, GigabitEthernet0/0/0/3 +L 10.1.1.33/32 is directly connected, 04:43:54, GigabitEthernet0/0/0/3 +C 172.16.1.0/24 is directly connected, 04:43:54, MgmtEth0/0/CPU0/0 +L 172.16.1.120/32 is directly connected, 04:43:54, MgmtEth0/0/CPU0/0 + +VRF: VRF10 + + +Codes: C - connected, S - static, R - RIP, B - BGP, (>) - Diversion path + D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area + N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 + E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP + i - ISIS, L1 - IS-IS level-1, L2 - IS-IS level-2 + ia - IS-IS inter area, su - IS-IS summary null, * - candidate default + U - per-user static route, o - ODR, L - local, G - DAGR, l - LISP + A - access/subscriber, a - Application route + M - mobile route, r - RPL, (!) - FRR Backup path + +Gateway of last resort is not set + +L 10.1.0.10/32 is directly connected, 1w1d, Loopback44 +B 10.1.0.15/32 [200/0] via 10.1.0.15 (nexthop in vrf default), 3w1d +B 10.1.0.20/32 [200/0] via 10.1.0.20 (nexthop in vrf default), 3w1d + +VRF: ThirdExample + + +Codes: C - connected, S - static, R - RIP, B - BGP, (>) - Diversion path + D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area + N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 + E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP + i - ISIS, L1 - IS-IS level-1, L2 - IS-IS level-2 + ia - IS-IS inter area, su - IS-IS summary null, * - candidate default + U - per-user static route, o - ODR, L - local, G - DAGR, l - LISP + A - access/subscriber, a - Application route + M - mobile route, r - RPL, (!) - FRR Backup path + +Gateway of last resort is not set + +O 10.7.1.0/29 [110/110] via 10.2.2.3, 1w5d, GigabitEthernet0/0/0/0 + [110/110] via 10.2.2.4, 1w5d, GigabitEthernet0/0/0/0 +O 10.2.0.0/24 [110/110] via 10.2.2.3, 1w5d, GigabitEthernet0/0/0/0 + [110/110] via 10.2.2.4, 1w5d, GigabitEthernet0/0/0/0 +O 10.2.1.0/29 [110/110] via 10.2.2.3, 1w5d, GigabitEthernet0/0/0/0 + [110/110] via 10.2.2.4, 1w5d, GigabitEthernet0/0/0/0 +C 10.2.2.0/29 is directly connected, 1w5d, GigabitEthernet0/0/0/0 +L 10.2.2.1/32 is directly connected, 1w5d, GigabitEthernet0/0/0/0 +O E1 10.2.10.2/32 [110/110] via 10.2.2.3, 1w5d, GigabitEthernet0/0/0/0 + [110/110] via 10.2.2.4, 1w5d, GigabitEthernet0/0/0/0 +B 10.3.0.0/24 [200/110] via 10.1.0.25 (nexthop in vrf default), 1w5d +B 10.3.1.0/29 [200/0] via 10.1.0.25 (nexthop in vrf default), 1w5d From d4f4a1ce9c3a81072d4bca14c92f4acef566c393 Mon Sep 17 00:00:00 2001 From: Wender Putters Date: Wed, 13 Mar 2019 08:18:58 +0100 Subject: [PATCH 3/6] removed seperate template for 'show route vrf all' and combined it with 'show ip route' --- templates/cisco_xr_show_ip_route.template | 7 +++- .../cisco_xr_show_route_vrf_all.template | 29 ---------------- templates/index | 1 - .../cisco_xr_show_ip_route.parsed | 34 +++++++++++++++++++ .../cisco_xr_show_ip_route2.parsed | 7 ++++ .../cisco_xr_show_ip_route_vrf.parsed} | 0 .../cisco_xr_show_ip_route_vrf.raw} | 0 7 files changed, 47 insertions(+), 31 deletions(-) delete mode 100644 templates/cisco_xr_show_route_vrf_all.template rename tests/cisco_xr/{show_route_vrf_all/cisco_xr_show_route_vrf_all.parsed => show_ip_route/cisco_xr_show_ip_route_vrf.parsed} (100%) rename tests/cisco_xr/{show_route_vrf_all/cisco_xr_show_route_vrf_all.raw => show_ip_route/cisco_xr_show_ip_route_vrf.raw} (100%) diff --git a/templates/cisco_xr_show_ip_route.template b/templates/cisco_xr_show_ip_route.template index b80aefe6ac..b629ff41eb 100644 --- a/templates/cisco_xr_show_ip_route.template +++ b/templates/cisco_xr_show_ip_route.template @@ -1,3 +1,4 @@ +Value Filldown VRF (\S+) Value Filldown PROTOCOL (\S+|\S+\s\S+) Value Filldown NETWORK (\d+\.\d+\.\d+\.\d+) Value Filldown MASK (\d+) @@ -5,10 +6,12 @@ Value DISTANCE (\d+|is) Value METRIC (\d+) Value TYPE (directly|via) Value Required NEXT_HOP (connected|\d+\.\d+\.\d+\.\d+) -Value INTERFACE (\S+) +Value INTERFACE (\S+|vrf\s\S+) Value UPTIME (\S+) + Start + ^VRF?:\s${VRF} ^Codes: C - connected, -> Route Route @@ -17,7 +20,9 @@ Route ^${PROTOCOL}\s+${NETWORK}/${MASK}\s+(?:\[${DISTANCE}/${METRIC}\]|is)\s+${TYPE}\s+${NEXT_HOP},\s+${UPTIME},\s+${INTERFACE} -> Record ^\s+(?:\[${DISTANCE}/${METRIC}\]|is)\s+${TYPE}\s+${NEXT_HOP},\s+${UPTIME},\s+${INTERFACE} -> Record ^${PROTOCOL}\s+${NETWORK}/${MASK}\s+(?:\[${DISTANCE}/${METRIC}\]|is)\s+${TYPE}\s+${NEXT_HOP},\s+${UPTIME} -> Record + ^${PROTOCOL}\s+${NETWORK}/${MASK}\s+(?:\[${DISTANCE}/${METRIC}\]|is)\s+${TYPE}\s+${NEXT_HOP}\s+\(nexthop\sin\s${INTERFACE}\),\s+${UPTIME} -> Record ^\s+(?:\[${DISTANCE}/${METRIC}\]|is)\s+${TYPE}\s+${NEXT_HOP},\s+${UPTIME} -> Record ^\s+$$ ^$$ + ^VRF?:\s${VRF} -> Start ^.* -> Error "LINE NOT FOUND" diff --git a/templates/cisco_xr_show_route_vrf_all.template b/templates/cisco_xr_show_route_vrf_all.template deleted file mode 100644 index 7e01c51bfa..0000000000 --- a/templates/cisco_xr_show_route_vrf_all.template +++ /dev/null @@ -1,29 +0,0 @@ -Value Filldown VRF (\S+) -Value Filldown PROTOCOL (\S+|\S+\s\S+) -Value Filldown NETWORK (\d+\.\d+\.\d+\.\d+) -Value Filldown MASK (\d+) -Value DISTANCE (\d+|is) -Value METRIC (\d+) -Value TYPE (directly|via) -Value Required NEXT_HOP (connected|\d+\.\d+\.\d+\.\d+) -Value INTERFACE (\S+|vrf\s\S+) -Value UPTIME (\S+) - - -Start - ^VRF?:\s${VRF} - ^Codes: C - connected, -> Route - -Route - ^\s+(\S+\s+-\s+.+[,]*)+ - ^Gateway\s+of\s+last\s+resort - ^${PROTOCOL}\s+${NETWORK}/${MASK}\s+(?:\[${DISTANCE}/${METRIC}\]|is)\s+${TYPE}\s+${NEXT_HOP},\s+${UPTIME},\s+${INTERFACE} -> Record - ^\s+(?:\[${DISTANCE}/${METRIC}\]|is)\s+${TYPE}\s+${NEXT_HOP},\s+${UPTIME},\s+${INTERFACE} -> Record - ^${PROTOCOL}\s+${NETWORK}/${MASK}\s+(?:\[${DISTANCE}/${METRIC}\]|is)\s+${TYPE}\s+${NEXT_HOP},\s+${UPTIME} -> Record - ^${PROTOCOL}\s+${NETWORK}/${MASK}\s+(?:\[${DISTANCE}/${METRIC}\]|is)\s+${TYPE}\s+${NEXT_HOP}\s+\(nexthop\sin\s${INTERFACE}\),\s+${UPTIME} -> Record - ^\s+(?:\[${DISTANCE}/${METRIC}\]|is)\s+${TYPE}\s+${NEXT_HOP},\s+${UPTIME} -> Record - ^\s+$$ - ^$$ - ^VRF?:\s${VRF} -> Start - ^.* -> Error "LINE NOT FOUND" - \ No newline at end of file diff --git a/templates/index b/templates/index index 46d7d099b1..ebfdf090e5 100644 --- a/templates/index +++ b/templates/index @@ -252,7 +252,6 @@ cisco_xr_show_cdp_neighbors_detail.template, .*, cisco_xr, sh[[ow]] c[[dp]] neig cisco_xr_show_cef_drops_location.template, .*, cisco_xr, sh[[ow]] cef drops loc[[ation]] cisco_xr_show_redundancy_summary.template, .*, cisco_xr, sh[[ow]] redun[[dancy]] summ[[ary]] cisco_xr_show_interface_brief.template, .*, cisco_xr, sh[[ow]] int[[erface]] br[[ief]] -cisco_xr_show_route_vrf_all.template, .*, cisco_xr, sh[[ow]] ro[[ute]] v[[rf]] all cisco_xr_admin_show_platform.template, .*, cisco_xr, adm[[in]] sh[[ow]] pla[[tform]] cisco_xr_show_ip_bgp_summary.template, .*, cisco_xr, sh[[ow]] ip b[[gp]] s[[ummary]] cisco_xr_show_isis_neighbors.template, .*, cisco_xr, sh[[ow]] isis ne[[ighbors]] diff --git a/tests/cisco_xr/show_ip_route/cisco_xr_show_ip_route.parsed b/tests/cisco_xr/show_ip_route/cisco_xr_show_ip_route.parsed index c843fceaa1..92b489832f 100644 --- a/tests/cisco_xr/show_ip_route/cisco_xr_show_ip_route.parsed +++ b/tests/cisco_xr/show_ip_route/cisco_xr_show_ip_route.parsed @@ -10,6 +10,7 @@ parsed_sample: protocol: S* type: via uptime: '04:43:54' + vrf: '' - distance: '110' interface: GigabitEthernet0/0/0/0 mask: '32' @@ -19,6 +20,7 @@ parsed_sample: protocol: O type: via uptime: '04:43:27' + vrf: '' - distance: '110' interface: GigabitEthernet0/0/0/3 mask: '32' @@ -28,6 +30,7 @@ parsed_sample: protocol: O type: via uptime: '04:43:27' + vrf: '' - distance: '110' interface: GigabitEthernet0/0/0/0 mask: '32' @@ -37,6 +40,7 @@ parsed_sample: protocol: O type: via uptime: '04:43:21' + vrf: '' - distance: '110' interface: GigabitEthernet0/0/0/3 mask: '32' @@ -46,6 +50,7 @@ parsed_sample: protocol: O type: via uptime: '04:43:21' + vrf: '' - distance: '110' interface: GigabitEthernet0/0/0/0 mask: '32' @@ -55,6 +60,7 @@ parsed_sample: protocol: O type: via uptime: '04:43:40' + vrf: '' - distance: '110' interface: GigabitEthernet0/0/0/3 mask: '32' @@ -64,6 +70,7 @@ parsed_sample: protocol: O type: via uptime: '04:43:40' + vrf: '' - distance: '110' interface: GigabitEthernet0/0/0/0 mask: '32' @@ -73,6 +80,7 @@ parsed_sample: protocol: O type: via uptime: '04:43:40' + vrf: '' - distance: '110' interface: GigabitEthernet0/0/0/3 mask: '32' @@ -82,6 +90,7 @@ parsed_sample: protocol: O type: via uptime: '04:43:40' + vrf: '' - distance: '110' interface: GigabitEthernet0/0/0/0 mask: '32' @@ -91,6 +100,7 @@ parsed_sample: protocol: O type: via uptime: '04:43:40' + vrf: '' - distance: '110' interface: GigabitEthernet0/0/0/3 mask: '32' @@ -100,6 +110,7 @@ parsed_sample: protocol: O type: via uptime: '04:43:40' + vrf: '' - distance: '' interface: Loopback0 mask: '32' @@ -109,6 +120,7 @@ parsed_sample: protocol: L type: directly uptime: '04:43:54' + vrf: '' - distance: '110' interface: GigabitEthernet0/0/0/0 mask: '30' @@ -118,6 +130,7 @@ parsed_sample: protocol: O type: via uptime: '04:43:40' + vrf: '' - distance: '110' interface: GigabitEthernet0/0/0/3 mask: '30' @@ -127,6 +140,7 @@ parsed_sample: protocol: O type: via uptime: '04:43:40' + vrf: '' - distance: '110' interface: GigabitEthernet0/0/0/0 mask: '30' @@ -136,6 +150,7 @@ parsed_sample: protocol: O type: via uptime: '04:43:40' + vrf: '' - distance: '110' interface: GigabitEthernet0/0/0/3 mask: '30' @@ -145,6 +160,7 @@ parsed_sample: protocol: O type: via uptime: '04:43:40' + vrf: '' - distance: '110' interface: GigabitEthernet0/0/0/0 mask: '30' @@ -154,6 +170,7 @@ parsed_sample: protocol: O type: via uptime: '04:43:40' + vrf: '' - distance: '110' interface: GigabitEthernet0/0/0/3 mask: '30' @@ -163,6 +180,7 @@ parsed_sample: protocol: O type: via uptime: '04:43:40' + vrf: '' - distance: '' interface: GigabitEthernet0/0/0/1 mask: '30' @@ -172,6 +190,7 @@ parsed_sample: protocol: C type: directly uptime: '04:43:54' + vrf: '' - distance: '' interface: GigabitEthernet0/0/0/1 mask: '32' @@ -181,6 +200,7 @@ parsed_sample: protocol: L type: directly uptime: '04:43:54' + vrf: '' - distance: '' interface: GigabitEthernet0/0/0/0 mask: '30' @@ -190,6 +210,7 @@ parsed_sample: protocol: C type: directly uptime: '04:43:54' + vrf: '' - distance: '' interface: GigabitEthernet0/0/0/0 mask: '32' @@ -199,6 +220,7 @@ parsed_sample: protocol: L type: directly uptime: '04:43:54' + vrf: '' - distance: '110' interface: GigabitEthernet0/0/0/0 mask: '30' @@ -208,6 +230,7 @@ parsed_sample: protocol: O type: via uptime: '04:43:40' + vrf: '' - distance: '110' interface: GigabitEthernet0/0/0/3 mask: '30' @@ -217,6 +240,7 @@ parsed_sample: protocol: O type: via uptime: '04:43:40' + vrf: '' - distance: '110' interface: GigabitEthernet0/0/0/0 mask: '30' @@ -226,6 +250,7 @@ parsed_sample: protocol: O type: via uptime: '04:43:41' + vrf: '' - distance: '110' interface: GigabitEthernet0/0/0/3 mask: '30' @@ -235,6 +260,7 @@ parsed_sample: protocol: O type: via uptime: '04:43:41' + vrf: '' - distance: '110' interface: GigabitEthernet0/0/0/0 mask: '30' @@ -244,6 +270,7 @@ parsed_sample: protocol: O type: via uptime: '04:43:40' + vrf: '' - distance: '110' interface: GigabitEthernet0/0/0/3 mask: '30' @@ -253,6 +280,7 @@ parsed_sample: protocol: O type: via uptime: '04:43:40' + vrf: '' - distance: '' interface: GigabitEthernet0/0/0/2 mask: '30' @@ -262,6 +290,7 @@ parsed_sample: protocol: C type: directly uptime: '04:43:54' + vrf: '' - distance: '' interface: GigabitEthernet0/0/0/2 mask: '32' @@ -271,6 +300,7 @@ parsed_sample: protocol: L type: directly uptime: '04:43:54' + vrf: '' - distance: '' interface: GigabitEthernet0/0/0/3 mask: '30' @@ -280,6 +310,7 @@ parsed_sample: protocol: C type: directly uptime: '04:43:54' + vrf: '' - distance: '' interface: GigabitEthernet0/0/0/3 mask: '32' @@ -289,6 +320,7 @@ parsed_sample: protocol: L type: directly uptime: '04:43:54' + vrf: '' - distance: '' interface: MgmtEth0/0/CPU0/0 mask: '24' @@ -298,6 +330,7 @@ parsed_sample: protocol: C type: directly uptime: '04:43:54' + vrf: '' - distance: '' interface: MgmtEth0/0/CPU0/0 mask: '32' @@ -307,3 +340,4 @@ parsed_sample: protocol: L type: directly uptime: '04:43:54' + vrf: '' diff --git a/tests/cisco_xr/show_ip_route/cisco_xr_show_ip_route2.parsed b/tests/cisco_xr/show_ip_route/cisco_xr_show_ip_route2.parsed index 4bbc679c4c..e36d868145 100644 --- a/tests/cisco_xr/show_ip_route/cisco_xr_show_ip_route2.parsed +++ b/tests/cisco_xr/show_ip_route/cisco_xr_show_ip_route2.parsed @@ -10,6 +10,7 @@ parsed_sample: protocol: 'S*' type: 'via' uptime: '4d01h' + vrf: '' - distance: '20' interface: '' mask: '16' @@ -19,6 +20,7 @@ parsed_sample: protocol: 'B' type: 'via' uptime: '1w4d' + vrf: '' - distance: '170' interface: 'TenGigE0/0/0/1.5' mask: '16' @@ -28,6 +30,7 @@ parsed_sample: protocol: 'D EX' type: 'via' uptime: '14:56:35' + vrf: '' - distance: '170' interface: 'TenGigE0/0/0/2.5' mask: '16' @@ -37,6 +40,7 @@ parsed_sample: protocol: 'D EX' type: 'via' uptime: '6d21h' + vrf: '' - distance: '170' interface: 'TenGigE0/0/0/3.5' mask: '16' @@ -46,6 +50,7 @@ parsed_sample: protocol: 'D EX' type: 'via' uptime: '6d21h' + vrf: '' - distance: '170' interface: 'TenGigE0/0/0/4.5' mask: '16' @@ -55,6 +60,7 @@ parsed_sample: protocol: 'D EX' type: 'via' uptime: '6d21h' + vrf: '' - distance: '20' interface: '' mask: '16' @@ -64,3 +70,4 @@ parsed_sample: protocol: 'B' type: 'via' uptime: '1y03w' + vrf: '' diff --git a/tests/cisco_xr/show_route_vrf_all/cisco_xr_show_route_vrf_all.parsed b/tests/cisco_xr/show_ip_route/cisco_xr_show_ip_route_vrf.parsed similarity index 100% rename from tests/cisco_xr/show_route_vrf_all/cisco_xr_show_route_vrf_all.parsed rename to tests/cisco_xr/show_ip_route/cisco_xr_show_ip_route_vrf.parsed diff --git a/tests/cisco_xr/show_route_vrf_all/cisco_xr_show_route_vrf_all.raw b/tests/cisco_xr/show_ip_route/cisco_xr_show_ip_route_vrf.raw similarity index 100% rename from tests/cisco_xr/show_route_vrf_all/cisco_xr_show_route_vrf_all.raw rename to tests/cisco_xr/show_ip_route/cisco_xr_show_ip_route_vrf.raw From 80680cd664d9b409670ade8fba0408abbe463668 Mon Sep 17 00:00:00 2001 From: jmcgill298 Date: Mon, 23 Sep 2019 22:28:34 -0400 Subject: [PATCH 4/6] Allow template to work with both forms of command --- templates/index | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/index b/templates/index index ebfdf090e5..fcbe7e3693 100644 --- a/templates/index +++ b/templates/index @@ -266,7 +266,7 @@ cisco_xr_show_pim_neighbor.template, .*, cisco_xr, sh[[ow]] pi[[m]] neigh[[bor]] cisco_xr_show_controllers.template, .*, cisco_xr, sh[[ow]] contr[[ollers]] (\S+) phy cisco_xr_show_interfaces.template, .*, cisco_xr, sh[[ow]] inte[[rfaces]] cisco_xr_admin_show_vm.template, .*, cisco_xr, adm[[in]] sh[[ow]] vm -cisco_xr_show_ip_route.template, .*, cisco_xr, sh[[ow]] ip ro[[ute]] +cisco_xr_show_ip_route.template, .*, cisco_xr, sh[[ow]] (?:ip )?ro[[ute]] cisco_xr_show_version.template, .*, cisco_xr, sh[[ow]] ver[[sion]] cisco_xr_show_hsrp.template, .*, cisco_xr, sh[[ow]] hs[[rp]] cisco_xr_show_bgp.template, .*, cisco_xr, sh[[ow]] bg[[p]] From c089a737f48bb5e0769a35f824d1b5f867777408 Mon Sep 17 00:00:00 2001 From: jmcgill298 Date: Mon, 23 Sep 2019 22:29:10 -0400 Subject: [PATCH 5/6] Allow template to work when codes map not present --- templates/cisco_xr_show_ip_route.template | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/templates/cisco_xr_show_ip_route.template b/templates/cisco_xr_show_ip_route.template index b629ff41eb..420a4f4f3c 100644 --- a/templates/cisco_xr_show_ip_route.template +++ b/templates/cisco_xr_show_ip_route.template @@ -12,9 +12,7 @@ Value UPTIME (\S+) Start ^VRF?:\s${VRF} - ^Codes: C - connected, -> Route - -Route + ^Codes: ^\s+(\S+\s+-\s+.+[,]*)+ ^Gateway\s+of\s+last\s+resort ^${PROTOCOL}\s+${NETWORK}/${MASK}\s+(?:\[${DISTANCE}/${METRIC}\]|is)\s+${TYPE}\s+${NEXT_HOP},\s+${UPTIME},\s+${INTERFACE} -> Record @@ -22,7 +20,6 @@ Route ^${PROTOCOL}\s+${NETWORK}/${MASK}\s+(?:\[${DISTANCE}/${METRIC}\]|is)\s+${TYPE}\s+${NEXT_HOP},\s+${UPTIME} -> Record ^${PROTOCOL}\s+${NETWORK}/${MASK}\s+(?:\[${DISTANCE}/${METRIC}\]|is)\s+${TYPE}\s+${NEXT_HOP}\s+\(nexthop\sin\s${INTERFACE}\),\s+${UPTIME} -> Record ^\s+(?:\[${DISTANCE}/${METRIC}\]|is)\s+${TYPE}\s+${NEXT_HOP},\s+${UPTIME} -> Record - ^\s+$$ - ^$$ - ^VRF?:\s${VRF} -> Start - ^.* -> Error "LINE NOT FOUND" + ^\s*$$ + ^\S+\s+\S+\s+\d+\s+\d+:\d+:\d+ + ^. -> Error "LINE NOT FOUND" From 7b21c127c434a4e27a60d8c660318ea5e80641ac Mon Sep 17 00:00:00 2001 From: Warsenius Date: Thu, 26 Sep 2019 12:38:15 +0000 Subject: [PATCH 6/6] add capture for when there are no routes of specific protocol --- templates/cisco_xr_show_ip_route.template | 1 + .../cisco_xr/show_ip_route/cisco_xr_show_ip_route_vrf.raw | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/templates/cisco_xr_show_ip_route.template b/templates/cisco_xr_show_ip_route.template index 420a4f4f3c..2dea94a093 100644 --- a/templates/cisco_xr_show_ip_route.template +++ b/templates/cisco_xr_show_ip_route.template @@ -22,4 +22,5 @@ Start ^\s+(?:\[${DISTANCE}/${METRIC}\]|is)\s+${TYPE}\s+${NEXT_HOP},\s+${UPTIME} -> Record ^\s*$$ ^\S+\s+\S+\s+\d+\s+\d+:\d+:\d+ + ^% No matching routes found ^. -> Error "LINE NOT FOUND" diff --git a/tests/cisco_xr/show_ip_route/cisco_xr_show_ip_route_vrf.raw b/tests/cisco_xr/show_ip_route/cisco_xr_show_ip_route_vrf.raw index c8f5de96be..e48a98d23a 100644 --- a/tests/cisco_xr/show_ip_route/cisco_xr_show_ip_route_vrf.raw +++ b/tests/cisco_xr/show_ip_route/cisco_xr_show_ip_route_vrf.raw @@ -95,3 +95,10 @@ O E1 10.2.10.2/32 [110/110] via 10.2.2.3, 1w5d, GigabitEthernet0/0/0/0 [110/110] via 10.2.2.4, 1w5d, GigabitEthernet0/0/0/0 B 10.3.0.0/24 [200/110] via 10.1.0.25 (nexthop in vrf default), 1w5d B 10.3.1.0/29 [200/0] via 10.1.0.25 (nexthop in vrf default), 1w5d + + +VRF: customerA + + +% No matching routes found +