Debian Codegraph @

ntc_templates/templates/cisco_ios_show_ip_bgp_neighbors.textfsm

raw
1 Value NEIGHBOR (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})
2 Value VRF (\S+)
3 Value REMOTE_AS (\d+)
4 Value PEER_GROUP (\S+)
5 Value REMOTE_ROUTER_ID (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})
6 Value BGP_STATE (\w+)
7 Value LOCALHOST_IP (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})
8 Value LOCALHOST_PORT (\d+)
9 Value REMOTE_IP (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})
10 Value REMOTE_PORT (\d+)
11 Value INBOUND_ROUTEMAP (\S+)
12 Value OUTBOUND_ROUTEMAP (\S+)
13
14 Start
15 # Capture first line, which shows the BGP neighor and remote AS number
16 ^BGP\s+neighbor\s+is -> Continue.Record
17 ^BGP\s+neighbor\s+is\s+${NEIGHBOR},(\s+vrf\s+${VRF},)?\s+remote\s+AS\s+${REMOTE_AS}
18 # Capture BGP peer group
19 # Example: 'Member of peer-group RR_SERVERS for session parameters'
20 ^\s*Member\s+of\s+peer-group\s+${PEER_GROUP}
21 #
22 # Capture remote router ID
23 # Example: ' BGP state = Established, up for 7w3d'
24 ^.+remote\s+router\s+ID\s+${REMOTE_ROUTER_ID}
25 #
26 # Capture BGP state
27 # Example: ' BGP state = Established, up for 7w3d'
28 ^\s+BGP\s+state\s+=\s+${BGP_STATE}
29 #
30 # Capture Inbound/Outbound Route Maps
31 # Example: 'Route map for incoming advertisements is BGP_Vendor_in'
32 # Example: 'Route map for outgoing advertisements is BGP_Vendor_out'
33 ^\s+Route\s+map\s+for\s+incoming\s+advertisements\s+is\s+${INBOUND_ROUTEMAP}
34 ^\s+Route\s+map\s+for\s+outgoing\s+advertisements\s+is\s+${OUTBOUND_ROUTEMAP}
35 #
36 # Match local host and port
37 # Example: 'Local host: 10.10.255.13, Local port: 39443'
38 ^Local\s+host:\s+${LOCALHOST_IP},\s+Local\s+port:\s+${LOCALHOST_PORT}
39 #
40 # Match local host and port
41 # Example: 'Local host: 10.10.255.13, Local port: 39443'
42 ^Foreign\s+host:\s+${REMOTE_IP},\s+Foreign\s+port:\s+${REMOTE_PORT}
43 #^.+ -> Error