napalm-automation / napalm

Network Automation and Programmability Abstraction Layer with Multivendor support
Apache License 2.0
2.25k stars 555 forks source link

Issue with BGP neighbors status #573

Open natieitan opened 6 years ago

natieitan commented 6 years ago

I'm using napalm to show and change BGP configuration. I noticed that it always shows 'true' under 'us_up' even if the neighbor is down. I saw on the code, the following:

Uptime should be -1 if BGP session not up

        is_up = True if uptime >= 0 else False

If a neighbor is down there's still a number there, for example: Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 10.0.0.10 4 11055 24061 24287 22 0 0 2w1d 11 10.0.0.14 4 11055 0 0 1 0 0 00:19:49 Idle

Before using napalm I did it in another way, I tracked the last column, true if it's a number, false if it's not, that should be the accurate way

The function:

def represents_int(s): try: int(s) return True except ValueError: return False

The code for the actual check:

                            if represents_int(line.split()[9]):
                                lines_status[isp['name']][4] = 'UP'
                            else:
                                lines_status[isp['name']][4] = 'DOWN'

line - represent each line of the show command: 'show ip bgp sum'

natieitan commented 6 years ago

Hi,

Any chance someone can look at that?

dbarrosop commented 6 years ago

given that you seem to have the solution more or less figured out, would you mind sending a PR?

ktbyers commented 6 years ago

@natieitan Can you get me the output from these three commands?

show bgp ipv6 unicast neighbors
show bgp ipv4 unicast neighbors
show bgp all summary

and also the OS version and model number that the output came from.

natieitan commented 6 years ago

That's from my lab [it's easier to send that]: ROM: Bootstrap program is IOSv System image file is "flash0:/vios-adventerprisek9-m"

show bgp ipv6 unicast neighbors BGP neighbor is 2001:1900:2101::1, remote AS 11055, external link BGP version 4, remote router ID 192.168.0.2 BGP state = Established, up for 3w2d Last read 00:00:39, last write 00:00:19, 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 IPv6 Unicast: advertised and received Enhanced Refresh Capability: advertised and received Multisession Capability: Stateful switchover support enabled: NO for session 1 Message statistics: InQ depth is 0 OutQ depth is 0

                     Sent       Rcvd
Opens:                  1          1
Notifications:          0          0
Updates:                1          1
Keepalives:         37655      37295
Route Refresh:         46          0
Total:              37795      37389

Do log neighbor state changes (via global configuration) Default minimum time between advertisement runs is 30 seconds

For address family: IPv6 Unicast Session: 2001:1900:2101::1 BGP table version 1, neighbor version 1/0 Output queue size : 0 Index 1, Advertise bit 0 1 update-group member Inbound path policy configured Outbound path policy configured Route map for incoming advertisements is rcv-from-isp-gnsisp1_a-ipv6 Route map for outgoing advertisements is adv-to-isp-gnsisp1_a-ipv6 Slow-peer detection is disabled Slow-peer split-update-group dynamic is disabled Sent Rcvd Prefix activity: ---- ---- Prefixes Current: 0 0 Prefixes Total: 0 0 Implicit Withdraw: 0 0 Explicit Withdraw: 0 0 Used as bestpath: n/a 0 Used as multipath: n/a 0

                               Outbound    Inbound

Local Policy Denied Prefixes: -------- ------- Total: 0 0 Number of NLRIs in the update sent: max 0, min 0 Last detected as dynamic slow peer: never Dynamic slow peer recovered: never Refresh Epoch: 47 Last Sent Refresh Start-of-rib: 2w6d Last Sent Refresh End-of-rib: 2w6d Refresh-Out took 0 seconds Last Received Refresh Start-of-rib: 2w6d Last Received Refresh End-of-rib: 2w6d Refresh-In took 0 seconds Sent Rcvd Refresh activity: ---- ---- Refresh Start-of-RIB 46 46 Refresh End-of-RIB 46 46

Address tracking is enabled, the RIB does have a route to 2001:1900:2101::1 Connections established 1; dropped 0 Last reset never External BGP neighbor configured for connected checks (single-hop no-disable-connected-check) Interface associated: GigabitEthernet0/2 (peering address in same link) Transport(tcp) path-mtu-discovery is enabled Graceful-Restart is disabled SSO is disabled Connection state is ESTAB, I/O status: 1, unread input bytes: 0
Connection is ECN Disabled, Mininum incoming TTL 0, Outgoing TTL 1 Local host: 2001:1900:2101::2, Local port: 179 Foreign host: 2001:1900:2101::1, Foreign port: 15369 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 0x7A6CBF45): Timer Starts Wakeups Next Retrans 37748 0 0x0 TimeWait 0 0 0x0 AckHold 37343 36646 0x0 SendWnd 0 0 0x0 KeepAlive 0 0 0x0 GiveUp 0 0 0x0 PmtuAger 0 0 0x0 DeadWait 0 0 0x0 Linger 0 0 0x0 ProcessQ 0 0 0x0

iss: 591467561 snduna: 592186267 sndnxt: 592186267 irs: 2570404657 rcvnxt: 2571115465

sndwnd: 15434 scale: 0 maxrcvwnd: 16384 rcvwnd: 16137 scale: 0 delrcvwnd: 247

SRTT: 1000 ms, RTTO: 1003 ms, RTV: 3 ms, KRTT: 0 ms minRTT: 3 ms, maxRTT: 1000 ms, ACK hold: 200 ms uptime: 2053850878 ms, Sent idletime: 21220 ms, Receive idletime: 21012 ms Status Flags: passive open, gen tcbs Option Flags: nagle, path mtu capable IP Precedence value : 6

Datagrams (max data segment is 1440 bytes): Rcvd: 74959 (out of order: 0), with data: 37389, total data bytes: 710807 Sent: 74981 (retransmit: 0, fastretransmit: 0, partialack: 0, Second Congestion: 0), with data: 74981, total data bytes: 3717953

Packets received in fast path: 0, fast processed: 0, slow path: 0 fast lock acquisition failures: 0, slow path: 0 TCP Semaphore 0x101433B4 FREE

BGP neighbor is 2001:1900:2102::1, remote AS 11055, external link BGP version 4, remote router ID 192.168.0.2 BGP state = Established, up for 3w2d Last read 00:00:19, last write 00:00:18, 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 IPv6 Unicast: advertised and received Enhanced Refresh Capability: advertised and received Multisession Capability: Stateful switchover support enabled: NO for session 1 Message statistics: InQ depth is 0 OutQ depth is 0

                     Sent       Rcvd
Opens:                  1          1
Notifications:          0          0
Updates:                1          1
Keepalives:         37633      37285
Route Refresh:         46          0
Total:              37773      37379

Do log neighbor state changes (via global configuration) Default minimum time between advertisement runs is 30 seconds

For address family: IPv6 Unicast Session: 2001:1900:2102::1 BGP table version 1, neighbor version 1/0 Output queue size : 0 Index 17, Advertise bit 1 17 update-group member Inbound path policy configured Outbound path policy configured Route map for incoming advertisements is rcv-from-isp-gnsisp-ipv6 Route map for outgoing advertisements is adv-to-isp-gnsisp-ipv6 Slow-peer detection is disabled Slow-peer split-update-group dynamic is disabled Sent Rcvd Prefix activity: ---- ---- Prefixes Current: 0 0 Prefixes Total: 0 0 Implicit Withdraw: 0 0 Explicit Withdraw: 0 0 Used as bestpath: n/a 0 Used as multipath: n/a 0

                               Outbound    Inbound

Local Policy Denied Prefixes: -------- ------- Total: 0 0 Number of NLRIs in the update sent: max 0, min 0 Last detected as dynamic slow peer: never Dynamic slow peer recovered: never Refresh Epoch: 47 Last Sent Refresh Start-of-rib: 2w6d Last Sent Refresh End-of-rib: 2w6d Refresh-Out took 0 seconds Last Received Refresh Start-of-rib: 2w6d Last Received Refresh End-of-rib: 2w6d Refresh-In took 0 seconds Sent Rcvd Refresh activity: ---- ---- Refresh Start-of-RIB 46 46 Refresh End-of-RIB 46 46

Address tracking is enabled, the RIB does have a route to 2001:1900:2102::1 Connections established 1; dropped 0 Last reset never External BGP neighbor configured for connected checks (single-hop no-disable-connected-check) Interface associated: GigabitEthernet0/1 (peering address in same link) Transport(tcp) path-mtu-discovery is enabled Graceful-Restart is disabled SSO is disabled Connection state is ESTAB, I/O status: 1, unread input bytes: 0
Connection is ECN Disabled, Mininum incoming TTL 0, Outgoing TTL 1 Local host: 2001:1900:2102::2, Local port: 179 Foreign host: 2001:1900:2102::1, Foreign port: 29887 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 0x7A6CC17A): Timer Starts Wakeups Next Retrans 37726 0 0x0 TimeWait 0 0 0x0 AckHold 37333 36663 0x0 SendWnd 0 0 0x0 KeepAlive 0 0 0x0 GiveUp 0 0 0x0 PmtuAger 0 0 0x0 DeadWait 0 0 0x0 Linger 0 0 0x0 ProcessQ 0 0 0x0

iss: 274198149 snduna: 274916437 sndnxt: 274916437 irs: 3668552011 rcvnxt: 3669262629

sndwnd: 15871 scale: 0 maxrcvwnd: 16384 rcvwnd: 16327 scale: 0 delrcvwnd: 57

SRTT: 1000 ms, RTTO: 1003 ms, RTV: 3 ms, KRTT: 0 ms minRTT: 5 ms, maxRTT: 1000 ms, ACK hold: 200 ms uptime: 2053851465 ms, Sent idletime: 18712 ms, Receive idletime: 18492 ms Status Flags: passive open, gen tcbs Option Flags: nagle, path mtu capable IP Precedence value : 6

Datagrams (max data segment is 1440 bytes): Rcvd: 74933 (out of order: 0), with data: 37379, total data bytes: 710617 Sent: 74976 (retransmit: 0, fastretransmit: 0, partialack: 0, Second Congestion: 0), with data: 74976, total data bytes: 3717335

Packets received in fast path: 0, fast processed: 0, slow path: 0 fast lock acquisition failures: 0, slow path: 0 TCP Semaphore 0x10143424 FREE

natieitan commented 6 years ago

show bgp ipv4 unicast neighbors BGP neighbor is 10.0.0.10, remote AS 11055, external link Description: eBGP to ISP1 BGP version 4, remote router ID 192.168.0.2 BGP state = Established, up for 3w2d Last read 00:00:25, last write 00:00:35, 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 Enhanced Refresh Capability: advertised and received Multisession Capability: Stateful switchover support enabled: NO for session 1 Message statistics: InQ depth is 0 OutQ depth is 0

                     Sent       Rcvd
Opens:                  1          1
Notifications:          0          0
Updates:              191        196
Keepalives:         37634      37261
Route Refresh:         47          0
Total:              37921      37552

Do log neighbor state changes (via global configuration) Default minimum time between advertisement runs is 30 seconds

For address family: IPv4 Unicast Session: 10.0.0.10 BGP table version 22, neighbor version 22/0 Output queue size : 0 Index 57, Advertise bit 0 57 update-group member NEXT_HOP is always this router for eBGP paths Community attribute sent to this neighbor Inbound path policy configured Outbound path policy configured Route map for incoming advertisements is rcv-from-isp-gnsisp Route map for outgoing advertisements is adv-to-isp-gnsisp Slow-peer detection is disabled Slow-peer split-update-group dynamic is disabled Sent Rcvd Prefix activity: ---- ---- Prefixes Current: 13 11 (Consumes 880 bytes) Prefixes Total: 22 333 Implicit Withdraw: 9 322 Explicit Withdraw: 2 0 Used as bestpath: n/a 2 Used as multipath: n/a 0

                               Outbound    Inbound

Local Policy Denied Prefixes: -------- ------- route-map: 0 3 AS_PATH loop: n/a 235 Bestpath from this peer: 4 n/a Total: 4 238 Number of NLRIs in the update sent: max 4, min 0 Last detected as dynamic slow peer: never Dynamic slow peer recovered: never Refresh Epoch: 48 Last Sent Refresh Start-of-rib: 2w6d Last Sent Refresh End-of-rib: 2w6d Refresh-Out took 0 seconds Last Received Refresh Start-of-rib: 2w6d Last Received Refresh End-of-rib: 2w6d Refresh-In took 0 seconds Sent Rcvd Refresh activity: ---- ---- Refresh Start-of-RIB 26 47 Refresh End-of-RIB 22 47

Address tracking is enabled, the RIB does have a route to 10.0.0.10 Connections established 1; dropped 0 Last reset never External BGP neighbor configured for connected checks (single-hop no-disable-connected-check) Interface associated: GigabitEthernet0/1 (peering address in same link) Transport(tcp) path-mtu-discovery is enabled Graceful-Restart is disabled SSO is disabled Connection state is ESTAB, I/O status: 1, unread input bytes: 0
Connection is ECN Disabled, Mininum incoming TTL 0, Outgoing TTL 1 Local host: 10.0.0.9, Local port: 19878 Foreign host: 10.0.0.10, 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 0x7A6D3389): Timer Starts Wakeups Next Retrans 37733 0 0x0 TimeWait 0 0 0x0 AckHold 37319 36637 0x0 SendWnd 0 0 0x0 KeepAlive 0 0 0x0 GiveUp 0 0 0x0 PmtuAger 2046018 2046017 0x7A6D36EB DeadWait 0 0 0x0 Linger 0 0 0x0 ProcessQ 0 0 0x0

iss: 435348384 snduna: 436076492 sndnxt: 436076492 irs: 2646936128 rcvnxt: 2647658302

sndwnd: 16213 scale: 0 maxrcvwnd: 16384 rcvwnd: 15130 scale: 0 delrcvwnd: 1254

SRTT: 1000 ms, RTTO: 1003 ms, RTV: 3 ms, KRTT: 0 ms minRTT: 3 ms, maxRTT: 1000 ms, ACK hold: 200 ms uptime: 2053881780 ms, Sent idletime: 26152 ms, Receive idletime: 26354 ms Status Flags: active open Option Flags: nagle, path mtu capable IP Precedence value : 6

Datagrams (max data segment is 1460 bytes): Rcvd: 74943 (out of order: 0), with data: 37364, total data bytes: 722173 Sent: 74936 (retransmit: 0, fastretransmit: 0, partialack: 0, Second Congestion: 0), with data: 37759, total data bytes: 728107

Packets received in fast path: 0, fast processed: 0, slow path: 0 fast lock acquisition failures: 0, slow path: 0 TCP Semaphore 0x10143494 FREE

BGP neighbor is 10.0.0.14, remote AS 11055, external link Description: eBGP to ISP1 BGP version 4, remote router ID 0.0.0.0 BGP state = Idle Neighbor sessions: 0 active, is not multisession capable (disabled) Stateful switchover support enabled: NO Do log neighbor state changes (via global configuration) Default minimum time between advertisement runs is 30 seconds

For address family: IPv4 Unicast BGP table version 22, neighbor version 1/22 Output queue size : 0 Index 0, Advertise bit 0 NEXT_HOP is always this router for eBGP paths Community attribute sent to this neighbor Inbound path policy configured Outbound path policy configured Route map for incoming advertisements is rcv-from-isp-gnsisp1_a Route map for outgoing advertisements is adv-to-isp-gnsisp1_a Slow-peer detection is disabled Slow-peer split-update-group dynamic is disabled Sent Rcvd Prefix activity: ---- ---- Prefixes Current: 0 0 Prefixes Total: 0 0 Implicit Withdraw: 0 0 Explicit Withdraw: 0 0 Used as bestpath: n/a 0 Used as multipath: n/a 0

                               Outbound    Inbound

Local Policy Denied Prefixes: -------- ------- Total: 0 0 Number of NLRIs in the update sent: max 0, min 0 Last detected as dynamic slow peer: never Dynamic slow peer recovered: never Refresh Epoch: 1 Last Sent Refresh Start-of-rib: never Last Sent Refresh End-of-rib: never Last Received Refresh Start-of-rib: never Last Received Refresh End-of-rib: never Sent Rcvd Refresh activity: ---- ---- Refresh Start-of-RIB 0 0 Refresh End-of-RIB 0 0

Address tracking is enabled, the RIB does have a route to 10.0.0.14 Connections established 2; dropped 2 Last reset 1w1d, due to Active open failed External BGP neighbor configured for connected checks (single-hop no-disable-connected-check) Interface associated: GigabitEthernet0/2 (peering address NOT in same link) Transport(tcp) path-mtu-discovery is enabled Graceful-Restart is disabled SSO is disabled No active TCP connection

BGP neighbor is 10.0.1.10, remote AS 20010, external link BGP version 4, remote router ID 192.168.0.1 BGP state = Established, up for 3w2d Last read 00:00:28, last write 00:00:44, 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 Enhanced Refresh Capability: advertised and received Multisession Capability: Stateful switchover support enabled: NO for session 1 Message statistics: InQ depth is 0 OutQ depth is 0

                     Sent       Rcvd
Opens:                  1          1
Notifications:          0          0
Updates:              141        194
Keepalives:         37399      37425
Route Refresh:         46          0
Total:              37660      37714

Do log neighbor state changes (via global configuration) Default minimum time between advertisement runs is 30 seconds

For address family: IPv4 Unicast Session: 10.0.1.10 BGP table version 22, neighbor version 22/0 Output queue size : 0 Index 58, Advertise bit 2 58 update-group member Outbound path policy configured Incoming update prefix filter list is deny Outgoing update prefix filter list is deny Route map for outgoing advertisements is scrub-noexport-to-tunnel Slow-peer detection is disabled Slow-peer split-update-group dynamic is disabled Sent Rcvd Prefix activity: ---- ---- Prefixes Current: 0 11 (Consumes 880 bytes) Prefixes Total: 0 333 Implicit Withdraw: 0 322 Explicit Withdraw: 11 0 Used as bestpath: n/a 9 Used as multipath: n/a 0

                               Outbound    Inbound

Local Policy Denied Prefixes: -------- ------- AS_PATH loop: n/a 235 Other Policies: 26 n/a Total: 26 235 Number of NLRIs in the update sent: max 3, min 0 Last detected as dynamic slow peer: never Dynamic slow peer recovered: never Refresh Epoch: 48 Last Sent Refresh Start-of-rib: 2w6d Last Sent Refresh End-of-rib: 2w6d Refresh-Out took 0 seconds Last Received Refresh Start-of-rib: 2w6d Last Received Refresh End-of-rib: 2w6d Refresh-In took 0 seconds Sent Rcvd Refresh activity: ---- ---- Refresh Start-of-RIB 41 47 Refresh End-of-RIB 32 47

Address tracking is enabled, the RIB does have a route to 10.0.1.10 Connections established 1; dropped 0 Last reset never External BGP neighbor configured for connected checks (single-hop no-disable-connected-check) Interface associated: Tunnel20 (peering address in same link) Transport(tcp) path-mtu-discovery is enabled Graceful-Restart is disabled SSO is disabled Connection state is ESTAB, I/O status: 1, unread input bytes: 0
Connection is ECN Disabled, Mininum incoming TTL 0, Outgoing TTL 1 Local host: 10.0.1.11, Local port: 41927 Foreign host: 10.0.1.10, 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 0x7A6D3698): Timer Starts Wakeups Next Retrans 37495 3 0x0 TimeWait 0 0 0x0 AckHold 37479 36811 0x0 SendWnd 0 0 0x0 KeepAlive 0 0 0x0 GiveUp 0 0 0x0 PmtuAger 2032015 2032014 0x7A6D3786 DeadWait 0 0 0x0 Linger 0 0 0x0 ProcessQ 0 0 0x0

iss: 2536661299 snduna: 2537379703 sndnxt: 2537379703 irs: 1002134985 rcvnxt: 1002860508

sndwnd: 15700 scale: 0 maxrcvwnd: 16384 rcvwnd: 15225 scale: 0 delrcvwnd: 1159

SRTT: 1000 ms, RTTO: 1003 ms, RTV: 3 ms, KRTT: 0 ms minRTT: 8 ms, maxRTT: 1000 ms, ACK hold: 200 ms uptime: 2039815014 ms, Sent idletime: 28142 ms, Receive idletime: 28344 ms Status Flags: active open Option Flags: nagle, path mtu capable IP Precedence value : 6

Datagrams (max data segment is 1436 bytes): Rcvd: 74834 (out of order: 0), with data: 37525, total data bytes: 725522 Sent: 74887 (retransmit: 3, fastretransmit: 0, partialack: 0, Second Congestion: 0), with data: 37526, total data bytes: 718403

Packets received in fast path: 0, fast processed: 0, slow path: 0 fast lock acquisition failures: 0, slow path: 0 TCP Semaphore 0x101431F4 FREE

BGP neighbor is 10.0.2.10, remote AS 20010, external link BGP version 4, remote router ID 192.168.0.1 BGP state = Established, up for 3w2d Last read 00:00:37, last write 00:00:34, 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 Enhanced Refresh Capability: advertised and received Multisession Capability: Stateful switchover support enabled: NO for session 1 Message statistics: InQ depth is 0 OutQ depth is 0

                     Sent       Rcvd
Opens:                  1          1
Notifications:          0          0
Updates:               97        194
Keepalives:         37402      37427
Route Refresh:         46          0
Total:              37640      37714

Do log neighbor state changes (via global configuration) Default minimum time between advertisement runs is 30 seconds

For address family: IPv4 Unicast Session: 10.0.2.10 BGP table version 22, neighbor version 22/0 Output queue size : 0 Index 58, Advertise bit 2 58 update-group member Outbound path policy configured Incoming update prefix filter list is deny Outgoing update prefix filter list is deny Route map for outgoing advertisements is scrub-noexport-to-tunnel Slow-peer detection is disabled Slow-peer split-update-group dynamic is disabled Sent Rcvd Prefix activity: ---- ---- Prefixes Current: 0 11 (Consumes 880 bytes) Prefixes Total: 0 333 Implicit Withdraw: 0 322 Explicit Withdraw: 11 0 Used as bestpath: n/a 0 Used as multipath: n/a 0

                               Outbound    Inbound

Local Policy Denied Prefixes: -------- ------- AS_PATH loop: n/a 235 Other Policies: 26 n/a Total: 26 235 Number of NLRIs in the update sent: max 3, min 0 Last detected as dynamic slow peer: never Dynamic slow peer recovered: never Refresh Epoch: 47 Last Sent Refresh Start-of-rib: 2w6d Last Sent Refresh End-of-rib: 2w6d Refresh-Out took 0 seconds Last Received Refresh Start-of-rib: 2w6d Last Received Refresh End-of-rib: 2w6d Refresh-In took 0 seconds Sent Rcvd Refresh activity: ---- ---- Refresh Start-of-RIB 52 46 Refresh End-of-RIB 42 46

Address tracking is enabled, the RIB does have a route to 10.0.2.10 Connections established 1; dropped 0 Last reset never External BGP neighbor configured for connected checks (single-hop no-disable-connected-check) Interface associated: Tunnel21 (peering address in same link) Transport(tcp) path-mtu-discovery is enabled Graceful-Restart is disabled SSO is disabled Connection state is ESTAB, I/O status: 1, unread input bytes: 0
Connection is ECN Disabled, Mininum incoming TTL 0, Outgoing TTL 1 Local host: 10.0.2.11, Local port: 179 Foreign host: 10.0.2.10, Foreign port: 51306 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 0x7A6D3886): Timer Starts Wakeups Next Retrans 37497 0 0x0 TimeWait 0 0 0x0 AckHold 37479 36793 0x0 SendWnd 0 0 0x0 KeepAlive 0 0 0x0 GiveUp 0 0 0x0 PmtuAger 0 0 0x0 DeadWait 0 0 0x0 Linger 0 0 0x0 ProcessQ 0 0 0x0

iss: 2604653448 snduna: 2605370819 sndnxt: 2605370819 irs: 1859362525 rcvnxt: 1860088040

sndwnd: 15358 scale: 0 maxrcvwnd: 16384 rcvwnd: 15035 scale: 0 delrcvwnd: 1349

SRTT: 1000 ms, RTTO: 1003 ms, RTV: 3 ms, KRTT: 0 ms minRTT: 7 ms, maxRTT: 1000 ms, ACK hold: 200 ms uptime: 2039801887 ms, Sent idletime: 34852 ms, Receive idletime: 34641 ms Status Flags: passive open, gen tcbs Option Flags: nagle, path mtu capable IP Precedence value : 6

Datagrams (max data segment is 1436 bytes): Rcvd: 74847 (out of order: 0), with data: 37526, total data bytes: 725514 Sent: 74882 (retransmit: 0, fastretransmit: 0, partialack: 0, Second Congestion: 0), with data: 37539, total data bytes: 717370

Packets received in fast path: 0, fast processed: 0, slow path: 0 fast lock acquisition failures: 0, slow path: 0 TCP Semaphore 0x10143114 FREE

BGP neighbor is 192.168.0.4, remote AS 11054, internal link Description: iBGP peer DC1_asr2 BGP version 4, remote router ID 0.0.0.0 BGP state = Idle Neighbor sessions: 0 active, is not multisession capable (disabled) Stateful switchover support enabled: NO Do log neighbor state changes (via global configuration) Default minimum time between advertisement runs is 0 seconds

For address family: IPv4 Unicast BGP table version 22, neighbor version 1/22 Output queue size : 0 Index 0, Advertise bit 0 NEXT_HOP is always this router for eBGP paths Slow-peer detection is disabled Slow-peer split-update-group dynamic is disabled Sent Rcvd Prefix activity: ---- ---- Prefixes Current: 0 0 Prefixes Total: 0 0 Implicit Withdraw: 0 0 Explicit Withdraw: 0 0 Used as bestpath: n/a 0 Used as multipath: n/a 0

                               Outbound    Inbound

Local Policy Denied Prefixes: -------- ------- Total: 0 0 Number of NLRIs in the update sent: max 0, min 0 Last detected as dynamic slow peer: never Dynamic slow peer recovered: never Refresh Epoch: 1 Last Sent Refresh Start-of-rib: never Last Sent Refresh End-of-rib: never Last Received Refresh Start-of-rib: never Last Received Refresh End-of-rib: never Sent Rcvd Refresh activity: ---- ---- Refresh Start-of-RIB 0 0 Refresh End-of-RIB 0 0

Address tracking is enabled, the RIB does have a route to 192.168.0.4 Connections established 0; dropped 0 Last reset never Interface associated: (none) (peering address NOT in same link) Transport(tcp) path-mtu-discovery is enabled Graceful-Restart is disabled SSO is disabled No active TCP connection

BGP neighbor is 192.168.0.5, remote AS 11054, internal link Description: iBGP peer DC2_asr1 BGP version 4, remote router ID 0.0.0.0 BGP state = Idle Neighbor sessions: 0 active, is not multisession capable (disabled) Stateful switchover support enabled: NO Do log neighbor state changes (via global configuration) Default minimum time between advertisement runs is 0 seconds

For address family: IPv4 Unicast BGP table version 22, neighbor version 1/22 Output queue size : 0 Index 0, Advertise bit 0 NEXT_HOP is always this router for eBGP paths Slow-peer detection is disabled Slow-peer split-update-group dynamic is disabled Sent Rcvd Prefix activity: ---- ---- Prefixes Current: 0 0 Prefixes Total: 0 0 Implicit Withdraw: 0 0 Explicit Withdraw: 0 0 Used as bestpath: n/a 0 Used as multipath: n/a 0

                               Outbound    Inbound

Local Policy Denied Prefixes: -------- ------- Total: 0 0 Number of NLRIs in the update sent: max 0, min 0 Last detected as dynamic slow peer: never Dynamic slow peer recovered: never Refresh Epoch: 1 Last Sent Refresh Start-of-rib: never Last Sent Refresh End-of-rib: never Last Received Refresh Start-of-rib: never Last Received Refresh End-of-rib: never Sent Rcvd Refresh activity: ---- ---- Refresh Start-of-RIB 0 0 Refresh End-of-RIB 0 0

Address tracking is enabled, the RIB does have a route to 192.168.0.5 Connections established 0; dropped 0 Last reset never Interface associated: (none) (peering address NOT in same link) Transport(tcp) path-mtu-discovery is enabled Graceful-Restart is disabled SSO is disabled No active TCP connection

BGP neighbor is 192.168.0.6, remote AS 11054, internal link Description: iBGP peer DC2_asr2 BGP version 4, remote router ID 0.0.0.0 BGP state = Idle Neighbor sessions: 0 active, is not multisession capable (disabled) Stateful switchover support enabled: NO Do log neighbor state changes (via global configuration) Default minimum time between advertisement runs is 0 seconds

For address family: IPv4 Unicast BGP table version 22, neighbor version 1/22 Output queue size : 0 Index 0, Advertise bit 0 NEXT_HOP is always this router for eBGP paths Slow-peer detection is disabled Slow-peer split-update-group dynamic is disabled Sent Rcvd Prefix activity: ---- ---- Prefixes Current: 0 0 Prefixes Total: 0 0 Implicit Withdraw: 0 0 Explicit Withdraw: 0 0 Used as bestpath: n/a 0 Used as multipath: n/a 0

                               Outbound    Inbound

Local Policy Denied Prefixes: -------- ------- Total: 0 0 Number of NLRIs in the update sent: max 0, min 0 Last detected as dynamic slow peer: never Dynamic slow peer recovered: never Refresh Epoch: 1 Last Sent Refresh Start-of-rib: never Last Sent Refresh End-of-rib: never Last Received Refresh Start-of-rib: never Last Received Refresh End-of-rib: never Sent Rcvd Refresh activity: ---- ---- Refresh Start-of-RIB 0 0 Refresh End-of-RIB 0 0

Address tracking is enabled, the RIB does have a route to 192.168.0.6 Connections established 0; dropped 0 Last reset never Interface associated: (none) (peering address NOT in same link) Transport(tcp) path-mtu-discovery is enabled Graceful-Restart is disabled SSO is disabled No active TCP connection

natieitan commented 6 years ago

show bgp all summary For address family: IPv4 Unicast BGP router identifier 192.168.0.3, local AS number 11054 BGP table version is 22, main routing table version 22 15 network entries using 2160 bytes of memory 37 path entries using 2960 bytes of memory 7/4 BGP path/bestpath attribute entries using 1064 bytes of memory 4 BGP AS-PATH entries using 96 bytes of memory 0 BGP route-map cache entries using 0 bytes of memory 0 BGP filter-list cache entries using 0 bytes of memory BGP using 6280 total bytes of memory BGP activity 15/0 prefixes, 37/0 paths, scan interval 60 secs

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 10.0.0.10 4 11055 37553 37922 22 0 0 3w2d 11 10.0.0.14 4 11055 0 0 1 0 0 1w1d Idle 10.0.1.10 4 20010 37715 37661 22 0 0 3w2d 11 10.0.2.10 4 20010 37715 37641 22 0 0 3w2d 11 192.168.0.4 4 11054 0 0 1 0 0 never Idle 192.168.0.5 4 11054 0 0 1 0 0 never Idle 192.168.0.6 4 11054 0 0 1 0 0 never Idle

For address family: IPv6 Unicast BGP router identifier 192.168.0.3, local AS number 11054 BGP table version is 1, main routing table version 1

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 2001:1900:2101::1 4 11055 37391 37796 1 0 0 3w2d 0 2001:1900:2102::1 4 11055 37380 37775 1 0 0 3w2d 0

natieitan commented 6 years ago

@dbarrosop I'm having hard time understanding the regex, I need to replace the row from "Up/Down" to "State/PfxRcd"

ktbyers commented 6 years ago

@natieitan We can take this data you provided and incorporate it. I think that BGP code is pretty complex so if you can't complete the PR...no worries.

Ping me if I forget to do this.