Skip to content

Commit

Permalink
New Template: cisco_ios_show_ip_bgp_neighbors.textfsm (#590)
Browse files Browse the repository at this point in the history
  • Loading branch information
FragmentedPacket authored Feb 4, 2020
1 parent fcf200a commit 0c1d3b1
Show file tree
Hide file tree
Showing 6 changed files with 1,480 additions and 0 deletions.
35 changes: 35 additions & 0 deletions templates/cisco_ios_show_ip_bgp_neighbors.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Value NEIGHBOR (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})
Value REMOTE_AS (\d+)
Value PEER_GROUP (\S+)
Value REMOTE_ROUTER_ID (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})
Value BGP_STATE (\w+)
Value LOCALHOST_IP (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})
Value LOCALHOST_PORT (\d+)
Value REMOTE_IP (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})
Value REMOTE_PORT (\d+)

Start
# Capture first line, which shows the BGP neighor and remote AS number
^BGP\s+neighbor\s+is -> Continue.Record
^BGP\s+neighbor\s+is\s+${NEIGHBOR},\s+remote\s+AS\s+${REMOTE_AS}
# Capture BGP peer group
# Example: 'Member of peer-group RR_SERVERS for session parameters'
^\s*Member\s+of\s+peer-group\s+${PEER_GROUP}
#
# Capture remote router ID
# Example: ' BGP state = Established, up for 7w3d'
^.+remote\s+router\s+ID\s+${REMOTE_ROUTER_ID}
#
# Capture BGP state
# Example: ' BGP state = Established, up for 7w3d'
^\s+BGP\s+state\s+=\s+${BGP_STATE}
#
#
# Match local host and port
# Example: 'Local host: 10.10.255.13, Local port: 39443'
^Local\s+host:\s+${LOCALHOST_IP},\s+Local\s+port:\s+${LOCALHOST_PORT}
#
# Match local host and port
# Example: 'Local host: 10.10.255.13, Local port: 39443'
^Foreign\s+host:\s+${REMOTE_IP},\s+Foreign\s+port:\s+${REMOTE_PORT}
#^.+ -> Error
1 change: 1 addition & 0 deletions templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ cisco_ios_show_interfaces_status.textfsm, .*, cisco_ios, sh[[ow]] int[[erfaces]]
cisco_ios_show_ip_eigrp_topology.textfsm, .*, cisco_ios, sh[[ow]] ip eigrp top[[ology]]
cisco_ios_show_ip_source_binding.textfsm, .*, cisco_ios, sh[[ow]] ip sou[[rce]] b[[inding]]
cisco_ios_show_mac-address-table.textfsm, .*, cisco_ios, sh[[ow]] m[[ac-address-table]]
cisco_ios_show_ip_bgp_neighbors.textfsm, .*, cisco_ios, sh[[ow]] ip bgp nei[[ghbors]]
cisco_ios_show_ip_ospf_database.textfsm, .*, cisco_ios, sh[[ow]] ip ospf data[[base]]
cisco_ios_show_ip_ospf_neighbor.textfsm, .*, cisco_ios, sh[[ow]] ip ospf nei[[ghbor]]
cisco_ios_show_ip_access-lists.textfsm, .*, cisco_ios, sh[[ow]] ip acce[[ss-lists]]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
BGP neighbor is 20.30.255.14, remote AS 1255, internal link
Member of peer-group RR_SERVERS for session parameters
BGP version 4, remote router ID 20.40.1.1
BGP state = Established, up for 7w3d
Last read 00:00:24, last write 00:00:22, hold time is 180, keepalive interval is 60 seconds
Neighbor sessions:
1 active, is not multisession capable (disabled)
Neighbor capabilities:
Route refresh: advertised and received(new)
Four-octets ASN Capability: advertised and received
Address family IPv4 Unicast: advertised and received
Multisession Capability:
Message statistics:
InQ depth is 0
OutQ depth is 0

Sent Rcvd
Opens: 1 1
Notifications: 0 0
Updates: 1 94
Keepalives: 83823 84638
Route Refresh: 0 0
Total: 83825 84733
Default minimum time between advertisement runs is 0 seconds

For address family: IPv4 Unicast
Session: 20.30.255.14
BGP table version 270, neighbor version 270/0
Output queue size : 0
Index 1, Advertise bit 0
1 update-group member
RR_SERVERS peer-group member
Inbound soft reconfiguration allowed
Slow-peer detection is disabled
Slow-peer split-update-group dynamic is disabled
Sent Rcvd
Prefix activity: ---- ----
Prefixes Current: 0 113 (Consumes 6328 bytes)
Prefixes Total: 0 217
Implicit Withdraw: 0 52
Explicit Withdraw: 0 52
Used as bestpath: n/a 113
Used as multipath: n/a 0

Outbound Inbound
Local Policy Denied Prefixes: -------- -------
Bestpath from this peer: 217 n/a
Invalid Path: 52 n/a
Total: 269 0
Number of NLRIs in the update sent: max 0, min 0
Last detected as dynamic slow peer: never
Dynamic slow peer recovered: never

Address tracking is enabled, the RIB does have a route to 20.30.255.14
Connections established 1; dropped 0
Last reset never
Transport(tcp) path-mtu-discovery is enabled
Graceful-Restart is disabled
Connection state is ESTAB, I/O status: 1, unread input bytes: 0
Connection is ECN Disabled, Mininum incoming TTL 0, Outgoing TTL 255
Local host: 20.30.255.13, Local port: 39443
Foreign host: 20.30.255.14, Foreign port: 179
Connection tableid (VRF): 0
Maximum output segment queue size: 50

Enqueued packets for retransmit: 0, input: 0 mis-ordered: 0 (0 bytes)

Event Timers (current time is 0x1106B0BD8):
Timer Starts Wakeups Next
Retrans 83827 1 0x0
TimeWait 0 0 0x0
AckHold 84719 83274 0x0
SendWnd 0 0 0x0
KeepAlive 0 0 0x0
GiveUp 0 0 0x0
PmtuAger 1 1 0x0
DeadWait 0 0 0x0
Linger 0 0 0x0
ProcessQ 0 0 0x0

iss: 3730243128 snduna: 3731835842 sndnxt: 3731835842
irs: 2485586108 rcvnxt: 2487200336

sndwnd: 33561 scale: 0 maxrcvwnd: 16384
rcvwnd: 16099 scale: 0 delrcvwnd: 285

SRTT: 1000 ms, RTTO: 1003 ms, RTV: 3 ms, KRTT: 0 ms
minRTT: 0 ms, maxRTT: 1000 ms, ACK hold: 200 ms
Status Flags: active open
Option Flags: nagle, path mtu capable, SACK option permitted
IP Precedence value : 6

Datagrams (max data segment is 1460 bytes):
Rcvd: 168543 (out of order: 0), with data: 84718, total data bytes:41614227
Sent: 168204 (retransmit: 1, fastretransmit: 0, partialack: 0, Second Congestion: 0), with data: 83825, total data bytes: 1592713
Packets received in fast path: 0, fast processed: 0, slow path: 0
fast lock acquisition failures: 0, slow path: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
parsed_sample:
- neighbor: "20.30.255.14"
remote_as: "1255"
peer_group: "RR_SERVERS"
remote_router_id: "20.40.1.1"
bgp_state: "Established"
localhost_ip: "20.30.255.13"
localhost_port: "39443"
remote_ip: "20.30.255.14"
remote_port: "179"
Loading

0 comments on commit 0c1d3b1

Please sign in to comment.