The peer timer command sets the Keepalive time and hold time for a peer group.
The undo peer timer command restores the default Keepalive time and hold time.
By default, the Keepalive time is 60s, and the hold time is 180s.
peer group-name timer keepalive keepalive-time hold hold-time
peer group-name timer keepalive keepalive-time hold hold-time min-holdtime min-hold-value
undo peer group-name timer keepalive hold [ min-holdtime ]
undo peer group-name timer keepalive keepalive-time hold hold-time min-holdtime min-hold-value
undo peer group-name timer keepalive keepalive-time hold hold-time
Parameter | Description | Value |
---|---|---|
group-name |
Specifies the name of a peer group. |
The value is a string of 1 to 47 case-sensitive characters and cannot contain spaces. If the character string is quoted by double quotation marks, the character string can contain spaces. |
keepalive keepalive-time |
Specifies the Keepalive time. |
The value is an integer ranging from 0 to 21845, in seconds. The default value is 60 seconds. |
hold hold-time |
Specifies the hold time. On the same device, the hold time must be at least three times the keepalive time. |
The value is an integer that can be 0 or ranges from 3 to 65535, in seconds. The default value is 180. Setting the Hold timer to be longer than 20s is recommended. If the hold time is shorter than 20s, the BGP peer session may be interrupted. |
min-holdtime min-hold-value |
Specifies the minimum hold time. On the same device, min-hold-value must be less than hold-time. |
The value is an integer ranging from 20 to 65535, in seconds. |
Usage Scenario
After establishing a BGP connection, two peers send Keepalive messages periodically to each other to detect the status of the BGP connection. If a device receives no Keepalive message or any other types of packets from its peer within the holdtime, the device considers the BGP connection closed, and it closes the BGP connection.
When the peers set up a connection, keepalive-time and hold-time are determined by negotiations between the peers. Each of the two peers sends the other an Open packet containing hold-time. The smaller hold-time contained in the Open packets from both peers is used. The smaller of the locally configured keepalive-time and one third of the negotiated hold-time is used as the actual keepalive-time. The peer timer command is used to set the Keepalive time and hold time:Configuration Impact
If the value of a timer changes, the BGP peer relationship between devices is disconnected. This is because the devices need to re-negotiate keepalive-time and hold-time. Therefore, exercise caution before changing the value of a timer.
Precautions
The Keepalive time must be at least three times of the hold time.
When setting keepalive-time and hold-time, note the following points: