The keepalive command enables the Keepalive function for a GRE tunnel.
The undo keepalive command disables the Keepalive function for a GRE tunnel.
| 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. |
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.
# 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