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

Modify cisco_asa_show_route template to include VPN routes #1977

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
9 changes: 8 additions & 1 deletion ntc_templates/templates/cisco_asa_show_route.textfsm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Value Filldown PROTOCOL (C|S|R|B|D|O|i|L)
Value Filldown PROTOCOL (C|S|R|B|D|O|i|L|V)
Value Filldown TYPE (\w{0,2})
Value Required,Filldown NETWORK (\d+\.\d+\.\d+\.\d+|\S+)
Value Filldown NETMASK (\d+\.\d+\.\d+\.\d+)
Expand Down Expand Up @@ -35,6 +35,13 @@ ROUTES
^${PROTOCOL}(\*){0,1}\s${TYPE}\s+${NETWORK}\s+${NETMASK}\sis\sdirectly\sconnected,\s${NEXTHOPIF} -> Record
^\s+is\sdirectly\sconnected,\s${NEXTHOPIF} -> Record
#
# Match VPN routes
^${PROTOCOL}\s${TYPE}\s+${NETWORK}\s${NETMASK}\sconnected\sby\sVPN\s\(advertised\),\s${NEXTHOPIF}\s*$$ -> Record
#
# Match multiline VPN routes
^${PROTOCOL}\s${TYPE}\s+${NETWORK}\s${NETMASK}\s*$$ -> Continue
^\s+connected\sby\sVPN\s\(advertised\),\s${NEXTHOPIF}\s*$$ -> Record
#
# Clear all variables on empty lines
^\s*$$ -> Clearall
#^${TYPE} -> Continue.Record
Expand Down
18 changes: 18 additions & 0 deletions tests/cisco_asa/show_route/cisc_asa_show_route_vpn.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, V - VPN
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, + - replicated route
Gateway of last resort is 10.3.0.1 to network 0.0.0.0

V 10.1.24.0 255.255.255.0 connected by VPN (advertised), external
V 10.2.2.4 255.255.255.255 connected by VPN (advertised), external
V 10.2.2.5 255.255.255.255 connected by VPN (advertised), external
V 10.2.2.132 255.255.255.255
connected by VPN (advertised), external
V 10.2.2.232 255.255.255.255
connected by VPN (advertised), external
V 10.2.2.253 255.255.255.255
connected by VPN (advertised), external
56 changes: 56 additions & 0 deletions tests/cisco_asa/show_route/cisc_asa_show_route_vpn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
parsed_sample:
- distance: ""
metric: ""
netmask: "255.255.255.0"
network: "10.1.24.0"
nexthopif: "external"
nexthopip: ""
protocol: "V"
type: ""
uptime: ""
- distance: ""
metric: ""
netmask: "255.255.255.255"
network: "10.2.2.4"
nexthopif: "external"
nexthopip: ""
protocol: "V"
type: ""
uptime: ""
- distance: ""
metric: ""
netmask: "255.255.255.255"
network: "10.2.2.5"
nexthopif: "external"
nexthopip: ""
protocol: "V"
type: ""
uptime: ""
- distance: ""
metric: ""
netmask: "255.255.255.255"
network: "10.2.2.132"
nexthopif: "external"
nexthopip: ""
protocol: "V"
type: ""
uptime: ""
- distance: ""
metric: ""
netmask: "255.255.255.255"
network: "10.2.2.232"
nexthopif: "external"
nexthopip: ""
protocol: "V"
type: ""
uptime: ""
- distance: ""
metric: ""
netmask: "255.255.255.255"
network: "10.2.2.253"
nexthopif: "external"
nexthopip: ""
protocol: "V"
type: ""
uptime: ""