-
Notifications
You must be signed in to change notification settings - Fork 698
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Template: (IOS) show_ip_bgp_neighbors_advertised_routes (#674)
- Loading branch information
1 parent
70fed0a
commit 1068e31
Showing
4 changed files
with
133 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
templates/cisco_ios_show_ip_bgp_neighbors_advertised_routes.textfsm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...o_ios/show_ip_bgp_neighbors_advertised_routes/show_ip_bgp_neighbors_advertised_routes.raw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
72 changes: 72 additions & 0 deletions
72
...o_ios/show_ip_bgp_neighbors_advertised_routes/show_ip_bgp_neighbors_advertised_routes.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |