Stackvora.tech

BGP troubleshooting basics: sessions, prefixes, path selection

A field guide for the four most common BGP problems — neighbor stuck in Active, missing prefixes, wrong best path, and MED/AS-path surprises.

BGP is deceptively simple: two routers exchange prefixes over TCP/179. When it goes wrong, however, the failure modes are almost always the same four.

1. Neighbor stuck in Active

show ip bgp summary
! State = Active means "trying to connect but failing"

Checklist:

  • Reachability — can you ping the neighbor's IP?
  • TCP 179 open on both sides (ACLs, firewalls).
  • Correct remote-as — an AS mismatch shows as Active too.
  • Update-source interface reachable from the peer.
  • eBGP multi-hop needed? neighbor X ebgp-multihop 2.

2. Session up but no prefixes received

show ip bgp neighbors X.X.X.X received-routes
show ip bgp neighbors X.X.X.X advertised-routes

Common causes:

  • The peer isn't advertising them — check on their side.
  • Prefix-list or route-map filtering inbound.
  • Max-prefix limit hit — %BGP-3-MAXPFX in logs.
  • Soft-reconfiguration required for received-routes — enable neighbor X soft-reconfiguration inbound.

3. Wrong best path

show ip bgp X.X.X.X/YY
show ip route X.X.X.X

Remember BGP path selection (simplified):

  1. Highest weight (Cisco-local).
  2. Highest local-preference.
  3. Locally originated over learned.
  4. Shortest AS-path.
  5. Lowest origin (IGP < EGP < incomplete).
  6. Lowest MED (same-AS peers only by default).
  7. eBGP over iBGP.
  8. Lowest IGP metric to next-hop.

4. Route flapping

show ip bgp dampening flap-statistics
show logging | i BGP

Flapping wastes CPU and destabilizes the RIB. Tools:

  • Route dampening (careful — deprecated by some standards bodies).
  • BFD for faster failure detection (down in ~150 ms instead of 90 s).
  • Investigate the interface — flapping is almost always a physical/L2 issue.

Sanity commands to memorize

show ip bgp summary
show ip bgp
show ip bgp neighbors X.X.X.X
show ip bgp regexp _65000_
clear ip bgp X soft in     ! non-disruptive refresh

Back to the knowledge base · Ask the AI assistant