The timer command sets the values for the Keepalive timer and Hold timer.
The undo timer command restores the default values of the Keepalive timer and Hold timer.
By default, the value of a Keepalive timer is 60s and the value of a Hold timer is 180s.
timer keepalive keepalive-time hold hold-time [ min-holdtime min-holdtime ]
undo timer keepalive keepalive-time hold hold-time [ min-holdtime min-holdtime ]
undo timer keepalive hold [ min-holdtime ]
Parameter | Description | Value |
---|---|---|
keepalive keepalive-time | Specifies the Keepalive period. | The value is an integer that ranges from 0 to 21845, in seconds. |
hold hold-time | Specifies the holdtime. | The value is an integer that can be 0, or ranges from 3 to 65535, in seconds. |
min-holdtime min-holdtime | Specifies the minimum holdtime configured on the local
device. NOTE:
The value of min-holdtime configured cannot exceed the value of hold-time. |
The value is an integer that ranges from 20 to 65535, in seconds. |
Usage Scenario
The smaller of the hold-time values carried by Open messages of both peers is taken as the hold-time value.
The smaller of one third of the hold-time value and the locally configured keepalive-time value is taken as the keepalive-time value.
If the local device establishes BGP peer relationships with many devices, it needs to process huge BGP messages. If hold-time negotiated among BGP peers is small, the timer may expire before the local device processes the Keepalive messages sent from other BGP peers. The peer relationships are then interrupted, and routes flap. To solve the preceding problem, you can configure an appropriate value for min-holdtime min-holdtime based on the CPU processing capability of the local device.
If min-holdtime is configured on the local device, and the value of hold-time sent from the remote device is 0, hold-time negotiation between the two devices succeeds. The negotiated value of hold-time is 0, and the peer relationship is established. The value 0 of hold-time indicates that the peer relationship never expires.
Precautions
The timers configured for a specific peer or peer group by using the peer timer command override the timers configured for all BGP peers by using the timer command.
If the value of a timer changes, the BGP peer relationship between devices is disconnected. This is because the devices need to re-negotiate the values of keepalive-time and hold-time. Therefore, exercise caution before changing the value of a timer.
The values of keepalive-time and hold-time cannot both be set to 0. This renders the BGP timers become invalid. This means that BGP is unable to detect link faults using the timers.
The hold-time value cannot be significantly greater than the keepalive-time value. A setting of timer keepalive 1 hold 65535, for example, would be improper. If the holdtime is too long, link faults cannot be detected in a timely manner.