Lesson 4 of 9 · 20m
BGP Sessions and Neighbor Design
eBGP and iBGP sessions have different assumptions; stable loopbacks, TTL behavior, authentication, timers, and explicit session design prevent fragile peering.
A BGP session is just a TCP session on port 179 carrying a stateful routing protocol, but the operational details are unforgiving. Most neighbor problems are not exotic protocol failures. They are wrong source addresses, ACLs blocking TCP/179, mismatched AS numbers, MTU problems, authentication mismatch, or someone expecting iBGP behavior from an eBGP design.
eBGP versus iBGP
eBGP neighbors are usually directly connected and in different ASes. iBGP neighbors are often many hops apart inside the same AS and peer between loopbacks. Defaults reflect that history:
eBGP: TTL commonly 1 unless multihop is configured
iBGP: TTL effectively unrestricted inside the ASIf you peer eBGP across multiple hops, configure ebgp-multihop and understand that you have widened the attack surface. Use filtering and authentication. Better yet, ask whether the design really needs multihop at all.
Session establishment
The BGP finite state machine is worth knowing at a high level:
Idle -> Connect -> Active -> OpenSent -> OpenConfirm -> EstablishedActive sounds promising but often means TCP cannot connect. Common causes:
no route to peer
TCP/179 filtered
wrong local address
peer configured with the wrong AS
MD5/TCP-AO authentication mismatchOn Linux with FRR, inspect state this way:
vtysh -c 'show bgp summary'
vtysh -c 'show ip bgp neighbors 192.0.2.1'Look at both the BGP state and the counters: connections established, dropped, resets, last error. A peer stuck in Active with zero TCP answers is a reachability problem, not a routing-policy problem.
Timers are a tradeoff
BGP keepalive/hold timers such as 30/90 or 10/30 control how quickly a dead session is declared dead. Faster is not always better. A congested control plane or slow router can drop sessions if timers are too aggressive. BFD can detect forwarding failure faster while leaving BGP itself more conservative.
Authentication and protection
Use TCP MD5 where that is what the ecosystem supports, or TCP-AO on platforms and peers that support it. Authentication does not encrypt BGP; it only makes session injection harder. You still need prefix filtering, maximum-prefix limits, and control-plane ACLs.
Field notes
update-source Loopback0is normal for iBGP; forgetting it often leaves sessions active but unstable or asymmetric.- eBGP sessions over private interconnect should still be protected as if they were hostile — mistakes cross trust boundaries easily.
- Always configure
maximum-prefixunless you have a specific reason not to. - Log neighbor state changes and review them after maintenance. Silent session churn is often the first warning of bad optics or congestion.
- A session that establishes but exchanges no routes usually means policy, capability negotiation, or address-family mismatch.
Was this lesson helpful?