Debug BGP

02 May 2011 - Lab-Rat

There are books on BGP, and to say it’s a huge topic is an understatement. Anyway, here’s some of the most helpful commands I’ve found for figuring out what’s going on with BGP routing and neighbor relationships.
show ip bgp [prefix]
- shows route info in BGP table. Will show no best path if route is not synchronized. Will show inaccessible if the next hop is not available. Will also show dampened routes.
R707#show ip bgp 146.16.0.0 255.255.252.0
BGP routing table entry for 146.16.0.0/22, version 23
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Multipath: iBGP
Flag: 0x820
Advertised to update-groups:
1
1 6, (aggregated by 6 188.112.1.8)
188.112.1.16 from 188.112.1.16 (10.10.0.1)
Origin IGP, localpref 100, valid, external, atomic-aggregate, best

show ip bgp summary
- summarized neighbor status
R707#show ip bgp summary
BGP router identifier 188.112.1.25, local AS number 5
BGP table version is 24, main routing table version 24
5 network entries using 600 bytes of memory
5 path entries using 260 bytes of memory
4/3 BGP path/bestpath attribute entries using 496 bytes of memory
1 BGP AS-PATH entries using 24 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
Bitfield cache entries: current 2 (at peak 2) using 60 bytes of memory
BGP using 1440 total bytes of memory
BGP activity 65/59 prefixes, 116/111 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
188.112.1.16 4 1 384 435 24 0 0 00:21:08 0
188.112.1.18 4 1 362 431 24 0 0 00:21:08 0

show ip bgp neighbors [address]
- details about the neighbor
R707#show ip bgp neighbors 188.112.1.18
BGP neighbor is 188.112.1.18, remote AS 1, external link
BGP version 4, remote router ID 10.10.0.2
BGP state = Established, up for 00:22:13
Last read 00:00:13, last write 00:00:13, hold time is 180, keepalive interval is 60 seconds
Neighbor capabilities:
Route refresh: advertised and received(old & new)
Address family IPv4 Unicast: advertised and received
Message statistics:
InQ depth is 0
OutQ depth is 0
Sent Rcvd
Opens: 3 3
Notifications: 0 0
Updates: 171 102
Keepalives: 260 260
Route Refresh: 0 0
Total: 434 365
Default minimum time between advertisement runs is 30 seconds

For address family: IPv4 Unicast
BGP table version 26, neighbor version 26/0
Output queue size: 0
Index 1, Offset 0, Mask 0x2
1 update-group member
Sent Rcvd
Prefix activity: —- —-
Prefixes Current: 2 0
Prefixes Total: 11 5
Implicit Withdraw: 3 0
Explicit Withdraw: 6 5
Used as bestpath: n/a 0
Used as multipath: n/a 0

Outbound Inbound
Local Policy Denied Prefixes: ——– ——-
Suppressed due to dampening: 4 n/a
Total: 4 0
Number of NLRIs in the update sent: max 4, min 0

Connections established 3; dropped 2
Last reset 00:22:15, due to User reset
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: 188.112.1.19, Local port: 58518
Foreign host: 188.112.1.18, Foreign port: 179
Connection tableid (VRF): 0

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

Event Timers (current time is 0xF80C8C):
Timer Starts Wakeups Next
Retrans 43 0 0x0
TimeWait 0 0 0x0
AckHold 34 27 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: 2502616372 snduna: 2502617729 sndnxt: 2502617729 sndwnd: 15028
irs: 170742265 rcvnxt: 170743216 rcvwnd: 15434 delrcvwnd: 950

SRTT: 299 ms, RTTO: 308 ms, RTV: 9 ms, KRTT: 0 ms
minRTT: 0 ms, maxRTT: 300 ms, ACK hold: 200 ms
Status Flags: active open
Option Flags: nagle
IP Precedence value : 6

Datagrams (max data segment is 1460 bytes):
Rcvd: 54 (out of order: 0), with data: 36, total data bytes: 950
Sent: 72 (retransmit: 0, fastretransmit: 0, partialack: 0, Second Congestion: 0), with data: 43, total data bytes: 1356
Packets received in fast path: 0, fast processed: 0, slow path: 0
Packets send in fast path: 0
fast lock acquisition failures: 0, slow path: 0

show ip bgp neighbors [address] [advertised-routes] [received-routes]
- shows routes advertised to neighbors (advertised-routes), or received from neighbors (received-routes).
R707#show ip bgp neighbors 188.112.1.18 advertised-routes
BGP table version is 27, local router ID is 188.112.1.25
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path
*> 146.16.4.0/22 0.0.0.0 32768 i
Total number of prefixes 1

R707#show ip bgp neighbors 188.112.1.18 received-routes
% Inbound soft reconfiguration not enabled on 188.112.1.18

debug ip bgp updates
- shows bgp update contents
R707#debug ip bgp updates
BGP updates debugging is on for address family: IPv4 Unicast
May 2 04:32:45.478: BGP(0): treating modify event for route 188.112.1.0/28 not appearing in BGP table as up event
May 2 04:32:59.814: BGP(0): treating modify event for route 188.112.1.0/28 not appearing in BGP table as up event
May 2 04:33:05.798: BGP(0): 188.112.1.18 rcv UPDATE about 146.16.0.0/22 – withdrawn
May 2 04:33:05.798: BGP(0): no valid path for 146.16.0.0/22
May 2 04:33:05.798: BGP(0): nettable_walker 146.16.0.0/22 no best path
May 2 04:33:05.798: BGP(0): 188.112.1.16 send unreachable 146.16.0.0/22
May 2 04:33:05.798: BGP(0): 188.112.1.16 send UPDATE 146.16.0.0/22 – unreachable
May 2 04:33:05.902: BGP(0): updgrp 1 - 188.112.1.16 updates replicated for neighbors: 188.112.1.18

debug ip bgp
- will show a timeout on incorrectly configured neighbors.
R707#debug ip bgp
BGP debugging is on for address family: IPv4 Unicast
R707#
May 2 04:34:40.497: BGP(0): Aggregate processing for IPv4 Unicast
May 2 04:34:40.497: BGP(0): For aggregate 146.16.4.0/22
May 2 04:34:40.497: BGP(0): 146.16.4.0/22 subtree has an entry 146.16.4.0/24
May 2 04:34:40.497: BGP(0): sub-prefix : 146.16.4.0/24
May 2 04:34:40.497: BGP(0): sub-prefix : 146.16.5.0/24
May 2 04:34:40.497: BGP(0): sub-prefix : 146.16.6.0/24
May 2 04:34:40.497: BGP(0): sub-prefix : 146.16.7.0/24
May 2 04:34:40.497: BGP(0): Need not be re-aggregated

Debug ip icmp
- will show exceeded messages on ebgp multihop errors.

debug ip tcp transactions
- will show ttl errors (helpful for multihop errors)

Additional Reading:
Troubleshooting IP Routing Protocols