- Table of Contents
-
- 05-Network Connectivity Command Reference
- 00-Preface
- 01-MAC address table commands
- 02-Ethernet link aggregation commands
- 03-VLAN commands
- 04-Spanning tree commands
- 05-LLDP commands
- 06-Layer 2 forwarding commands
- 07-PPP commands
- 08-L2TP commands
- 09-ARP commands
- 10-IP addressing commands
- 11-DHCP commands
- 12-DHCPv6 commands
- 13-DNS commands
- 14-NAT commands
- 15-IP performance optimization commands
- 16-IPv6 basics commands
- 17-Tunneling commands
- 18-GRE commands
- 19-ADVPN commands
- 20-Basic IP routing commands
- 21-IP forwarding basics commands
- 22-Static routing commands
- 23-IPv6 static routing commands
- 24-RIP commands
- 25-Policy-based routing commands
- 26-IPv6 policy-based routing commands
- 27-OSPF commands
- 28-RIPng commands
- 29-BGP commands
- 30-IGMP snooping commands
- 31-MLD snooping commands
- Related Documents
-
Title | Size | Download |
---|---|---|
18-GRE commands | 58.64 KB |
GRE commands
gre checksum
Use gre checksum to enable GRE checksum.
Use undo gre checksum to disable GRE checksum.
Syntax
gre checksum
undo gre checksum
Default
GRE checksum is disabled.
Views
Tunnel interface view
Predefined user roles
network-admin
Usage guidelines
GRE checksum verifies packet integrity.
You can enable or disable GRE checksum at each end of a tunnel as needed. After GRE checksum is enabled, the sender does the following:
· Calculates the checksum for the GRE header and the payload.
· Sends the packet containing the checksum information to the peer.
The receiver calculates the checksum for the received packet and compares it with that carried in the packet. If the checksums are the same, the receiver processes the packet. If the checksums are different, the receiver discards the packet.
If a packet carries a GRE checksum, the receiver checks the checksum whether or not the receiver is enabled with GRE checksum.
Examples
# Enable GRE checksum.
<Sysname> system-view
[Sysname] interface tunnel 2 mode gre
[Sysname-Tunnel2] gre checksum
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
Both ends of a GRE tunnel must have the same key or no key.
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, and configure the keepalive mode.
Use undo keepalive to disable GRE keepalive.
Syntax
keepalive [ interval [ times ] | reply-check-only ]*
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.
reply-check-only: Enables the reply-check-only keepalive mode. In this mode, the device places the tunnel interface state to up only when it receives a keepalive acknowledgment packet replied from the peer. The reply-check-only mode is disabled by default. If you do not specify this keyword, the device places the tunnel interface state to up when it receives a keepalive packet initiated or replied from the peer.
Usage guidelines
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.
Enable the reply-check-only mode in scenarios where the local device can receive keepalive packets from the peer but cannot send keepalive packets, such as remote-to-local one-way communication of a tunnel. In such a scenario, the peer shuts down the tunnel interface because it cannot receive keepalive packets from the local device. The local device, however, brings up the tunnel interface mistakenly when it receives a keepalive probe packet initiatively sent from the peer. After the reply-check-only mode is enabled, the local device brings up the tunnel interface only when it receives a keepalive probe reply from the peer. It keeps the tunnel interface down when it receives keepalive probe packets from the peer, so as to avoid setting wrong tunnel interface state.
The device always acknowledges the keepalive packets it receives whether or not 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
service-class
Use service-class to specify a service class value for a GRE tunnel interface.
Use undo service-class to restore the default.
Syntax
service-class service-class-value
undo service-class
Default
No service class value is specified for a GRE tunnel interface.
Views
Tunnel interface view
Predefined user roles
network-admin
Parameters
service-class-value: Specifies a service class value. The lower the service class value, the lower the forwarding priority for a tunnel. If no service class value is specified for a tunnel, the tunnel is considered to have the lowest forwarding priority.
Usage guidelines
Use this command only on a GRE tunnel interface.
The device selects a tunnel to forward a packet in the following order:
1. The tunnel that has the same service class value as the packet.
2. If multiple tunnels have the same service class value as the packet, the device randomly selects one of the tunnels to forward the packet.
3. If no tunnel has the same service class value as the packet, the device randomly selects a tunnel from all tunnels that have the lowest forwarding priority.
To set a service class value for packets, use the remark service-class command in traffic behavior view. For information about the remark service-class command, see QoS commands in QoS Command Reference.
Examples
# Set the service class value of Tunnel 0 to 5.
<Sysname> system-view
[Sysname] interface tunnel 0 mode gre
[Sysname-Tunnel0] service-class 5