Configuring BGP Keepalive and Hold Timers
Context
Keepalive messages are used by BGP to maintain peer relationships.
- If short Keepalive time and holdtime are set, BGP can detect a link fault quickly. This speeds up BGP network convergence, but increases the number of Keepalive messages on the network and loads of devices, and consumes more network bandwidth resources.
- If long Keepalive time and holdtime are set, the number of Keepalive messages on the network is reduced, loads of devices are reduced, and less network bandwidth is consumed. If the Keepalive time is too long, BGP is unable to detect link status changes in a timely manner. This hinders the implementation of rapid BGP network convergence and may cause significant packet loss.
Keepalive and hold timers can be configured either for all peers or peer groups, or for a specific peer or peer group. Keepalive and hold timers configured for a specific peer take precedence over those configured for the peer group of the peer. In addition, Keepalive and hold timers configured for a specific peer or peer group take precedence over those configured for all peers or peer groups.
Changing timer values using the timer command or the peer timer command interrupts BGP peer relationships between switches.
Setting the Keepalive time to 20s is recommended. If the Keepalive time is less than 20s, sessions between peers may be closed.