Skip to content

Commit

Permalink
[fix] cisco_nxos_show_interface_brief.textfsm (networktocode#1356)
Browse files Browse the repository at this point in the history
- support interface "Tunnel"
- support sub-interface "Eth1/52.111"
- support mode "f-path" and any others
- support interfaces without ip address, like "--"
  • Loading branch information
vladimirs-git authored Apr 17, 2023
1 parent aa4f23f commit ef2e7d6
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 13 deletions.
17 changes: 12 additions & 5 deletions ntc_templates/templates/cisco_nxos_show_interface_brief.textfsm
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
Value INTERFACE ([\w+/]+)
Value INTERFACE ([\w+/\.]+)
Value VRF (\S+)
Value STATUS (up|down)
Value IP (\d+\.\d+\.\d+\.\d+)
Value IP (\S+)
Value SPEED (\S+)
Value MTU (\d+)
Value VLAN ([\d+-]+)
Value TYPE (\S+)
Value MODE (routed|access|trunk|pvlan|fabric)
Value MODE (\S+)
Value REASON (\S+((\s\w+)+)?)
Value PORTCH (\S+)
Value DESCRIPTION (\S+((\s\w+)+)?)
Value PROTOCOL (\S+)

Start
^Port\s+VRF\s+Status\s+IP\s+Address\s+Speed\s+MTU -> Management
^Port\s+VRF\s+Status\s+IP\s+Address\s+Speed\s+MTU -> Management
^Ethernet\s+VLAN\s+Type\sMode\s+Status\s+Reason\s+Speed\s+Port\s*$$ -> Ethernet
^Interface\s+Ch\s+ -> Ethernet
^Interface\s+Ch\s+ -> Ethernet
^Interface\s+Status\s+Description\s*$$ -> Loopback
^Interface\s+Secondary\s+VLAN\(Type\)\s+Status\s+Reason -> VLAN
^Port-channel\s+VLAN\s+Type\sMode\s+Status\s+Reason\s+Speed\s+Protocol -> PORTCHANNEL
^Interface\s+Status\s+IP\s+Address\s+Encap\s+type\s+MTU -> TUNNEL
^---+$$
^. -> Error Start

Expand Down Expand Up @@ -54,3 +55,9 @@ PORTCHANNEL
^---+$$
^\s*$$ -> Start
^. -> Error PORTCHANNEL

TUNNEL
^${INTERFACE}\s+${STATUS}\s+${IP}\s+${TYPE}\s+${MTU} -> Record
^---+$$
^\s*$$ -> Start
^. -> Error TUNNEL
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,28 @@ Eth1/47 -- eth routed up none 1000(D) --
Eth1/48 -- eth routed up none 1000(D) --
Eth1/49 1 eth access down SFP not inserted 10G(D) --
Eth1/50 1 eth access down SFP not inserted 10G(D) --
Eth1/51 1 eth access down SFP not inserted 10G(D) --
Eth1/51 1 eth f-path up none 10G(D) --
Eth1/52 -- eth routed down SFP not inserted 10G(D) --
Eth1/52.111 111 eth routed down none 10G(D) --

--------------------------------------------------------------------------------
Port-channel VLAN Type Mode Status Reason Speed Protocol
Interface
Interface
--------------------------------------------------------------------------------
Po100 -- eth routed down No operational members auto(I) lacp

--------------------------------------------------------------------------------
Port VRF Status IP Address Speed MTU
--------------------------------------------------------------------------------
mgmt0 -- down 1.2.3.4 -- 1500
mgmt0 -- down -- -- 1500

-------------------------------------------------------------------------------
Interface Secondary VLAN(Type) Status Reason
Interface Secondary VLAN(Type) Status Reason
-------------------------------------------------------------------------------
Vlan1 -- down Admin

-----------------------------------------------------------------------------------------------------------
Interface Status IP Address Encap type MTU
-----------------------------------------------------------------------------------------------------------
Tunnel101 up 10.0.0.1/31 GRE/IP 1476
Tunnel102 down -- IPIP/IP 1480
Original file line number Diff line number Diff line change
Expand Up @@ -652,14 +652,14 @@ parsed_sample:
protocol: ""
- interface: "Eth1/51"
vrf: ""
status: "down"
status: "up"
ip: ""
speed: "10G(D)"
mtu: ""
vlan: "1"
type: "eth"
mode: "access"
reason: "SFP not inserted"
mode: "f-path"
reason: "none"
portch: "--"
description: ""
protocol: ""
Expand All @@ -676,6 +676,19 @@ parsed_sample:
portch: "--"
description: ""
protocol: ""
- interface: "Eth1/52.111"
vrf: ""
status: "down"
ip: ""
speed: "10G(D)"
mtu: ""
vlan: "111"
type: "eth"
mode: "routed"
reason: "none"
portch: "--"
description: ""
protocol: ""
- interface: "Po100"
vrf: ""
status: "down"
Expand All @@ -692,7 +705,7 @@ parsed_sample:
- interface: "mgmt0"
vrf: "--"
status: "down"
ip: "1.2.3.4"
ip: "--"
speed: "--"
mtu: "1500"
vlan: ""
Expand All @@ -715,3 +728,29 @@ parsed_sample:
portch: ""
description: ""
protocol: ""
- interface: "Tunnel101"
vrf: ""
status: "up"
ip: "10.0.0.1/31"
speed: ""
mtu: "1476"
vlan: ""
type: "GRE/IP"
mode: ""
reason: ""
portch: ""
description: ""
protocol: ""
- interface: "Tunnel102"
vrf: ""
status: "down"
ip: "--"
speed: ""
mtu: "1480"
vlan: ""
type: "IPIP/IP"
mode: ""
reason: ""
portch: ""
description: ""
protocol: ""

0 comments on commit ef2e7d6

Please sign in to comment.