Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arista_eos_show_ip_route parse exception #811

Closed
centove opened this issue Oct 7, 2020 · 3 comments
Closed

arista_eos_show_ip_route parse exception #811

centove opened this issue Oct 7, 2020 · 3 comments

Comments

@centove
Copy link

centove commented Oct 7, 2020

  • Bug Report
TEMPLATE USING
Value Filldown VRF (\S+)
Value Filldown PROTOCOL (\S+\s\S+?|\w?)
Value Filldown NETWORK (\d+.\d+.\d+.\d+)
Value Filldown MASK (\d+)
Value Filldown DISTANCE (\d+)
Value Filldown METRIC (\d+)
Value DIRECT (directly)
Value Required NEXT_HOP (connected|\d+\.\d+\.\d+\.\d+)
Value INTERFACE (\S+)

Start
  ^\s+${PROTOCOL}\s+${NETWORK}/${MASK}\s+(?:\[${DISTANCE}/${METRIC}\]|is\s+${DIRECT})(?:.+?)${NEXT_HOP},\s+${INTERFACE}$$ -> Record
  ^\s+via\s+${NEXT_HOP},\s+${INTERFACE} -> Record
  ^VRF\s+name:\s+${VRF}\s*$$
  ^VRF:\s+${VRF}\s*$$
  ^WARNING
  ^kernel
  ^Codes:
  # Match for codes
  ^\s+\S+\s+-\s+\S+
  ^Gateway\s+of\s+last
  ^\s*$$
  ^. -> Error

SAMPLE COMMAND OUTPUT
VRF: default
Codes: C - connected, S - static, K - kernel, 
       O - OSPF, IA - OSPF inter area, E1 - OSPF external type 1,
       E2 - OSPF external type 2, N1 - OSPF NSSA external type 1,
       N2 - OSPF NSSA external type2, B - BGP, B I - iBGP, B E - eBGP,
       R - RIP, I L1 - IS-IS level 1, I L2 - IS-IS level 2,
       O3 - OSPFv3, A B - BGP Aggregate, A O - OSPF Summary,
       NG - Nexthop Group Static Route, V - VXLAN Control Service,
       DH - DHCP client installed default route, M - Martian,
       DP - Dynamic Policy Route, L - VRF Leaked

 C        162.220.49.0/26 is directly connected, Vlan105
 C        162.220.49.64/26 is directly connected, Vlan104
 C        162.220.49.128/31 is directly connected, Tunnel11, Static Interface GRE tunnel index 11, dst 184.170.244.12, src 216.201.90.212
 B I      162.220.49.130/31 [200/0] via 199.229.255.1, Vlan50
 B I      162.220.49.132/31 [200/0] via 199.229.255.1, Vlan50
 C        162.220.49.134/31 is directly connected, Tunnel12, Static Interface GRE tunnel index 12, dst 104.200.133.181, src 216.201.90.212
 S        162.220.49.0/24 is directly connected, Null0



SUMMARY
Get an exception trying to parse the above with the arista_show_ip_route template
textfsm.parser.TextFSMError: State Error raised. Rule Line: 23. Input Line:  C        162.220.49.128/31 is directly connected, Tunnel11, Static Interface GRE tunnel index 11, dst 184.170.244.12, src 216.201.90.212
##### STEPS TO REPRODUCE

show IP route <prefix> longer-prefixes and have a gre tunnel route in the output

EXPECTED RESULTS

Parsed output.

ACTUAL RESULTS
textfsm.parser.TextFSMError: State Error raised. Rule Line: 23. Input Line:  C        162.220.49.128/31 is directly connected, Tunnel11, Static Interface GRE tunnel index 11, dst 184.170.244.12, src 216.201.90.212
@itdependsnetworks
Copy link
Contributor

I have updated the comment to better format the output.

@diepes
Copy link
Contributor

diepes commented Dec 9, 2020

PR #843 - nexthop ip/int changed to List, not parsing details in tunnel nexthop, just extracting it.

@FragmentedPacket
Copy link
Contributor

Fixed via #843, not confirmed by user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants