< Home

Configuring BGP4+ Keepalive and Hold Timers

Configuring timers properly can improve network performance. Changing the values of BGP4+ timers will interrupt the peer relationship.

Context

If the values of the timers change after the peer timer command is run, the BGP connection set up among routers is interrupted. So, confirm the action before you use the command.

Procedure

  • Configure the global timer.
    1. Access the system view.

      system-view

    2. Access the BGP view.

      bgp { as-number-plain | as-number-dot }

    3. Set the BGP timer.

      timer keepalive keepalive-time hold hold-time [ min-holdtime min-holdtime ]

      The proper maximum interval at which Keepalive messages are sent is one third the holdtime and is not less than one second. If the holdtime is not set to 0, it is 3s at least. By default, the keepalive-time value is 60s and the hold-time value is 180s.

      Setting the Keepalive time to 20s is recommended. If the Keepalive time is smaller than 20s, sessions between peers may be closed.

      When setting values of keepalive-time and hold-time, note the following points:

      • The keepalive-time and hold-time values cannot be both set to 0. Otherwise, the BGP timers become invalid, meaning that BGP will not send Keepalive messages to detect connection status.
      • The hold-time value cannot be much greater than the keepalive-time value. For example, keepalive-time cannot be set to 1 while hold-time is set to 65535. If the hold-time value is too large, BGP cannot detect connection status in time.

      After a connection is established between peers, the keepalive-time and hold-time values are negotiated by the peers. The smaller one of the hold-time values carried by Open messages of both peers is taken as the hold-time value. The smaller one 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.

  • Configure the peer timer.
    1. Access the system view.

      system-view

    2. Access the BGP view.

      bgp { as-number-plain | as-number-dot }

    3. Set the Keepalive and hold timers for a specific peer or peer group.

      peer { ipv6-address | group-name } timer keepalive keepalive-time hold hold-time

      For information about the relationship between the keepalive-time and hold-time values, see Configure BGP timers for all peers or peer groups.

      Setting the Keepalive time to 20s is recommended. If the Keepalive time is smaller than 20s, sessions between peers may be closed.

      Timers set for a specific peer or peer group takes precedence over timers set for all peers or peer groups.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >