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

Enhancement - EOS|NXOS - sh ip route add capturing of VRF #521

Merged
merged 4 commits into from
Oct 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion templates/arista_eos_show_ip_route.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Value Filldown VRF (\S+)
Value Filldown PROTOCOL (\S+\s\S+?|\w?)
Value Filldown NETWORK (\d+.\d+.\d+.\d+)
Value Filldown MASK (\d+)
Expand All @@ -8,4 +9,11 @@ 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}$$ -> Next.Record
^\s+${PROTOCOL}\s+${NETWORK}/${MASK}\s+(?:\[${DISTANCE}/${METRIC}\]|is\s+${DIRECT})(?:.+?)${NEXT_HOP},\s+${INTERFACE}$$ -> Record
^VRF:\s+${VRF}\s*$$
^Codes:
# Match for codes
^\s+\S+\s+-\s+\S+
^Gateway\s+of\s+last
^\s*$$
^. -> Error
8 changes: 7 additions & 1 deletion templates/cisco_nxos_show_ip_route.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Value Filldown VRF (\S+)
Value PROTOCOL ([\w-]+)
Value TYPE ([\w-]+)
Value Filldown NETWORK (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})
Expand All @@ -14,6 +15,7 @@ Value TUNNELID (0x[a-f\d]+)
Value ENCAP (\w+)

Start
^IP\s+Route\s+Table\s+for\s+VRF\s+"${VRF}"\s*$$
# Match the Network/Prefix Line
^\s*${NETWORK}\/${MASK}, ubest/mbest:
#
Expand All @@ -37,5 +39,9 @@ Start
#
# Match route without a nexthop IP, only nexthop interface (e.g. null routes)
^\s+\*+via ${NEXTHOP_IF}, \[${DISTANCE}\/${METRIC}\], ${UPTIME}, ${PROTOCOL} -> Record
^'\S+'\s+denotes\s
^'%<string>'
^\s*$$
^. -> Error

EOF
EOF
58 changes: 38 additions & 20 deletions tests/arista_eos/show_ip_route/arista_eos_show_ip_route.parsed
Original file line number Diff line number Diff line change
@@ -1,155 +1,173 @@
---
parsed_sample:
- direct: ''
- vrf: ''
direct: ''
distance: '200'
interface: Ethernet18
mask: '32'
metric: '0'
network: 10.1.31.100
next_hop: 192.168.17.5
protocol: B E
- direct: ''
- vrf: ''
direct: ''
distance: '200'
interface: Ethernet18
mask: '32'
metric: '0'
network: 10.1.31.101
next_hop: 192.168.17.5
protocol: B E
- direct: directly
- vrf: ''
direct: directly
distance: ''
interface: Loopback100
mask: '32'
metric: ''
network: 10.1.31.102
next_hop: connected
protocol: C
- direct: directly
- vrf: ''
direct: directly
distance: ''
interface: Loopback10
mask: '32'
metric: ''
network: 10.1.31.200
next_hop: connected
protocol: C
- direct: ''
- vrf: ''
direct: ''
distance: '200'
interface: Ethernet18
mask: '32'
metric: '0'
network: 10.1.31.254
next_hop: 192.168.17.5
protocol: B E
- direct: directly
- vrf: ''
direct: directly
distance: ''
interface: Ethernet20
mask: '30'
metric: ''
network: 10.63.255.8
next_hop: connected
protocol: C
- direct: ''
- vrf: ''
direct: ''
distance: '200'
interface: Ethernet18
mask: '30'
metric: '0'
network: 10.100.22.52
next_hop: 192.168.17.5
protocol: B E
- direct: ''
- vrf: ''
direct: ''
distance: '200'
interface: Ethernet18
mask: '30'
metric: '0'
network: 10.100.22.56
next_hop: 192.168.17.5
protocol: B E
- direct: ''
- vrf: ''
direct: ''
distance: '200'
interface: Ethernet18
mask: '32'
metric: '0'
network: 10.100.233.11
next_hop: 192.168.17.5
protocol: B E
- direct: ''
- vrf: ''
direct: ''
distance: '200'
interface: Ethernet18
mask: '32'
metric: '0'
network: 10.100.233.12
next_hop: 192.168.17.5
protocol: B E
- direct: ''
- vrf: ''
direct: ''
distance: '200'
interface: Ethernet18
mask: '32'
metric: '0'
network: 10.100.233.15
next_hop: 192.168.17.5
protocol: B E
- direct: directly
- vrf: ''
direct: directly
distance: ''
interface: Loopback0
mask: '32'
metric: ''
network: 10.100.233.32
next_hop: connected
protocol: C
- direct: ''
- vrf: ''
direct: ''
distance: '200'
interface: Ethernet21
mask: '32'
metric: '0'
network: 10.100.233.34
next_hop: 192.168.38.5
protocol: B E
- direct: ''
- vrf: ''
direct: ''
distance: '200'
interface: Ethernet18
mask: '32'
metric: '0'
network: 10.100.233.50
next_hop: 192.168.17.5
protocol: B E
- direct: ''
- vrf: ''
direct: ''
distance: '200'
interface: Ethernet18
mask: '32'
metric: '0'
network: 10.100.233.64
next_hop: 192.168.17.5
protocol: B E
- direct: ''
- vrf: ''
direct: ''
distance: '200'
interface: Ethernet18
mask: '32'
metric: '0'
network: 10.100.233.66
next_hop: 192.168.17.5
protocol: B E
- direct: ''
- vrf: ''
direct: ''
distance: '200'
interface: Ethernet18
mask: '32'
metric: '0'
network: 10.100.233.67
next_hop: 192.168.17.5
protocol: B E
- direct: ''
- vrf: ''
direct: ''
distance: '200'
interface: Ethernet18
mask: '32'
metric: '0'
network: 10.100.233.68
next_hop: 192.168.17.5
protocol: B E
- direct: ''
- vrf: ''
direct: ''
distance: '200'
interface: Ethernet20
mask: '32'
metric: '0'
network: 10.100.233.192
next_hop: 10.63.255.10
protocol: B E

Loading