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

New Template: (IOS) show_ip_bgp_neighbors_advertised_routes #674

Merged
merged 3 commits into from
May 19, 2020
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Value Filldown STATUS ([bdhimrsSx*>])
Value Filldown PATH_SELECTION ([bdhimrsSx*> ])
Value Filldown ROUTE_SOURCE ([bdhimrsSx*> ])
Value Filldown NETWORK (\S{0,18})
Value Required NEXT_HOP (\S{0,19})
Value Filldown METRIC (\S{0,6})
Value LOCAL_PREF (\S{0,6})
Value WEIGHT (\S{0,6})
Value AS_PATH (.*?)
Value ORIGIN ([ie\?])

Start
# Since using mostly position, play it safe and ensure we see header first
^\s+Network\s+Next Hop\s+Metric\s+LocPrf\s+Weight\s+Path -> Bgp_table
# Capture time-stamp if vty line has command time-stamping turned on
^Load\s+for\s+
^Time\s+source\s+is

Bgp_table
#
#
# Match if subnet is 17,18 characters long, creates two lines
# Example: *>i 10.104.192.208/29
^\s{0,1}${STATUS}${PATH_SELECTION}${ROUTE_SOURCE}\s{0,2}(?=${NETWORK}).{17,18}$$ -> Next
#
#
# Compliment to previous, status, path_selection, route_source, network is filldown.
# Example: 200.200.186.194 0 100 50000 64801 64808 64608 64601 64787 i
^\s{20,25}(?=${NEXT_HOP}).{19}\s(?=\s{0,6}${METRIC}).{6}\s(?=\s{0,6}${LOCAL_PREF}).{6}\s(?=\s{0,6}${WEIGHT}).{6}\s*${AS_PATH}\s*${ORIGIN}$$ -> Record
#
#
# Match first when there is no network, since previous line had it already (compliment and filldown below)
# Example: *> 0.0.0.0 0 32768 i
^\s{0,1}${STATUS}${PATH_SELECTION}${ROUTE_SOURCE}\s{0,2}\s{16}\s(?=${NEXT_HOP}).{19}\s(?=\s{0,6}${METRIC}).{6}\s(?=\s{0,6}${LOCAL_PREF}).{6}\s(?=\s{0,6}${WEIGHT}).{6}\s*${AS_PATH}\s*${ORIGIN}$$ -> Record
#
#
# Full normal example. metric, and as_path might not exist, regex defaults to blank line.
# Example: * i172.16.1.0/24 172.16.1.2 0 100 0 i
^\s{0,1}${STATUS}${PATH_SELECTION}${ROUTE_SOURCE}\s{0,2}(?=${NETWORK}).{16}\s(?=${NEXT_HOP}).{19}\s(?=\s{0,6}${METRIC}).{6}\s(?=\s{0,6}${LOCAL_PREF}).{6}\s(?=\s{0,6}${WEIGHT}).{6}\s*${AS_PATH}\s*${ORIGIN}$$ -> Record
^Total\s+number\s+of\s+prefixes
^\s*$$
^. -> Error
1 change: 1 addition & 0 deletions templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ cisco_asa_dir.textfsm, .*, cisco_asa, dir
cisco_ios_show_module.textfsm:cisco_ios_show_module_status.textfsm:cisco_ios_show_module_submodule.textfsm:cisco_ios_show_module_online_diag.textfsm, .*, cisco_ios, sh[[ow]] mod[[ule]]
cisco_ios_show_switch_detail.textfsm:cisco_ios_show_switch_detail_stack_ports.textfsm, .*, cisco_ios, sh[[ow]] sw[[itch]] d[[etail]]
cisco_ios_show_running-config_partition_access-list.textfsm, .*, cisco_ios, sh[[ow]] ru[[nning-config]] p[[artition]] a[[ccess-list]]
cisco_ios_show_ip_bgp_neighbors_advertised_routes.textfsm, .*, cisco_ios, sh[[ow]] ip bgp nei[[ghbors]] adv[[ertised-routes]]
cisco_ios_show_running-config_partition_route-map.textfsm, .*, cisco_ios, sh[[ow]] ru[[nning-config]] p[[artition]] route-[[map]]
cisco_ios_show_capability_feature_routing.textfsm, .*, cisco_ios, sh[[ow]] cap[[ability]] f[[eature]] r[[outing]]
cisco_ios_show_ip_ospf_database_network.textfsm, .*, cisco_ios, sh[[ow]] ip ospf data[[base]] ne[[twork]]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
BGP table version is 143173748, local router ID is 192.168.88.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
t secondary path,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

Network Next Hop Metric LocPrf Weight Path
*> 113.55.45.0/24 0.0.0.0 32768 i
*> 113.55.48.0/24 0.0.0.0 32768 i
*> 113.55.50.0/24 0.0.0.0 32768 i
*> 113.55.51.0/24 0.0.0.0 32768 i
*> 113.55.53.0/24 0.0.0.0 32768 i
*> 113.55.54.0/24 0.0.0.0 32768 i
*> 113.55.58.0/24 0.0.0.0 32768 i

Total number of prefixes 7
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
parsed_sample:
- status: "*"
path_selection: ">"
route_source: " "
network: "113.55.45.0/24"
next_hop: "0.0.0.0"
metric: ""
local_pref: ""
weight: "32768"
as_path: ""
origin: "i"
- status: "*"
path_selection: ">"
route_source: " "
network: "113.55.48.0/24"
next_hop: "0.0.0.0"
metric: ""
local_pref: ""
weight: "32768"
as_path: ""
origin: "i"
- status: "*"
path_selection: ">"
route_source: " "
network: "113.55.50.0/24"
next_hop: "0.0.0.0"
metric: ""
local_pref: ""
weight: "32768"
as_path: ""
origin: "i"
- status: "*"
path_selection: ">"
route_source: " "
network: "113.55.51.0/24"
next_hop: "0.0.0.0"
metric: ""
local_pref: ""
weight: "32768"
as_path: ""
origin: "i"
- status: "*"
path_selection: ">"
route_source: " "
network: "113.55.53.0/24"
next_hop: "0.0.0.0"
metric: ""
local_pref: ""
weight: "32768"
as_path: ""
origin: "i"
- status: "*"
path_selection: ">"
route_source: " "
network: "113.55.54.0/24"
next_hop: "0.0.0.0"
metric: ""
local_pref: ""
weight: "32768"
as_path: ""
origin: "i"
- status: "*"
path_selection: ">"
route_source: " "
network: "113.55.58.0/24"
next_hop: "0.0.0.0"
metric: ""
local_pref: ""
weight: "32768"
as_path: ""
origin: "i"