- Table of Contents
-
- 06-Layer 3—IP Services Command Reference
- 00-Preface
- 01-ARP commands
- 02-IP addressing commands
- 03-DNS commands
- 04-mDNS relay commands
- 05-IP forwarding basics commands
- 06-Fast forwarding commands
- 07-Adjacency table commands
- 08-IRDP commands
- 09-IP performance optimization commands
- 10-UDP helper commands
- 11-IPv6 basics commands
- 12-IPv6 fast forwarding commands
- 13-AFT commands
- 14-Tunneling commands
- 15-GRE commands
- 16-ADVPN commands
- 17-HTTP redirect commands
- Related Documents
-
Title | Size | Download |
---|---|---|
15-GRE commands | 39.26 KB |
GRE commands
gre key
Use gre key to configure a key for a GRE tunnel interface.
Use undo gre key to restore the default.
Syntax
gre key key
undo gre key
Default
No key is configured for a GRE tunnel interface.
Views
Tunnel interface view
Predefined user roles
network-admin
Parameters
key: Specifies the key for the GRE tunnel interface, in the range of 0 to 4294967295.
Usage guidelines
You can configure a GRE key to check for the validity of packets received on a GRE tunnel interface.
When a GRE key is configured, the sender puts the GRE key into each sent packet. The receiver compares the GRE key in the received packet with its own GRE key. If the two keys are the same, the receiver accepts the packet. If the two keys are different, the receiver drops the packet.
Both ends of a GRE tunnel must have the same key or no key.
Only the folloiwng cards support this command:
CSPEX-1304X, CSPEX-1404X, CSPEX-1502X, CSPEX-1504X, CSPEX-1504XA, CSPEX-1602X, CSPEX-1602XA, CSPEX-1804X, CSPEX-1512X, CSPEX-1612X, CSPEX-1812X, RX-SPE200, CEPC-XP4LX, CEPC-XP24LX, CEPC-XP48RX, CEPC-CP4RX, CEPC-CP4RXA, CEPC-CP4RX-L
Examples
# Configure the GRE key as 123 for the GRE tunnel interface Tunnel 2.
<Sysname> system-view
[Sysname] interface tunnel 2 mode gre
[Sysname-Tunnel2] gre key 123
keepalive
Use keepalive to enable GRE keepalive and set the keepalive interval and the keepalive number.
Use undo keepalive to disable GRE keepalive.
Syntax
keepalive [ interval [ times ] ]
undo keepalive
Default
GRE keepalive is disabled.
Views
Tunnel interface view
Predefined user roles
network-admin
Parameters
interval: Specifies the keepalive interval, in the range of 1 to 32767 seconds. The default value is 10.
times: Specifies the keepalive number, in the range of 1 to 255. The default value is 3.
Usage guidelines
Only the following cards support this command:
CSPEX-1304X, CSPEX-1404X, CSPEX-1502X, CSPEX-1504X, CSPEX-1504XA, CSPEX-1602X, CSPEX-1602XA, CSPEX-1804X, CSPEX-1512X, CSPEX-1612X, CSPEX-1812X, RX-SPE200, CEPC-XP4LX, CEPC-XP24LX, CEPC-XP48RX, CEPC-CP4RX, CEPC-CP4RXA, CEPC-CP4RX-L, CSPEX-1802X, CSPEX-1802XA, CSPEX-1812X-E, CSPEX-2304X-G, CEPC-CQ8L, CEPC-CQ8LA, CEPC-CQ16L1, CSPEX-1502XA, RX-SPE200-E, CSPEX-1104-E, CSPEX-1204, CSPC-GE16XP4L-E, CSPC-GE24L-E, CSPC-GP24GE8XP2L-E
This command enables the tunnel interface to send keepalive packets at the specified interval. If the device receives no response from the peer within the timeout time, it shuts down the local tunnel interface. The device brings the local tunnel interface up if it receives a keepalive acknowledgment packet from the peer. The timeout time is the result of multiplying the keepalive interval by the keepalive number.
The device always acknowledges the keepalive packets it receives whether or not GRE keepalive is enabled.
GRE/IPv6 mode tunnel interfaces do not support this command.
Examples
# Enable GRE keepalive, set the keepalive interval to 20 seconds, and set the keepalive number to 5.
<Sysname> system-view
[Sysname] interface tunnel 2 mode gre
[Sysname-Tunnel2] keepalive 20 5