- Table of Contents
-
- 06-Layer 3—IP Services Command Reference
- 00-Preface
- 01-ARP commands
- 02-IP addressing commands
- 03-DHCP commands
- 04-DNS commands
- 05-NAT commands
- 06-IP forwarding basics commands
- 07-Fast forwarding commands
- 08-Multi-CPU packet distribution commands
- 09-Adjacency table commands
- 10-IRDP commands
- 11-IP performance optimization commands
- 12-UDP helper commands
- 13-IPv6 basics commands
- 14-DHCPv6 commands
- 15-IPv6 fast forwarding commands
- 16-AFT commands
- 17-Tunneling commands
- 18-GRE commands
- 19-ADVPN commands
- 20-WAAS commands
- 21-HTTP proxy commands
- Related Documents
-
Title | Size | Download |
---|---|---|
18-GRE commands | 99.63 KB |
Contents
display gre p2mp tunnel-table interface tunnel
display gre p2mp tunnel-table statistics
gre p2mp-template (system view)
gre p2mp-template (tunnel interface view)
GRE commands
display gre p2mp tunnel-table interface tunnel
Use display gre p2mp tunnel-table interface tunnel to display dynamic tunnel entry information for a GRE P2MP tunnel interface.
Syntax
display gre p2mp tunnel-table interface tunnel number [ ipv4 | ipv6 ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
number: Specifies an existing GRE P2MP tunnel interface by its interface number.
ipv4: Specifies dynamic IPv4 tunnel entries.
ipv6: Specifies dynamic IPv6 tunnel entries.
Usage guidelines
If you do not specify the ipv4 keyword or the ipv6 keyword, this command displays all dynamic tunnel entries for a GRE P2MP tunnel interface.
Examples
# Display all dynamic tunnel entries for GRE P2MP tunnel interface Tunnel 0.
<Sysname> display gre p2mp tunnel-table interface tunnel 0
Total number:2
Dest Addr Mask/Prefix Len Tunnel Dest Addr Gre Key Aging
10.0.0.1 255.255.255.255 20.0.0.1 10
10::1 64 20.0.0.2 5
# Display dynamic IPv4 tunnel entries for GRE P2MP tunnel interface Tunnel 0.
<Sysname> display gre p2mp tunnel-table interface tunnel 0 ipv4
Total number:1
Dest Addr Mask/Prefix Len Tunnel Dest Addr Gre Key Aging
100.0.0.1 255.255.255.255 20.0.0.1 9
# Display dynamic IPv6 tunnel entries for GRE P2MP tunnel interface Tunnel 0.
<Sysname> display gre p2mp tunnel-table interface tunnel 0 ipv6
Total number:1
Dest Addr Mask/Prefix Len Tunnel Dest Addr Gre Key Aging
100::1 128 20::2 3
Table 1 Command output
Field |
Description |
Total number |
Total number of GRE P2MP dynamic tunnel entries. |
Dest Addr |
Network address of the branch network. |
Mask/Prefix Len |
Address mask or prefix length of the branch network. |
Tunnel Dest Addr |
Destination address of the tunnel. |
Gre Key |
GRE key, which indicates the priority of the dynamic tunnel entry. This field does not display anything if the tunnel destination end does not have a GRE key. |
Aging |
Remaining lifetime of the entry, in seconds. |
display gre p2mp tunnel-table statistics
Use display gre p2mp tunnel-table statistics to display packet statistics of static tunnel entries for a GRE P2MP tunnel interface.
Syntax
display gre p2mp tunnel-table statistics interface tunnel number [ vpn-instance vpn-instance-name ] [ branch-network-address branch-network-address { mask | mask-length } ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
interface tunnel number: Specifies an existing GRE P2MP tunnel interface by its interface number.
vpn-instance vpn-instance-name: Specifies an MPLS L3VPN instance by its name. The vpn-instance-name argument is a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays packet statistics of static tunnel entries on the public network for the specified GRE P2MP tunnel interface.
branch-network-address branch-network-address: Specifies an IPv4 branch network address. If you do not specify this option, the command displays packets statistics of static tunnel entries for all IPv4 branch networks of the specified scope.
mask: Specifies the mask of the branch network address, in dotted decimal notation.
mask-length: Specifies the mask length of the branch network address, in the range of 0 to 32.
Usage guidelines
If you do not specify any parameters, this command displays packet statistics of all static tunnel entries on the public network for the specified GRE P2MP tunnel interface.
Examples
# Display packet statistics of all static tunnel entries on the public network for GRE P2MP tunnel interface Tunnel 1.
<Sysname> display gre p2mp tunnel-table statistics interface tunnel 1
VPN-instance name: - Map entries: 2
Branch network address : 192.168.11.1/32
Tunnel destination address: 11.1.1.1
Checksum value : 192.168.20.1
Input:
0 packets, 0 bytes, 0 drops
Output:
0 packets, 0 bytes, 0 drops
Branch network address : 192.168.12.1/32
Tunnel destination address: 11.1.1.1
Checksum value : 192.168.20.2
Input:
0 packets, 0 bytes, 0 drops
Output:
0 packets, 0 bytes, 0 drops
Table 2 Command output
Field |
Description |
VPN-instance name |
VPN instance of the branch networks. If the branch networks belong to the public network, this field displays a hyphen (-). |
Map entries |
Total number of GRE P2MP tunnel mapping entries. |
Branch network address |
IPv4 address and mask of a branch network. |
Tunnel destination address |
A destination address of the tunnel. |
Checksum value |
Value to fill in the checksum field. The system does not display the Checksum value field if no value is specified to fill in the checksum field. |
Input: 0 packets, 0 bytes, 0 drops |
Incoming traffic statistics: · Number of incoming packets. · Number of incoming bytes. · Number of dropped packets. |
Output: 0 packets, 0 bytes, 0 drops |
Outgoing traffic statistics: · Number of outgoing packets. · Number of outgoing bytes. · Number of dropped packets. |
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 point-to-point tunnel must have the same key or no key.
Do not configure any GRE key on a GRE P2MP tunnel interface. You can configure GRE keys on the point-to-point tunnel interfaces in the branch networks. The GRE keys not only check for the validity of packets received on the tunnel interfaces but also indicate the priorities of dynamic tunnels. The GRE P2MP tunnel end prefers the branch tunnel that has the highest priority to forward traffic.
Do not use this command together with the gre vpc enable command on the same tunnel interface.
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
gre p2mp aging-time
Use gre p2mp aging-time to specify an aging timer for dynamic tunnel entries of a GRE P2MP tunnel interface.
Use undo gre p2mp aging-time to restore the default.
Syntax
gre p2mp aging-time aging-time
undo gre p2mp aging-time
Default
The aging timer is 5 seconds.
Views
Tunnel interface view
Predefined user roles
network-admin
Parameters
aging-time: Specifies an aging timer in the range of 1 to 86400 seconds.
Usage guidelines
This command is applicable only to GRE P2MP tunnel interfaces.
If the headquarters gateway does not receive any packets from a branch when the aging timer expires, it deletes the dynamic tunnel entry of that branch.
Set an appropriate aging timer depending on the network condition. A shorter timer might cause forwarding failure to an actual reachable network. A longer timer cannot quickly update dynamic tunnel entries.
Examples
# Set the aging timer to 10 seconds for dynamic tunnel entry on GRE P2MP tunnel interface Tunnel 0.
<Sysname> system-view
[Sysname] interface tunnel 0 mode gre-p2mp
[Sysname-Tunnel0] gre p2mp aging-time 10
gre p2mp backup-interface
Use gre p2mp backup-interface to specify a backup interface for a GRE P2MP tunnel interface.
Use undo gre p2mp backup-interface to restore the default.
Syntax
gre p2mp backup-interface tunnel number
undo gre p2mp backup-interface
Default
No backup interface is configured for a GRE P2MP tunnel interface.
Views
Tunnel interface view
Predefined user roles
network-admin
Parameters
tunnel number: Specifies a tunnel interface by its interface number. The tunnel interface must exist on the device and must be a GRE/IPv4 or GRE/IPv6 tunnel interface.
Usage guidelines
This command is applicable only to GRE P2MP tunnel interfaces.
When the device cannot find a matching GRE P2MP dynamic tunnel entry to forward traffic, it forwards the traffic to the backup gateway through the backup interface. Services (for example, NetStream and NAT) on the backup interface do not take effect on the traffic. The service configuration on the primary GRE P2MP tunnel interface is used for the traffic.
Examples
# Specify tunnel interface Tunnel 100 as the backup interface of GRE P2MP tunnel interface Tunnel 0.
<Sysname> system-view
[Sysname] interface tunnel 0 mode gre-p2mp
[Sysname-Tunnel0] gre p2mp backup-interface tunnel 100
gre p2mp branch-network-mask
Use gre p2mp branch-network-mask to specify the network mask or mask length for IPv4 branch networks or specify the prefix length for IPv6 branch networks on a GRE P2MP tunnel interface.
Use undo gre p2mp branch-network-mask to restore the default.
Syntax
gre p2mp branch-network-mask { mask | mask-length | ipv6 prefix-length }
undo gre p2mp branch-network-mask [ ipv6 ]
Default
The IPv4 address mask is 255.255.255.255 (the mask length is 32) and the IPv6 address prefix length is 128 for branch networks.
Views
Tunnel interface view
Predefined user roles
network-admin
Parameters
mask: Specifies the IPv4 address mask, in dotted decimal notation.
mask-length: Specifies the IPv4 address mask length, in the range of 0 to 32.
ipv6 prefix-length: Specifies the IPv6 address prefix length, in the range of 0 to 128.
Usage guidelines
This command is applicable only to GRE P2MP tunnel interfaces.
This command enables a GRE P2MP tunnel interface to use the same network mask or prefix length to create dynamic tunnel entries for branch networks. One branch has only one dynamic tunnel entry.
To ensure successful packet forwarding, make sure all branch networks have the same network mask or prefix length, which is the same as that specified by this command.
Examples
# Specify the IPv4 branch network mask as 255.255.255.0 for GRE P2MP dynamic tunnel entries on tunnel interface Tunnel 0.
<Sysname> system-view
[Sysname] interface tunnel 0 mode gre-p2mp
[Sysname-Tunnel0] gre p2mp branch-network-mask 255.255.255.0
gre p2mp nexthop-learning
Use gre p2mp nexthop-learning to enable next hop host route learning.
Use undo gre p2mp nexthop-learning to disable next hop host route learning.
Syntax
gre p2mp nexthop-learning
undo gre p2mp nexthop-learning
Default
Next hop host route learning is disabled.
Views
Tunnel interface view.
Predefined user roles
network-admin
Usage guidelines
This command is supported only on GRE/IPv4 P2MP tunnel interfaces.
The headquarters gateway uses the same branch network mask to create tunnel entries for all branch networks. If some branch network addresses are in the same subnet, the headquarters gateway will learn the same destination address for these branch networks in the tunnel entries. In this case, the headquarters cannot establish BGP neighbors with these branches.
To resolve this issue, enable next hop host route learning on the headquarters gateway. This feature enables the gateway to learn destination addresses with the 32-bit mask when it establishes a BGP neighbor relationship with peers that are in the same subnet.
Examples
# Enable next hop host route learning on GRE/IPv4 P2MP tunnel interface Tunnel 0.
<Sysname> system-view
[Sysname] interface tunnel 0 mode gre-p2mp
[Sysname-Tunnel0] gre p2mp nexthop-learning
Related commands
gre p2mp branch-network-mask
gre p2mp-template (system view)
Use gre p2mp-template to create a GRE P2MP tunnel template and enter its view, or enter the view of an existing GRE P2MP tunnel template.
Use undo gre p2mp-template to delete a GRE P2MP tunnel template.
Syntax
gre p2mp-template template-name
undo gre p2mp-template template-name
Default
No GRE P2MP tunnel templates exist.
Views
System view
Predefined user roles
network-admin
Parameters
template-name: Specifies a name for the GRE P2MP tunnel template, a case-sensitive string of 1 to 31 characters.
Examples
# Create a GRE P2MP tunnel template named aa and enter its view.
<Sysname> system-view
[Sysname] gre p2mp-template aa
[Sysname-p2mp-template-aa]
Related commands
map
gre p2mp-template (tunnel interface view)
Use gre p2mp-template to apply a GRE P2MP tunnel template to a GRE P2MP tunnel interface.
Use undo gre p2mp-template to restore the default.
Syntax
gre p2mp-template template-name
undo gre p2mp-template
Default
No GRE P2MP tunnel template is applied to a GRE P2MP tunnel interface.
Views
Tunnel interface view
Predefined user roles
network-admin
Parameters
template-name: Specifies a GRE P2MP tunnel template by its name, a case-sensitive string of 1 to 31 characters.
Usage guidelines
A GRE P2MP tunnel interface can use only one GRE P2MP tunnel template. If you execute this command multiple times, the most recent configuration takes effect.
Examples
# Apply GRE P2MP tunnel template aa to GRE P2MP tunnel interface Tunnel 1.
<Sysname> system-view
[Sysname] interface tunnel 1 mode gre-p2mp
[Sysname-Tunnel1] gre p2mp-template aa
Related commands
gre p2mp-template (system view)
gre vpc enable
Use gre vpc enable to enable GRE packets to carry virtual private cloud (VPC) information.
Use undo gre vpc enable to disable GRE packets from carrying VPC information.
Syntax
gre vpc enable
undo gre vpc enable
Default
GRE packets do not carry VPC information.
Views
Tunnel interface view
Predefined user roles
network-admin
Usage guidelines
Enable this feature for a GRE/IPv4 tunnel in a VPC network. After receiving a packet carrying VPN information, the source end of the GRE tunnel transforms the VPN information into a VPCID and then forwards the packet. After the destination end of the GRE tunnel receives the packet, it transforms the VPCID into VPN information and then forwards the packet to the VPN.
In a VPC network, the VPN name must be a number. Otherwise, the VPN information cannot be transformed into a VPCID.
Do not use this command together with the gre key command on the same tunnel interface.
Examples
# Enable GRE packets to carry VPC information.
<Sysname> system-view
[Sysname] interface tunnel 1 mode gre
[Sysname-Tunnel1] gre vpc enable
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
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
map
Use map to configure a tunnel mapping entry in a GRE P2MP tunnel template.
Use undo map to delete a tunnel mapping entry from a GRE P2MP tunnel template.
Syntax
map [ vpn-instance vpn-instance-name ] branch-network-address branch-network-address { mask | mask-length } tunnel-destination tunnel-dest-address [ checksum-fill checksum-value ]
undo map [ vpn-instance vpn-instance-name ] branch-network-address branch-network-address { mask | mask-length } [ tunnel-destination tunnel-dest-address ]
Default
No tunnel mapping entries are configured in a GRE P2MP tunnel template.
Views
GRE P2MP tunnel template view
Predefined user roles
network-admin
Parameters
vpn-instance vpn-instance-name: Specifies an MPLS L3VPN instance by its name. The vpn-instance-name argument is a case-sensitive string of 1 to 31 characters. If the branch network address belongs to a private network, you must specify this option. If the branch network address belongs to the public network, do not specify this option.
branch-network-address branch-network-address: Specifies an IPv4 branch network address.
mask: Specifies the mask of the branch network IPv4 address, in dotted decimal notation.
mask-length: Specifies the mask length of the branch network IPv4 address, in the range of 0 to 32.
tunnel-destination tunnel-dest-address: Specifies the tunnel destination IPv4 address.
checksum-fill checksum-value: Specifies an IPv4 address to fill in the checksum field of the GRE header. The IPv4 address is in dotted decimal notation. If you do not specify this option, the device does not fill in the checksum field of the GRE header.
Usage guidelines
The tunnel mapping entries in the tunnel template are static tunnel entries.
You can repeat this command to configure multiple tunnel mapping entries for a GRE P2MP tunnel template. Each entry defines a mapping between a branch network address and a tunnel destination address. One branch network address can be mapped to only one tunnel destination address.
If a branch network contains VMs that have multiple users, fill the IPv4 address of the destination VM to the checksum field for correct forwarding of a GRE packet. Specify the checksum-fill checksum-value option depending on your network. Incorrect usage of the option will cause GRE checksum failures.
Examples
# In GRE P2MP tunnel template aa, configure a tunnel mapping entry. The branch network address is 192.168.0.11 and the mask length is 32, the tunnel destination address is 10.108.113.71, and the IPv4 address to fill in the checksum field is 192.168.20.1.
<Sysname> system-view
[Sysname] gre p2mp-template aa
[Sysname-p2mp-template-aa] map branch-network-address 192.168.0.11 32 tunnel-destination 10.108.113.71 checksum-fill 192.168.20.1
Related commands
gre p2mp-template (system view)
reset gre p2mp tunnel-table
Use reset gre p2mp tunnel-table to clear dynamic tunnel entry information for a GRE P2MP tunnel interface.
Syntax
reset gre p2mp tunnel-table interface tunnel number [ destination { dest-address | ipv6 dest-ipv6-address } tunnel-destination { tunnel-dest-address | ipv6 tunnel-dest-address } ]
Views
User view
Predefined user roles
network-admin
Parameters
interface tunnel number: Specifies a GRE P2MP tunnel interface by its interface number.
destination { dest-address | ipv6 dest-ipv6-address }: Specifies an IPv4 or IPv6 branch network address of the specified GRE P2MP tunnel interface.
tunnel-destination { tunnel-dest-address | ipv6 tunnel-dest-address }: Specifies a tunnel destination IPv4 or IPv6 address.
Usage guidelines
If you do not specify a branch network address or a tunnel destination address, this command clears all dynamic tunnel entries for the specified GRE P2MP tunnel interface.
Examples
# Clear all dynamic tunnel entries for GRE P2MP tunnel interface Tunnel 0.
<Sysname> reset gre p2mp tunnel-table interface tunnel 0
# Clear a dynamic tunnel entry of which the branch network is 10.0.0.1 and the tunnel destination is 20.0.0.1 on GRE P2MP tunnel interface Tunnel 0.
<Sysname> reset gre p2mp tunnel-table interface tunnel 0 destination 10.0.0.1 tunnel-destination 20.0.0.1
Related commands
display gre p2mp tunnel-table interface tunnel
reset gre p2mp tunnel-table statistics
Use reset gre p2mp tunnel-table statistics to clear packet statistics of static tunnel entries for a GRE P2MP tunnel interface.
Syntax
reset gre p2mp tunnel-table statistics interface tunnel number [ vpn-instance vpn-instance-name ] [ branch-network-address branch-network-address { mask | mask-length } ]
Views
User view
Predefined user roles
network-admin
Parameters
interface tunnel number: Specifies an existing GRE P2MP tunnel interface by its interface number.
vpn-instance vpn-instance-name: Specifies an MPLS L3VPN instance by its name. The vpn-instance-name argument is a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command clears packet statistics of static tunnel entries on the public network for the specified GRE P2MP tunnel interface.
branch-network-address branch-network-address: Specifies a branch network IPv4 address. If you do not specify this option, the command clears packet statistics of static tunnel entries for all IPv4 branch networks of the specified scope.
mask: Specifies the mask of the branch network address, in dotted decimal notation.
mask-length: Specifies the mask length of the branch network address, in the range of 0 to 32.
Usage guidelines
If you do not specify any parameters, this command clears packet statistics of all static tunnel entries on the public network for the specified GRE P2MP tunnel interface.
Examples
# Clear packet statistics of all static tunnel entries on the public network for GRE P2MP tunnel interface Tunnel 1.
<Sysname> reset gre p2mp tunnel-table statistics interface tunnel 1
Related commands
display gre p2mp tunnel-table statistics
tunnel route-static
Use tunnel route-static to configure the preference of static routes for a GRE P2MP tunnel interface.
Use undo tunnel route-static to restore the default.
Syntax
tunnel route-static [ preference preference-value ]
undo tunnel route-static
Default
The preference of static routes is 60 for a GRE P2MP tunnel interface.
Views
Tunnel interface view
Predefined user roles
network-admin
Parameters
preference preference-value: Specifies a preference value in the range of 1 to 255. The default value is 60, which is not affected by the ip route-static default-preference command.
Usage guidelines
A GRE P2MP tunnel interface automatically issues reachable static routes according to the tunnel mapping entries configured in the GRE P2MP tunnel template applied to the interface. This command takes effect on these static routes.
Examples
# Set the preference of static routes to 3 for GRE P2MP tunnel interface Tunnel 1.
<Sysname> system-view
[Sysname] interface tunnel 1 mode gre-p2mp
[Sysname-Tunnel1] tunnel route-static preference 3
Related commands
display ip routing-table protocol (Layer 3—IP Routing Command Reference)