Skip to content

Commit

Permalink
Improve cisco_nxos show_ip_interface (#1092)
Browse files Browse the repository at this point in the history
  • Loading branch information
lamiskin authored Feb 26, 2022
1 parent f0dfaff commit 231b0f7
Show file tree
Hide file tree
Showing 7 changed files with 364 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ntc_templates/templates/cisco_nxos_show_ip_interface.textfsm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Value PRIMARY_IP_SUBNET (\S+)
Value PRIMARY_BROADCAST_ADDRESS (\S+)
Value List SECONDARY_IP_ADDRESS (\S+)
Value List SECONDARY_IP_SUBNET (\S+)
Value List SECONDARY_ROUTE_PREFERENCE (\d+)
Value List SECONDARY_ROUTE_PREFERENCE_TAG (\d+)
Value MULTICAST_GROUPS (224\..*?)
Value MTU (\d+)
Value ROUTE_PREFERENCE (\d+)
Expand All @@ -20,9 +22,10 @@ Value DIRECTED_BROADCAST (\S+)
Value IP_FORWARDING (\S+)
Value ICMP_UNREACHABLES (\S+)
Value ICMP_PORT_UNREACHABLE (\S+)
Value URPF (\S+)
Value URPF (.*)
Value LOAD_SHARING (\S+)
Value LAST_RESET (\S+)
Value ACL_OUT (\S+)
Value UNICAST_PACKETS_SENT (\d+)
Value UNICAST_PACKETS_RECEIVED (\d+)
Value UNICAST_PACKETS_FORWARDED (\d+)
Expand Down Expand Up @@ -72,7 +75,8 @@ Start
^${INTERFACE},.*protocol-${PROTOCOL_STATUS}\/link-${LINK_STATUS}\/admin-${ADMIN_STATUS},.*$$
^\s*IP\s+address:\s+${PRIMARY_IP_ADDRESS},\s+IP\s+subnet:\s+${PRIMARY_IP_SUBNET}(\s+route-preference.+)?$$
# Secondary IP addresses are stored as a list
^\s*IP\s+address:\s+${SECONDARY_IP_ADDRESS},\s+IP\s+subnet:\s+${SECONDARY_IP_SUBNET}\s+secondary\s*$$
^\s*IP\s+address:\s+${SECONDARY_IP_ADDRESS},\s+IP\s+subnet:\s+${SECONDARY_IP_SUBNET}\s+secondary\s*(route-preference:\s+${SECONDARY_ROUTE_PREFERENCE},\s+tag:\s+${SECONDARY_ROUTE_PREFERENCE_TAG}\s*)?$$
# (,\s+route-preference:\s+${SECONDARY_ROUTE_PREFERENCE},\s+tag:\d+)?
^\s*IP\s+broadcast\s+address:\s+${PRIMARY_BROADCAST_ADDRESS}\s*$$
^\s*IP\s+multicast\s+groups\s+locally\s+joined:.*$$
# Multiple multicast groups are on the same line so we can't make a list out of those
Expand All @@ -91,6 +95,9 @@ Start
^\s*IP\s+load\s+sharing:\s+${LOAD_SHARING}\s*$$
^\s*IP\s+interface\s+statistics\s+last\s+reset:\s+${LAST_RESET}\s*$$
^\s*IP\s+interface\s+software\s+stats:.*$$
^\s*Unnumbered\s+interfaces\s+of
^\s*mti\d+:
^\s*IP\s+outbound\s+access\s+list:\s+${ACL_OUT}
^\s*Unicast\s+packets\s+:\s+${UNICAST_PACKETS_SENT}\/${UNICAST_PACKETS_RECEIVED}\/${UNICAST_PACKETS_FORWARDED}\/${UNICAST_PACKETS_ORIGINATED}\/${UNICAST_PACKETS_CONSUMED}\s*$$
^\s*Unicast\s+bytes\s+:\s+${UNICAST_BYTES_SENT}\/${UNICAST_BYTES_RECEIVED}\/${UNICAST_BYTES_FORWARDED}\/${UNICAST_BYTES_ORIGINATED}\/${UNICAST_BYTES_CONSUMED}\s*$$
^\s*Multicast\s+packets\s+:\s+${MULTICAST_PACKETS_SENT}\/${MULTICAST_PACKETS_RECEIVED}\/${MULTICAST_PACKETS_FORWARDED}\/${MULTICAST_PACKETS_ORIGINATED}\/${MULTICAST_PACKETS_CONSUMED}\s*$$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ parsed_sample:
primary_broadcast_address: "255.255.255.255"
secondary_ip_address: []
secondary_ip_subnet: []
secondary_route_preference: []
secondary_route_preference_tag: []
multicast_groups: "224.0.0.100"
mtu: "1500"
route_preference: "0"
Expand All @@ -25,6 +27,7 @@ parsed_sample:
urpf: "none"
load_sharing: "none"
last_reset: "never"
acl_out: ""
unicast_packets_sent: "5356711"
unicast_packets_received: "10702083"
unicast_packets_forwarded: "0"
Expand Down Expand Up @@ -80,6 +83,10 @@ parsed_sample:
- "172.16.69.209"
secondary_ip_subnet:
- "172.16.69.192/26"
secondary_route_preference:
- "None"
secondary_route_preference_tag:
- "None"
multicast_groups: "224.0.0.100"
mtu: "1500"
route_preference: "0"
Expand All @@ -95,6 +102,7 @@ parsed_sample:
urpf: "none"
load_sharing: "none"
last_reset: "never"
acl_out: ""
unicast_packets_sent: "363766868"
unicast_packets_received: "434448766"
unicast_packets_forwarded: "1840111"
Expand Down Expand Up @@ -148,6 +156,8 @@ parsed_sample:
primary_broadcast_address: "255.255.255.255"
secondary_ip_address: []
secondary_ip_subnet: []
secondary_route_preference: []
secondary_route_preference_tag: []
multicast_groups: "224.0.0.13 224.0.0.10 224.0.0.2 224.0.0.1"
mtu: "1500"
route_preference: "0"
Expand All @@ -163,6 +173,7 @@ parsed_sample:
urpf: "none"
load_sharing: "none"
last_reset: "never"
acl_out: ""
unicast_packets_sent: "0"
unicast_packets_received: "0"
unicast_packets_forwarded: "0"
Expand Down Expand Up @@ -216,6 +227,8 @@ parsed_sample:
primary_broadcast_address: "255.255.255.255"
secondary_ip_address: []
secondary_ip_subnet: []
secondary_route_preference: []
secondary_route_preference_tag: []
multicast_groups: "224.0.0.22 224.0.0.13 224.0.0.10 224.0.0.2 224.0.0.1"
mtu: "9216"
route_preference: "0"
Expand All @@ -231,6 +244,7 @@ parsed_sample:
urpf: "none"
load_sharing: "none"
last_reset: "never"
acl_out: ""
unicast_packets_sent: "1756"
unicast_packets_received: "605867934"
unicast_packets_forwarded: "0"
Expand Down Expand Up @@ -284,6 +298,8 @@ parsed_sample:
primary_broadcast_address: "255.255.255.255"
secondary_ip_address: []
secondary_ip_subnet: []
secondary_route_preference: []
secondary_route_preference_tag: []
multicast_groups: "224.0.0.13 224.0.0.10 224.0.0.2 224.0.0.1"
mtu: "9216"
route_preference: "0"
Expand All @@ -299,6 +315,7 @@ parsed_sample:
urpf: "none"
load_sharing: "none"
last_reset: "never"
acl_out: ""
unicast_packets_sent: "401266"
unicast_packets_received: "4198994"
unicast_packets_forwarded: "3316"
Expand Down Expand Up @@ -352,6 +369,8 @@ parsed_sample:
primary_broadcast_address: "255.255.255.255"
secondary_ip_address: []
secondary_ip_subnet: []
secondary_route_preference: []
secondary_route_preference_tag: []
multicast_groups: "224.0.0.20 224.0.0.10 224.0.0.2 224.0.0.1"
mtu: "9216"
route_preference: "0"
Expand All @@ -367,6 +386,7 @@ parsed_sample:
urpf: "none"
load_sharing: "none"
last_reset: "never"
acl_out: ""
unicast_packets_sent: "113285373"
unicast_packets_received: "23742404"
unicast_packets_forwarded: "556"
Expand Down Expand Up @@ -420,6 +440,8 @@ parsed_sample:
primary_broadcast_address: "255.255.255.255"
secondary_ip_address: []
secondary_ip_subnet: []
secondary_route_preference: []
secondary_route_preference_tag: []
multicast_groups: ""
mtu: "1500"
route_preference: "0"
Expand All @@ -435,6 +457,7 @@ parsed_sample:
urpf: "none"
load_sharing: "none"
last_reset: "never"
acl_out: ""
unicast_packets_sent: "578811674"
unicast_packets_received: "517277696"
unicast_packets_forwarded: "0"
Expand Down Expand Up @@ -488,6 +511,8 @@ parsed_sample:
primary_broadcast_address: "255.255.255.255"
secondary_ip_address: []
secondary_ip_subnet: []
secondary_route_preference: []
secondary_route_preference_tag: []
multicast_groups: ""
mtu: "1500"
route_preference: "0"
Expand All @@ -503,6 +528,7 @@ parsed_sample:
urpf: "none"
load_sharing: "none"
last_reset: "never"
acl_out: ""
unicast_packets_sent: "169393306"
unicast_packets_received: "169195583"
unicast_packets_forwarded: "0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,6 @@ parsed_sample:
wccp_redirect_outbound: "disabled"
wccp_redirect_inbound: "disabled"
wccp_redirect_exclude: "disabled"
acl_out: ""
secondary_route_preference: []
secondary_route_preference_tag: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
IP Interface Status for VRF "default"
loopback0, Interface status: protocol-up/link-up/admin-up, iod: 41,
Unnumbered interfaces of loopback0: first iod 55
mti15: mti4: mti7: mti11: mti10: mti3: mti16: mti14: mti12: mti13: mti5: mti9: mti8: mti6:
IP address: 172.21.128.18, IP subnet: 172.21.128.18/32 route-preference: 0, tag: 0
IP broadcast address: 255.255.255.255
IP multicast groups locally joined:
224.0.0.13 224.0.0.22 224.0.0.2 224.0.0.1
IP MTU: 1500 bytes (using link MTU)
IP primary address route-preference: 0, tag: 0
IP proxy ARP : disabled
IP Local Proxy ARP : disabled
IP multicast routing: enabled
IP icmp redirects: enabled
IP directed-broadcast: disabled
IP Forwarding: disabled
IP icmp unreachables (except port): disabled
IP icmp port-unreachable: enabled
IP unicast reverse path forwarding: none
IP load sharing: none
IP interface statistics last reset: never
IP interface software stats: (sent/received/forwarded/originated/consumed)
Unicast packets : 0/0/0/0/145403414
Unicast bytes : 0/0/0/0/29147964524
Multicast packets : 0/0/0/0/0
Multicast bytes : 0/0/0/0/0
Broadcast packets : 0/0/0/0/0
Broadcast bytes : 0/0/0/0/0
Labeled packets : 0/0/0/0/0
Labeled bytes : 0/0/0/0/0
WCCP Redirect outbound: disabled
WCCP Redirect inbound: disabled
WCCP Redirect exclude: disabled
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
parsed_sample:
- vrf_name: "default"
interface: "loopback0"
protocol_status: "up"
link_status: "up"
admin_status: "up"
primary_ip_address: "172.21.128.18"
primary_ip_subnet: "172.21.128.18/32"
primary_broadcast_address: "255.255.255.255"
secondary_ip_address: []
secondary_ip_subnet: []
multicast_groups: "224.0.0.13 224.0.0.22 224.0.0.2 224.0.0.1"
mtu: "1500"
route_preference: "0"
route_preference_tag: "0"
proxy_arp: "disabled"
local_proxy_arp: "disabled"
multicast_routing: "enabled"
icmp_redirects: "enabled"
directed_broadcast: "disabled"
ip_forwarding: "disabled"
icmp_unreachables: "disabled"
icmp_port_unreachable: "enabled"
urpf: "none"
load_sharing: "none"
last_reset: "never"
unicast_packets_sent: "0"
unicast_packets_received: "0"
unicast_packets_forwarded: "0"
unicast_packets_originated: "0"
unicast_packets_consumed: "145403414"
unicast_bytes_sent: "0"
unicast_bytes_received: "0"
unicast_bytes_forwarded: "0"
unicast_bytes_originated: "0"
unicast_bytes_consumed: "29147964524"
multicast_packets_sent: "0"
multicast_packets_received: "0"
multicast_packets_forwarded: "0"
multicast_packets_originated: "0"
multicast_packets_consumed: "0"
multicast_bytes_sent: "0"
multicast_bytes_received: "0"
multicast_bytes_forwarded: "0"
multicast_bytes_originated: "0"
multicast_bytes_consumed: "0"
broadcast_packets_sent: "0"
broadcast_packets_received: "0"
broadcast_packets_forwarded: "0"
broadcast_packets_originated: "0"
broadcast_packets_consumed: "0"
broadcast_bytes_sent: "0"
broadcast_bytes_received: "0"
broadcast_bytes_forwarded: "0"
broadcast_bytes_originated: "0"
broadcast_bytes_consumed: "0"
labeled_packets_sent: "0"
labeled_packets_received: "0"
labeled_packets_forwarded: "0"
labeled_packets_originated: "0"
labeled_packets_consumed: "0"
labeled_bytes_sent: "0"
labeled_bytes_received: "0"
labeled_bytes_forwarded: "0"
labeled_bytes_originated: "0"
labeled_bytes_consumed: "0"
wccp_redirect_outbound: "disabled"
wccp_redirect_inbound: "disabled"
wccp_redirect_exclude: "disabled"
acl_out: ""
secondary_route_preference: []
secondary_route_preference_tag: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
Vlan249, Interface status: protocol-up/link-up/admin-up, iod: 94,
IP address: 172.16.170.194, IP subnet: 172.16.170.192/26 route-preference: 0, tag: 0
IP address: 172.16.168.66, IP subnet: 172.16.168.64/27 secondary route-preference: 0, tag: 0
IP broadcast address: 255.255.255.255
IP multicast groups locally joined:
224.0.0.2 224.0.0.13 224.0.0.1 224.0.0.102
IP MTU: 1500 bytes (using link MTU)
IP primary address route-preference: 0, tag: 0
IP proxy ARP : disabled
IP Local Proxy ARP : disabled
IP multicast routing: enabled
IP icmp redirects: disabled
IP directed-broadcast: disabled
IP Forwarding: disabled
IP icmp unreachables (except port): disabled
IP icmp port-unreachable: enabled
IP unicast reverse path forwarding: none
IP load sharing: none
IP outbound access list: MAN_out
IP interface statistics last reset: never
IP interface software stats: (sent/received/forwarded/originated/consumed)
Unicast packets : 2244/1789802/530/1714/5919406
Unicast bytes : 265221/150279513/178557/127056/495850266
Multicast packets : 1470831/16436403/0/1470831/32872800
Multicast bytes : 73541550/1570424758/0/100016508/1570424550
Broadcast packets : 0/0/0/0/0
Broadcast bytes : 0/0/0/0/0
Labeled packets : 0/0/0/0/0
Labeled bytes : 0/0/0/0/0
WCCP Redirect outbound: disabled
WCCP Redirect inbound: disabled
WCCP Redirect exclude: disabled
Vlan783, Interface status: protocol-up/link-up/admin-up, iod: 62,
IP address: 152.98.241.32, IP subnet: 152.98.241.0/24 route-preference: 0, tag: 0
IP address: 152.98.246.32, IP subnet: 152.98.246.0/24 secondary route-preference: 0, tag: 0
IP address: 192.168.29.32, IP subnet: 192.168.29.0/24 secondary route-preference: 0, tag: 0
IP broadcast address: 255.255.255.255
IP multicast groups locally joined:
224.0.0.2 224.0.0.13 224.0.0.1 224.0.0.102
IP MTU: 1500 bytes (using link MTU)
IP primary address route-preference: 0, tag: 0
IP proxy ARP : disabled
IP Local Proxy ARP : disabled
IP multicast routing: enabled
IP icmp redirects: disabled
IP directed-broadcast: disabled
IP Forwarding: disabled
IP icmp unreachables (except port): disabled
IP icmp port-unreachable: enabled
IP unicast reverse path forwarding: loose allow default
IP load sharing: none
IP interface statistics last reset: never
IP interface software stats: (sent/received/forwarded/originated/consumed)
Unicast packets : 6981/6679953/3319/3663/27712276
Unicast bytes : 1262676/506182750/756646/266576/2028632576
Multicast packets : 1471045/57482658/0/1471045/74522267
Multicast bytes : 73553346/8727589702/0/100032156/8455329787
Broadcast packets : 0/0/0/0/0
Broadcast bytes : 0/0/0/0/0
Labeled packets : 0/0/0/0/0
Labeled bytes : 0/0/0/0/0
WCCP Redirect outbound: disabled
WCCP Redirect inbound: disabled
WCCP Redirect exclude: disabled
Loading

0 comments on commit 231b0f7

Please sign in to comment.