Configuring the keepalive interval and hold time

BGP sends keepalive messages regularly to keep the BGP session between two routers.

If a router receives no keepalive or update message from a peer within the hold time, it tears down the session.

You can configure the keepalive interval and hold time globally or for a peer or peer group. The individual settings take precedence over the global settings.

The actual keepalive interval and hold time are determined as follows:

To configure the keepalive interval and hold time (IPv4 unicast/multicast address family):

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter BGP instance view or BGP-VPN instance view.

  • Enter BGP instance view:bgp as-number [ instance instance-name ]

  • Enter BGP-VPN instance view:

    1. bgp as-number [ instance instance-name ]

    2. ip vpn-instance vpn-instance-name

N/A

3. Configure the keepalive interval and hold time.

  • Configure the global keepalive interval and hold time: timer keepalive keepalive hold holdtime

  • Configure the keepalive interval and hold time for a peer or peer group: peer { group-name | ipv4-address [ mask-length ] } timer keepalive keepalive hold holdtime

Use at least one method.

By default, the keepalive interval is 60 seconds, and hold time is 180 seconds.

The timer command takes effect for new BGP sessions and does not affect existing sessions.

The timers configured with the timer and peer timer commands do not take effect until a session is re-established (for example, a session is reset).

The hold time must be at least three times the keepalive interval.

To configure the keepalive interval and hold time (IPv6 unicast/multicast address family):

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter BGP instance view or BGP-VPN instance view.

  • Enter BGP instance view:bgp as-number [ instance instance-name ]

  • Enter BGP-VPN instance view:

    1. bgp as-number [ instance instance-name ]

    2. ip vpn-instance vpn-instance-name

N/A

3. Configure the keepalive interval and hold time.

  • Configure the global keepalive interval and hold time: timer keepalive keepalive hold holdtime

  • Configure the keepalive interval and hold time for a peer or peer group: peer { group-name | ipv6-address [ prefix-length ] } timer keepalive keepalive hold holdtime

Use at least one method.

By default, the keepalive interval is 60 seconds, and hold time is 180 seconds.

The timer command takes effect for new BGP sessions and does not affect existing sessions.

The timers configured with the timer and peer timer commands do not take effect until a session is re-established (for example, a session is reset).

The hold time must be at least three times the keepalive interval.