What are the default BGP timers, and how do you detect a dead neighbor faster?
Show the answer
Say this first
Cisco IOS defaults to a 60 second keepalive and a 180 second hold time. Junos uses 30 and 90. The hold time
is negotiated to the lower of the two values in the OPEN messages. Three minutes is far too slow to notice a
dead peer, so I either lower the timers, for example to 10 and 30, or better, run BFD and tie BGP to it with
neighbor x fall-over bfd for sub-second detection.
Go deeper
Timers
- Keepalive: how often a KEEPALIVE is sent. Hold: how long without any message before the peer is declared dead. A hold time of 0 disables both; otherwise it must be at least 3 seconds.
- Per neighbor:
neighbor 192.0.2.1 timers 10 30. For all neighbors:timers bgp 10 30. - New timers take effect only when the session is next established.
Fast external fallover
bgp fast-external-fallover is on by default in IOS. When the interface to a directly connected eBGP peer
goes down, the session drops immediately. It does not help when the link stays up but the far end dies, for
example with a provider switch or media converter in the middle.
BFD
interface GigabitEthernet0/0/0
bfd interval 300 min_rx 300 multiplier 3
!
router bgp 64500
neighbor 192.0.2.1 fall-over bfd300 ms times 3 gives about 900 ms detection. The peer must run BFD too, so for an ISP session it is something you agree with the provider. Sessions between loopbacks need multihop BFD, which is configured differently and not supported on every platform.
They will ask next
Why not just set the hold time to 3 seconds?
BGP keepalives are handled by the control plane CPU. A busy CPU can miss one, and losing a full table session causes a big wave of churn. BFD is a lightweight protocol, often run in hardware or on the line card, built for exactly this.
Does BFD replace the BGP hold timer?
No. BFD tells BGP that the forwarding path is down and BGP tears the session down at once. The hold timer still runs as the backstop.
Traps
- Saying the hold time is negotiated to the higher value.
- Changing timers and expecting the running session to pick them up without a reset.