keepalive

Function

The keepalive command enables the Keepalive function for a GRE tunnel.

The undo keepalive command disables the Keepalive function for a GRE tunnel.

Format

keepalive [ period period [ retry-times retry-times ] ]

undo keepalive

Parameters

Parameter Description Value
period Specifies the interval for sending Keepalive messages. The value is an integer ranging from 1 to 32767, in seconds. By default, the value is 5 seconds.
retry-times Specifies the count of the unreachable counter. The value is an integer ranging from 1 to 255. By default, the value is 3.

Views

Tunnel interface view

Default Level

2: Configuration level

Usage Guidelines

By default, the Keepalive function of a GRE tunnel is disabled.

This command takes effect only on a GRE tunnel interface.

After the keepalive command is run on a GRE tunnel, the Keepalive function immediately takes effect. After the undo keepalive command is run, this function immediately becomes invalid.

After the Keepalive function is enabled on a GRE tunnel, the tunnel periodically sends Keepalive messages. If no response message is received after a Keepalive message is sent, the unreachable counter increases 1. If no response message is received when the value of the counter reaches the configured retry-times, the peer is considered unreachable.

Example

# Enable the Keepalive function for the GRE tunnel using default parameters.

<sysname> system-view
[sysname] interface tunnel 0
[sysname-Tunnel0] tunnel-protocol gre
[sysname-Tunnel0] keepalive

# Enable the Keepalive function for the GRE tunnel. Specify the interval for sending Keepalive messages to 12 seconds and configure the unreachable timer to use default parameters.

<sysname> system-view
[sysname] interface tunnel 0
[sysname-Tunnel0] tunnel-protocol gre
[sysname-Tunnel0] keepalive period 12

# Enable the Keepalive function for the GRE tunnel. Specify the interval for sending Keepalive messages to 12 seconds and set the count of the unreachable counter to 4.

<sysname> system-view
[sysname] interface tunnel 0
[sysname-Tunnel0] tunnel-protocol gre
[sysname-Tunnel0] keepalive period 12 retry-times 4
Related Topics
display keepalive packets count
reset keepalive packets count

Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.