Pcornel
Networking · Routing › BGP › eBGP

Neighbor Relationship

Cheat sheet · https://pcornel.dk/topic.php?topic=1133

Back to the Topic

Answer

A BGP neighbor relationship forms in steps: IP reachability to the peer, a TCP session on port 179, then OPEN messages with matching AS numbers and parameters, ending in Established. show bgp summary shows the state or the number of received prefixes.

Remember

A session needs, in order: a route to the peer's address, TCP port 179 between exactly the addresses each side has configured for the other, and agreeing AS numbers. The source address you connect from must be the address the peer has in its neighbor statement. Established with 0 prefixes is a healthy session — look at address-family activation, network statements and policy instead.

First checks

show ip bgp summary → a number in State/PfxRcd = Established; a word = not. show ip bgp neighbors <ip> | include BGP state|Last reset → state and the reason for the last reset. ping <peer> source <local peering address> → reachability with the right source.

Commands

show ip bgp summary
ping <peer> source <local peering address>
show tcp brief

Verify in this order

route to the peer → TCP 179 between the configured addresses → OPEN exchange (AS, hold time, capabilities, authentication) → Established → address family activated → prefixes exchanged

Where it usually breaks

underlay/interface reachability → protocol adjacency/session → received/originated state → policy → best path/RIB → FIB/adjacency → traffic path

BGP FSM quick reference

StateMeaningNext boundary
IdleInitial/restart/no active sessionconfig, peer reachability
ConnectWaiting on TCP connectionTCP/179 path
ActiveRetrying transport/sessionroute, ACL, source, peer IP
OpenSentOPEN sent/received negotiationASN/capabilities/auth
OpenConfirmOPEN accepted; keepalive confirmationstability/timers
EstablishedUPDATE exchange possibleexact prefix/policy/best path

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=1133

Confirmation

Confirm action

Continue?