From 9b96140d7bf8aa15b8bbdcfe1dc327f5613f5e1a Mon Sep 17 00:00:00 2001 From: Tymofii Dmytrenko <39663752+Yakuza-UA@users.noreply.github.com> Date: Mon, 1 Jun 2020 14:22:11 +0100 Subject: [PATCH] New Template: cisco_nxos_show_forwarding_adjacency (#722) --- ...sco_nxos_show_forwarding_adjacency.textfsm | 42 ++++ templates/index | 1 + ...cisco_nxos_show_forwarding_adjacency_1.raw | 13 + ...cisco_nxos_show_forwarding_adjacency_1.yml | 65 +++++ ...cisco_nxos_show_forwarding_adjacency_2.raw | 13 + ...cisco_nxos_show_forwarding_adjacency_2.yml | 65 +++++ ...cisco_nxos_show_forwarding_adjacency_3.raw | 57 +++++ ...cisco_nxos_show_forwarding_adjacency_3.yml | 226 ++++++++++++++++++ 8 files changed, 482 insertions(+) create mode 100644 templates/cisco_nxos_show_forwarding_adjacency.textfsm create mode 100644 tests/cisco_nxos/show_forwarding_adjacency/cisco_nxos_show_forwarding_adjacency_1.raw create mode 100644 tests/cisco_nxos/show_forwarding_adjacency/cisco_nxos_show_forwarding_adjacency_1.yml create mode 100644 tests/cisco_nxos/show_forwarding_adjacency/cisco_nxos_show_forwarding_adjacency_2.raw create mode 100644 tests/cisco_nxos/show_forwarding_adjacency/cisco_nxos_show_forwarding_adjacency_2.yml create mode 100644 tests/cisco_nxos/show_forwarding_adjacency/cisco_nxos_show_forwarding_adjacency_3.raw create mode 100644 tests/cisco_nxos/show_forwarding_adjacency/cisco_nxos_show_forwarding_adjacency_3.yml diff --git a/templates/cisco_nxos_show_forwarding_adjacency.textfsm b/templates/cisco_nxos_show_forwarding_adjacency.textfsm new file mode 100644 index 0000000000..bc868b44f9 --- /dev/null +++ b/templates/cisco_nxos_show_forwarding_adjacency.textfsm @@ -0,0 +1,42 @@ +# Nexus 7k have multiple slots +Value Filldown SLOT (\d+) +Value Required NEXTHOP ((?:\d{1,3}\.){3}\d{1,3}) +Value Required REWRITE (\S+) +Value Required INTERFACE (\S+) +Value ORIGIN_AS (\S+) +Value PEER_AS (\S+) +Value NEIGHBOR (\S+) + +Start + # Extract slot #, if available (Nexus 7k) + ^slot\s+${SLOT} + ^==== + # Match headers + ^IPv4\s+adjacency\s+information + ^next-hop\s+rewrite\s+info\s+interface\s*$$ -> Entries + ^next-hop\s+rewrite\s+info\s+interface\s+Origin\s+AS\s+Peer\s+AS\s+Neighbor -> EntriesDetail + # Empty and unknowns lines + ^\s*$$ + ^. -> Error + +Entries + # Ignore delimiter + ^-------- + # Match single adjacency entry (brief view) + ^${NEXTHOP}\s+${REWRITE}\s+${INTERFACE} -> Record + # New slot? + ^slot\s+${SLOT} -> Start + # Empty and unknowns lines + ^\s*$$ + ^. -> Error + +EntriesDetail + # Ignore delimiter + ^-------- + # Match single adjacency entry (detailed view) + ^${NEXTHOP}\s+${REWRITE}\s+${INTERFACE}\s*(?:${ORIGIN_AS}\s+${PEER_AS}\s+${NEIGHBOR})? -> Record + # New slot? + ^slot\s+${SLOT} -> Start + # Empty and unknowns lines + ^\s*$$ + ^. -> Error \ No newline at end of file diff --git a/templates/index b/templates/index index db1c43d374..6d55014b88 100644 --- a/templates/index +++ b/templates/index @@ -236,6 +236,7 @@ cisco_nxos_show_interfaces_switchport.textfsm, .*, cisco_nxos, sh[[ow]] int[[erf cisco_nxos_show_ip_dhcp_relay_address.textfsm, .*, cisco_nxos, sh[[ow]] ip dh[[cp]] r[[elay]] a[[ddress]] cisco_nxos_show_lldp_neighbors_detail.textfsm, .*, cisco_nxos, sh[[ow]] ll[[dp]] nei[[ghbors]] d[[etail]] cisco_nxos_show_cdp_neighbors_detail.textfsm, .*, cisco_nxos, sh[[ow]] c[[dp]] neig[[hbors]] det[[ail]] +cisco_nxos_show_forwarding_adjacency.textfsm, .*, cisco_nxos, sh[[ow]] fo[[rwarding]] (?:ipv4 )?ad[[jacency]] cisco_nxos_show_ipv6_interface_brief.textfsm, .*, cisco_nxos, sh[[ow]] ipv[[6]] interf[[ace]] b[[rief]] cisco_nxos_show_port-channel_summary.textfsm, .*, cisco_nxos, sh[[ow]] po[[rt-channel]] sum[[mary]] cisco_nxos_show_cts_interface_brief.textfsm, .*, cisco_nxos, sh[[ow]] cts inte[[rface]] br[[ief]] diff --git a/tests/cisco_nxos/show_forwarding_adjacency/cisco_nxos_show_forwarding_adjacency_1.raw b/tests/cisco_nxos/show_forwarding_adjacency/cisco_nxos_show_forwarding_adjacency_1.raw new file mode 100644 index 0000000000..19686584f2 --- /dev/null +++ b/tests/cisco_nxos/show_forwarding_adjacency/cisco_nxos_show_forwarding_adjacency_1.raw @@ -0,0 +1,13 @@ +IPv4 adjacency information + +next-hop rewrite info interface Origin AS Peer AS Neighbor +-------------- --------------- ------------- ---------- --------- -------------- +10.111.1.3 cc16.7c1f.9852 Vlan10 +10.111.1.4 cc16.7c1f.6900 Vlan10 +10.111.1.5 84b8.025a.f786 Vlan10 +10.111.1.6 a89d.2121.bc7b Vlan10 +10.5.111.213 0050.528c.5b4c Vlan182 +10.5.111.221 002a.6312.6ac1 Vlan182 +10.111.254.6 002a.6312.6ac1 Vlan254 +10.6.140.234 000e.b6b2.ff01 Ethernet1/16 +10.6.140.238 54a2.72da.b651 Ethernet1/16 \ No newline at end of file diff --git a/tests/cisco_nxos/show_forwarding_adjacency/cisco_nxos_show_forwarding_adjacency_1.yml b/tests/cisco_nxos/show_forwarding_adjacency/cisco_nxos_show_forwarding_adjacency_1.yml new file mode 100644 index 0000000000..4dae3330a7 --- /dev/null +++ b/tests/cisco_nxos/show_forwarding_adjacency/cisco_nxos_show_forwarding_adjacency_1.yml @@ -0,0 +1,65 @@ +--- +parsed_sample: + - slot: "" + nexthop: "10.111.1.3" + rewrite: "cc16.7c1f.9852" + interface: "Vlan10" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "" + nexthop: "10.111.1.4" + rewrite: "cc16.7c1f.6900" + interface: "Vlan10" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "" + nexthop: "10.111.1.5" + rewrite: "84b8.025a.f786" + interface: "Vlan10" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "" + nexthop: "10.111.1.6" + rewrite: "a89d.2121.bc7b" + interface: "Vlan10" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "" + nexthop: "10.5.111.213" + rewrite: "0050.528c.5b4c" + interface: "Vlan182" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "" + nexthop: "10.5.111.221" + rewrite: "002a.6312.6ac1" + interface: "Vlan182" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "" + nexthop: "10.111.254.6" + rewrite: "002a.6312.6ac1" + interface: "Vlan254" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "" + nexthop: "10.6.140.234" + rewrite: "000e.b6b2.ff01" + interface: "Ethernet1/16" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "" + nexthop: "10.6.140.238" + rewrite: "54a2.72da.b651" + interface: "Ethernet1/16" + origin_as: "" + peer_as: "" + neighbor: "" diff --git a/tests/cisco_nxos/show_forwarding_adjacency/cisco_nxos_show_forwarding_adjacency_2.raw b/tests/cisco_nxos/show_forwarding_adjacency/cisco_nxos_show_forwarding_adjacency_2.raw new file mode 100644 index 0000000000..b86bbd38ba --- /dev/null +++ b/tests/cisco_nxos/show_forwarding_adjacency/cisco_nxos_show_forwarding_adjacency_2.raw @@ -0,0 +1,13 @@ +IPv4 adjacency information + +next-hop rewrite info interface +-------------- --------------- ------------- +10.111.1.3 cc16.7c1f.9852 Vlan10 +10.111.1.4 cc16.7c1f.6900 Vlan10 +10.111.1.5 84b8.025a.f786 Vlan10 +10.111.1.6 a89d.2121.bc7b Vlan10 +10.5.111.213 0050.528c.5b4c Vlan182 +10.5.111.221 002a.6312.6ac1 Vlan182 +10.111.254.6 002a.6312.6ac1 Vlan254 +10.6.140.234 000e.b6b2.ff01 Ethernet1/16 +10.6.140.238 54a2.72da.b651 Ethernet1/16 \ No newline at end of file diff --git a/tests/cisco_nxos/show_forwarding_adjacency/cisco_nxos_show_forwarding_adjacency_2.yml b/tests/cisco_nxos/show_forwarding_adjacency/cisco_nxos_show_forwarding_adjacency_2.yml new file mode 100644 index 0000000000..4dae3330a7 --- /dev/null +++ b/tests/cisco_nxos/show_forwarding_adjacency/cisco_nxos_show_forwarding_adjacency_2.yml @@ -0,0 +1,65 @@ +--- +parsed_sample: + - slot: "" + nexthop: "10.111.1.3" + rewrite: "cc16.7c1f.9852" + interface: "Vlan10" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "" + nexthop: "10.111.1.4" + rewrite: "cc16.7c1f.6900" + interface: "Vlan10" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "" + nexthop: "10.111.1.5" + rewrite: "84b8.025a.f786" + interface: "Vlan10" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "" + nexthop: "10.111.1.6" + rewrite: "a89d.2121.bc7b" + interface: "Vlan10" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "" + nexthop: "10.5.111.213" + rewrite: "0050.528c.5b4c" + interface: "Vlan182" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "" + nexthop: "10.5.111.221" + rewrite: "002a.6312.6ac1" + interface: "Vlan182" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "" + nexthop: "10.111.254.6" + rewrite: "002a.6312.6ac1" + interface: "Vlan254" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "" + nexthop: "10.6.140.234" + rewrite: "000e.b6b2.ff01" + interface: "Ethernet1/16" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "" + nexthop: "10.6.140.238" + rewrite: "54a2.72da.b651" + interface: "Ethernet1/16" + origin_as: "" + peer_as: "" + neighbor: "" diff --git a/tests/cisco_nxos/show_forwarding_adjacency/cisco_nxos_show_forwarding_adjacency_3.raw b/tests/cisco_nxos/show_forwarding_adjacency/cisco_nxos_show_forwarding_adjacency_3.raw new file mode 100644 index 0000000000..858d24b875 --- /dev/null +++ b/tests/cisco_nxos/show_forwarding_adjacency/cisco_nxos_show_forwarding_adjacency_3.raw @@ -0,0 +1,57 @@ + +slot 1 +======= + + +IPv4 adjacency information + +next-hop rewrite info interface Origin AS Peer AS Neighbor +-------------- --------------- ------------- ---------- --------- -------------- +172.17.1.2 001c.b0c9.6b80 Ethernet1/1 +100.120.0.2 00de.fb5a.2c47 Ethernet1/2 +100.64.1.6 00a3.8eb7.6f29 Ethernet1/4 +100.100.59.10 286f.7feb.1947 Ethernet1/7 +100.111.0.2 00de.fb5a.2c46 Ethernet1/11 +100.100.59.2 286f.7feb.1940 Ethernet1/14 +100.89.1.6 b4de.3141.af12 Ethernet1/15 +100.99.1.2 84b2.61d4.357f Ethernet1/22 +100.99.1.10 2cab.eb4f.2f46 Ethernet1/23 +100.100.59.14 00d7.8f7f.edcb Ethernet2/7 +100.100.59.6 00d7.8f7f.edc4 Ethernet2/14 +100.89.1.2 b4de.3141.af10 Ethernet2/15 +100.126.255.2 00a3.d186.4141 Ethernet2/16 +100.99.1.6 84b2.61d4.357f Ethernet2/22 +100.99.1.14 2cab.eb4f.2f48 Ethernet2/23 +100.127.253.1 00de.fb5a.2c45 Ethernet2/24 + +slot 2 +======= + + +IPv4 adjacency information + +next-hop rewrite info interface Origin AS Peer AS Neighbor +-------------- --------------- ------------- ---------- --------- -------------- +172.17.1.2 001c.b0c9.6b80 Ethernet1/1 +100.120.0.2 00de.fb5a.2c47 Ethernet1/2 +100.64.1.6 00a3.8eb7.6f29 Ethernet1/4 +100.100.59.10 286f.7feb.1947 Ethernet1/7 +100.111.0.2 00de.fb5a.2c46 Ethernet1/11 +100.100.59.2 286f.7feb.1940 Ethernet1/14 +100.89.1.6 b4de.3141.af12 Ethernet1/15 +100.99.1.2 84b2.61d4.357f Ethernet1/22 +100.99.1.10 2cab.eb4f.2f46 Ethernet1/23 +100.100.59.14 00d7.8f7f.edcb Ethernet2/7 +100.100.59.6 00d7.8f7f.edc4 Ethernet2/14 +100.89.1.2 b4de.3141.af10 Ethernet2/15 +100.126.255.2 00a3.d186.4141 Ethernet2/16 +100.99.1.6 84b2.61d4.357f Ethernet2/22 +100.99.1.14 2cab.eb4f.2f48 Ethernet2/23 +100.127.253.1 00de.fb5a.2c45 Ethernet2/24 + +slot 5 +======= + + +slot 6 +======= diff --git a/tests/cisco_nxos/show_forwarding_adjacency/cisco_nxos_show_forwarding_adjacency_3.yml b/tests/cisco_nxos/show_forwarding_adjacency/cisco_nxos_show_forwarding_adjacency_3.yml new file mode 100644 index 0000000000..00697b3d71 --- /dev/null +++ b/tests/cisco_nxos/show_forwarding_adjacency/cisco_nxos_show_forwarding_adjacency_3.yml @@ -0,0 +1,226 @@ +--- +parsed_sample: + - slot: "1" + nexthop: "172.17.1.2" + rewrite: "001c.b0c9.6b80" + interface: "Ethernet1/1" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "1" + nexthop: "100.120.0.2" + rewrite: "00de.fb5a.2c47" + interface: "Ethernet1/2" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "1" + nexthop: "100.64.1.6" + rewrite: "00a3.8eb7.6f29" + interface: "Ethernet1/4" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "1" + nexthop: "100.100.59.10" + rewrite: "286f.7feb.1947" + interface: "Ethernet1/7" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "1" + nexthop: "100.111.0.2" + rewrite: "00de.fb5a.2c46" + interface: "Ethernet1/11" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "1" + nexthop: "100.100.59.2" + rewrite: "286f.7feb.1940" + interface: "Ethernet1/14" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "1" + nexthop: "100.89.1.6" + rewrite: "b4de.3141.af12" + interface: "Ethernet1/15" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "1" + nexthop: "100.99.1.2" + rewrite: "84b2.61d4.357f" + interface: "Ethernet1/22" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "1" + nexthop: "100.99.1.10" + rewrite: "2cab.eb4f.2f46" + interface: "Ethernet1/23" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "1" + nexthop: "100.100.59.14" + rewrite: "00d7.8f7f.edcb" + interface: "Ethernet2/7" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "1" + nexthop: "100.100.59.6" + rewrite: "00d7.8f7f.edc4" + interface: "Ethernet2/14" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "1" + nexthop: "100.89.1.2" + rewrite: "b4de.3141.af10" + interface: "Ethernet2/15" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "1" + nexthop: "100.126.255.2" + rewrite: "00a3.d186.4141" + interface: "Ethernet2/16" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "1" + nexthop: "100.99.1.6" + rewrite: "84b2.61d4.357f" + interface: "Ethernet2/22" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "1" + nexthop: "100.99.1.14" + rewrite: "2cab.eb4f.2f48" + interface: "Ethernet2/23" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "1" + nexthop: "100.127.253.1" + rewrite: "00de.fb5a.2c45" + interface: "Ethernet2/24" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "2" + nexthop: "172.17.1.2" + rewrite: "001c.b0c9.6b80" + interface: "Ethernet1/1" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "2" + nexthop: "100.120.0.2" + rewrite: "00de.fb5a.2c47" + interface: "Ethernet1/2" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "2" + nexthop: "100.64.1.6" + rewrite: "00a3.8eb7.6f29" + interface: "Ethernet1/4" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "2" + nexthop: "100.100.59.10" + rewrite: "286f.7feb.1947" + interface: "Ethernet1/7" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "2" + nexthop: "100.111.0.2" + rewrite: "00de.fb5a.2c46" + interface: "Ethernet1/11" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "2" + nexthop: "100.100.59.2" + rewrite: "286f.7feb.1940" + interface: "Ethernet1/14" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "2" + nexthop: "100.89.1.6" + rewrite: "b4de.3141.af12" + interface: "Ethernet1/15" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "2" + nexthop: "100.99.1.2" + rewrite: "84b2.61d4.357f" + interface: "Ethernet1/22" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "2" + nexthop: "100.99.1.10" + rewrite: "2cab.eb4f.2f46" + interface: "Ethernet1/23" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "2" + nexthop: "100.100.59.14" + rewrite: "00d7.8f7f.edcb" + interface: "Ethernet2/7" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "2" + nexthop: "100.100.59.6" + rewrite: "00d7.8f7f.edc4" + interface: "Ethernet2/14" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "2" + nexthop: "100.89.1.2" + rewrite: "b4de.3141.af10" + interface: "Ethernet2/15" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "2" + nexthop: "100.126.255.2" + rewrite: "00a3.d186.4141" + interface: "Ethernet2/16" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "2" + nexthop: "100.99.1.6" + rewrite: "84b2.61d4.357f" + interface: "Ethernet2/22" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "2" + nexthop: "100.99.1.14" + rewrite: "2cab.eb4f.2f48" + interface: "Ethernet2/23" + origin_as: "" + peer_as: "" + neighbor: "" + - slot: "2" + nexthop: "100.127.253.1" + rewrite: "00de.fb5a.2c45" + interface: "Ethernet2/24" + origin_as: "" + peer_as: "" + neighbor: ""