< Home

timer (BGP)

Function

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.

Format

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 ]

Parameters

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.

Views

BGP view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

After a connection is established between peers, the values of keepalive-time and hold-time are negotiated by the peers.
  • 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 the value of min-holdtime is changed, but the values of keepalive-time and hold-time negotiated between two BGP peers remain unchanged, the established peer relationship is not affected. Only when the local device attempts to re-establish a relationship with a remote device, the value of min-holdtime configured on the local device takes effect. The local device compares min-holdtime with hold-time sent from the remote device. If the value of min-holdtime exceeds that of hold-time, hold-time negotiation fails, and the peer relationship fails to be established.

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.

Setting the Hold timer value to at least three times the Keepalive timer value is recommended. When setting the values of keepalive-time and hold-time, note the following points:
  • 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.

Example

# On a BGP device, set the value of the Keepalive timer to 30s and the value of the Hold timer to 90s.

<HUAWEI> system-view
[HUAWEI] bgp 100
[HUAWEI-bgp] timer keepalive 30 hold 90
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >