Neighbor Sessions and the FSM · Lesson 01 of 02
How a BGP session forms
BGP runs over TCP 179. Before a single prefix moves, a session has to climb a state machine.
Written lesson
The finite state machine
A BGP neighbour relationship walks through Idle → Connect → Active → OpenSent → OpenConfirm → Established. TCP must open first (that is Connect/Active); then the two speakers exchange OPEN messages carrying their AS number, hold time, router-ID and capabilities. If the OPEN parameters are compatible, the session reaches Established and prefixes flow. Stuck in Active usually means the TCP session cannot complete — a reachability, ACL or source-address problem. Flapping between OpenSent and Idle usually means mismatched parameters.
Configuration
A first eBGP neighbour
router bgp 65001
neighbor 10.12.0.2 remote-as 65002
neighbor 10.12.0.2 description eBGP to AS65002
address-family ipv4 unicast
neighbor 10.12.0.2 activateWritten lesson
Reading the session
show bgp ipv4 unicast summary is the fastest health check: a numeric value in the State/PfxRcd column means Established with that many prefixes received; a word (Idle, Active, OpenSent) means the session is not up. The uptime column resets every time the session bounces, so a very low uptime on a supposedly stable peer is a flap you should chase.
Idle vs Active
Idle often means BGP is not even trying — check that the neighbour is configured and not shut down or filtered by a policy. Active means it is trying TCP and failing — check routing to the peer address and any ACLs on TCP 179.