- Table of Contents
- Related Documents
-
Title | Size | Download |
---|---|---|
07-GRE Commands | 71.8 KB |
Chapter 1 GRE Configuration Commands
1.1 GRE Configuration Commands
1.1.4 display interface tunnel
1.1.5 display ipv6 interface tunnel
1.1.8 ipv6 mtu (tunnel Interface view)
1.1.9 mtu (tunnel Interface view)
Chapter 1 GRE Configuration Commands
1.1 GRE Configuration Commands
1.1.1 aggregation-group
Syntax
aggregation-group aggregation-group-ID
undo aggregation-group
View
Tunnel interface view
Default Level
2: System level
Parameters
aggregation-group-ID: Service loop group ID.
Description
Use the aggregation-group command to specify the service loop group to be applied to a tunnel.
Use the undo aggregation-group command to remove the configuration.
By default, no service loop group is applied to a tunnel.
Before applying a service loop group to a tunnel in tunnel interface view, you need to configure the service loop group in system view and set its service type to tunnel.
Related commands: link-aggregation group.
Examples
# Create service loop group 1. Then, set the configuration mode to manual and the service type to tunnel.
<Sysname> system-view
[Sysname] link-aggregation group 1 mode manual
[Sysname] link-aggregation group 1 service-type tunnel
# Add the interface GigabitEthernet 4/2/1 to service loop group 1.
[Sysname] interface GigabitEthernet 4/2/1
[Sysname-GigabitEthernet 4/2/1] stp disable
[Sysname-GigabitEthernet 4/2/1] port link-aggregation group 1
[Sysname-GigabitEthernet 4/2/1] quit
# Apply service loop group 1 to the tunnel in tunnel interface view.
[Sysname] interface tunnel 2/0/1
[Sysname-Tunnel2/0/1] aggregation-group 1
# Remove the application of service loop group 1.
[Sysname-Tunnel2/0/1] undo aggregation-group
1.1.2 debugging gre
Syntax
debugging gre { all | error | packet }
undo debugging gre { all | error | packet }
View
User view
Default Level
1: Monitor level
Parameters
all: Turns on all the debugging switches of the GRE module.
error: Turns on the error information debugging switch of the GRE module.
packet: Turns on the packet information debugging switch of the GRE module.
Description
Use the debugging gre command to enable the GRE debugging switch.
Use the undo debugging gre command to disable the GRE debugging switch.
By default, the GRE debugging switch is disabled.
Table 1-1 Description on the fields of the debugging gre error command
Field |
Description |
Getting interface name failed. |
Failed to get the tunnel interface name according to the interface index. |
Getting interface type failed. |
Failed to get the tunnel interface type according to the interface index. |
Getting physical information failed. |
Failed to get the packet statistics of the tunnel interface. |
The number of recursive tunnel exceed max value. |
The packet was discarded because it had been encapsulated for too many times. |
Add tunnel key failed. |
Failed to add GRE key option information into the tunneled packet. |
Add tunnel checksum failed. |
Failed to add GRE checksum option information into the tunneled packet. |
Adding IPv4 header failed. |
Failed to add IPv4 header for the tunneled packet. |
Adding IPv6 header failed. |
Failed to add IPv6 header for the tunneled packet. |
The packet version field error. |
The version field of the GRE header is not all 0s. The packet is to be discarded. |
Failed to get GRE optional data. |
Failed to get the GRE tunnel mode data according to the tunnel interface index. |
Key not equal. |
The key values of the two GRE tunnel ends are not consistent. The GRE packet is to be discarded. |
Can not get tunnel transport protocol. |
Failed to get the transport protocol type according to the tunnel mode. |
Encapsulation limit check failed. |
Failed in encapsulation limit check of the tunnel IPv6 packet. |
Transmit packet failed. |
The GRE packet was not sent because the tunnel interface failed in sending it. |
Table 1-2 Description on the fields of the debugging gre packet command
Field |
Description |
Tunnelnum packet: Encapsulation protocol is pro-type |
The encapsulation protocol of interface Tunnelnum is pro-type. |
gre packet: Decapsulate tunnel packet Outer packet header ip-address1-> ip-address2(length = length) |
Decapsulating a packet. The source and destination addresses of the packet are ip-address1 and ip-address2 respectively and the packet size is length. |
Tunnelnum packet: After decapsulation, Outgoing packet header ip-address1-> ipaddress2 (length = length) |
On interface Tunnelnum: After the decapsulation, the source and destination addresses in the packet header are ip-address1 and ip-address2 respectively and the packet size is length. |
Examples
# Enable GRE debugging. Then, ping the destination address of a tunnel to view the output information.
<Sysname> debugging gre all
<Sysname> terminal debugging
<Sysname> ping ipv6 -c 1 2001:100::3
PING 2001:100::3 : 56 data bytes, press CTRL_C to break
*Mar 23 14:39:28:359 2007 Sysname GRE/7/debug:Slot=2;
Tunnel2/0/1 packet: Before encapsulation,
Incoming packet header 2001:0100::0001->2001:0100::0003(length = 104)
Reply from 2001:100::3
bytes=56 Sequence=1 hop limit=64 time = 7 ms
*Mar 23 14:39:28:566 2007 Sysname GRE/7/debug:Slot=2;
Tunnel2/0/1 packet:After encapsulation,
Outgoing packet header 10.100.10.1->10.100.20.3(length = 128)
--- 2001:100::3 ping statistics ---
1 packet(s) transmitted
1 packet(s) received
*Mar 23 14:39:28:756 2007 Sysname GRE/7/debug:Slot=2;
Tunnel2/0/1 packet: GRE physical transmit a packet(len = 128), usProtocol = 0x8
6dd.
0.00% packet loss
round-trip min/avg/max = 7/7/7 ms
<Sysname>
*Mar 23 14:39:28:926 2007 Sysname GRE/7/debug:Slot=2;
gre packet: Decapsulate tunnel packet
Outer packet header 10.100.20.3->10.100.10.1(length = 128)
*Mar 23 14:39:29:126 2007 Sysname GRE/7/debug:Slot=2;
Tunnel2/0/1 packet: After decapsulation,
Outgoing packet header 2001:0100::0003->2001:0100::0001(length = 104)
1.1.3 destination
Syntax
destination { Ip-address | Ipv6-address }
undo destination
View
Tunnel interface view
Default Level
2: System level
Parameters
Ip-address: Destination IPv4 address for the tunnel interface.
Ipv6-address: Destination IPv6 address for the tunnel interface.
Description
Use the destination command to specify the destination address for a tunnel interface.
Use the undo destination command to remove the configuration.
By default, no destination address is configured for a tunnel interface.
Note that:
l The destination address of a tunnel interface is the address of the peer interface receiving packets. It is usually set to the source address of the peer tunnel interface.
l Two or more tunnel interfaces using the same encapsulation protocol must have different source addresses and destination addresses.
Related commands: interface tunnel and source.
Examples
# Set VLAN interface 10 (193.101.1.1) of Switch 1 and VLAN interface 20 (192.100.1.1) of Switch 2 as the source (destination) interface and destination (source) interface of the tunnel between the two devices, mutually.
l Configure Switch 1.
<Sysname1> system-view
[Sysname1] interface Tunnel 3/0/1
[Sysname1-Tunnel3/0/1] source 193.101.1.1
[Sysname1-Tunnel3/0/1] destination 192.100.1.1
l Configure Switch 2.
<Sysname2> system-view
[Sysname2] interface Tunnel 4/0/1
[Sysname2-Tunnel4/0/1] source 192.100.1.1
[Sysname2-Tunnel4/0/1] destination 193.101.1.1
1.1.4 display interface tunnel
Syntax
display interface tunnel [ number ]
View
Any view
Default Level
1: Monitor level
Parameters
number: Tunnel interface number.
Description
Use the display interface tunnel command to display information about a specified or all tunnel interfaces.
With the number argument not specified, the command displays information about all tunnel interfaces.
Related commands: source, destination, tunnel-protocol.
Examples
# Display information about interface Tunnel 3/0/0.
<Sysname> display interface tunnel 3/0/0
Tunnel3/0/0 current state: UP
Line protocol current state: UP
Description: Tunnel3/0/0 Interface
The Maximum Transmit Unit is 1500
Internet protocol processing : disabled
Encapsulation is TUNNEL, aggregation ID is 10.
Tunnel source 10.0.0.1 (Vlan-interface10), destination 10.0.0.2
Tunnel protocol/transport GRE/IP
GRE key disabled
Checksumming of GRE packets disabled
Last 300 seconds input: 0 bytes/sec, 0 packets/sec
Last 300 seconds output: 0 bytes/sec, 0 packets/sec
0 packets input, 0 bytes
0 input error
0 packets output, 0 bytes
0 output error
Table 1-3 Description on the fields of the display interface tunnel command
Field |
Description |
Tunnel3/0/0 current state: UP |
Status of the physical layer of the tunnel interface is UP |
Line protocol current state: UP |
Status of the link layer of the tunnel interface is UP |
Description |
Descriptive information of the tunnel interface |
Tunnel3/0/0 Interface |
Number of the tunnel interface |
Maximum Transmit Unit |
Maximum transmission unit of the tunnel, 1500 bytes in this example |
Encapsulation is TUNNEL |
The encapsulation protocol is TUNNEL. |
aggregation ID |
ID of the service loop group applied to the tunnel. |
Tunnel source |
Source address of the tunnel interface |
destination |
Destination address of the tunnel interface |
Tunnel protocol/transport |
The Tunnel protocol/transport protocol that is in operation |
GRE key |
Keyword verification |
Checksumming of GRE packets |
End-to-end verification |
Last 300 seconds input |
Amount of inbound traffic per second in the last five minutes, in bytes and in packets respectively |
Last 300 seconds output |
Amount of outbound traffic per second in the last five minutes, in bytes and in packets respectively |
packets input |
Total number of bytes input |
input error |
Number of inbound packets in error |
packets output |
Total number of bytes output |
output error |
Number of outbound packets in error |
1.1.5 display ipv6 interface tunnel
Syntax
display ipv6 interface tunnel number
View
Any view
Default Level
1: Monitor level
Parameters
number: Tunnel interface number, in the format of board slot number/0/Tunnel interface number.
Description
Use the display ipv6 interface tunnel command to display IPv6 information about a tunnel interface, including the Tunnel interface link status, IPv6 status, IPv6 addresses of the Tunnel interfaces, etc.
Examples
# Display IPv6 information about interface Tunnel 3/0/0.
<Sysname> display ipv6 interface tunnel 3/0/0
Tunnel3/0/0 current state :UP
Line protocol current state :UP
IPv6 is enabled, link-local address is FE80::101:101
Global unicast address(es):
2002:101:101::1, subnet is 2002::/16
Joined group address(es):
FF02::1:FF01:101
FF02::1:FF00:1
FF02::2
FF02::1
MTU is 1500 bytes
ND reachable time is 30000 milliseconds
ND retransmit interval is 1000 milliseconds
Hosts use stateless autoconfig for addresses
Table 1-4 Description on the fields of the display ipv6 interface tunnel command
Field |
Description |
Tunnel3/0/0 current state: UP |
Status of the physical layer of the tunnel interface is UP |
Line protocol current state: UP |
Status of the link layer of the tunnel interface is UP |
IPv6 is enabled |
IPv6 is enabled on the tunnel interface |
link-local address |
Link-local address of the tunnel interface |
Global unicast address(es) |
Global unicast addresses of the tunnel interface |
Joined group address(es) |
Multicast addresses of the tunnel interface |
MTU is 1500 bytes |
Maximum transmission unit of the tunnel, 1500 bytes in this example |
ND reachable time |
Interval during which the neighbor is considered reachable |
ND retransmit interval |
Neighbor discovery packet retransmission interval |
Hosts use stateless autoconfig for addresses |
Hosts use the stateless auto-configuration mode to acquire an IPv6 addresses. |
1.1.6 expediting enable
Syntax
expediting enable
undo expediting enable
View
Tunnel interface view
Default Level
2: System level
Parameters
None
Description
Use the expediting enable command to enable the expediting function.
Use the undo expediting enable command to disable the expediting function.
By default, the expediting function is disabled.
Examples
# Enable the expediting function
<Sysname> system-view
[Sysname] interface tunnel 2/0/0
[Sysname-Tunnel2/0/0] expediting enable
1.1.7 interface tunnel
Syntax
interface tunnel number
undo interface tunnel number
View
System view
Default Level
2: System level
Parameters
number: Tunnel interface number, in the format of board slot number/0/Tunnel interface number.
Description
Use the interface tunnel command to create a tunnel interface and enter tunnel interface view.
Use the undo interface tunnel command to remove a tunnel interface.
By default, there is no tunnel interface on the device.
l Executing the interface tunnel command, you enter tunnel interface view if the tunnel interface exists.
l A tunnel interface number has only local significance. Therefore, the same or different interface numbers can be set at both ends of a tunnel.
Related commands: source, destination, tunnel-protocol.
Examples
# Create Tunnel 3/0/0.
<Sysname> system-view
[Sysname] interface tunnel 3/0/0.
1.1.8 ipv6 mtu (tunnel Interface view)
Syntax
ipv6 mtu mtu-size
undo ipv6 mtu
View
Tunnel interface view
Default Level
2: System level
Parameters
mtu-size: Size of the interface MTU, in bytes.
Description
Use the ipv6 mtu command to set the MTU for IPv6 packets on an interface.
Use the undo ipv6 mtu command to restore the default.
Examples
# Set the MTU on a tunnel interface to 1400 bytes.
<Sysname> system-view
[Sysname] interface tunnel 4/0/1
[Sysname-tunnel4/0/1] ipv6 mtu 1400
1.1.9 mtu (tunnel Interface view)
Syntax
mtu mtu-size
undo mtu
View
Tunnel interface view
Default Level
2: System level
Parameters
mtu-size: Specifies the MTU on a tunnel interface. The default value is 1500 bytes.
Description
Use the mtu command to set the MTU on a tunnel interface.
Use the undo mtu command to restore the default.
Examples
# Set the MTU on a tunnel interface to 1400 bytes.
<Sysname> system-view
[Sysname] interface tunnel 4/0/1
[Sysname-tunnel4/0/1] mtu 1400
1.1.10 source
Syntax
source { ip-address | ipv6-address | interface-type interface-number }
undo source
View
Tunnel interface view
Default Level
2: System level
Parameters
ip-address: Specifies the source IPv4 address for the tunnel interface.
Ipv6-address: Specifies the source IPv6 address for the tunnel interface.
interface-type interface-num: Type and number of an interface.
Description
Use the source command to specify the source address for a tunnel interface.
Use the undo source command to remove the configuration.
By default, no source address is configured for a tunnel interface.
Note that:
l The source address of a tunnel interface is the address of the interface sending GRE packets and is usually the destination address of the peer tunnel interface.
l Two or more tunnel interfaces using the same encapsulation protocol must have different source addresses and destination addresses.
Related commands: interface tunnel and destination.
Examples
# Create interface Tunnel 5/0/0 and configure the IP address 192.100.1.1 as the source address of packets leaving that interface.
<Sysname> system-view
[Sysname] interface Tunnel 5/0/0
[Sysname-Tunnel5/0/0] source 192.100.1.1
1.1.11 tunnel-protocol
Syntax
tunnel-protocol gre
undo tunnel-protocol
View
Tunnel interface view
Default Level
2: System level
Parameters
gre: Sets the tunnel mode to GRE.
Description
Use the tunnel-protocol gre command to set the GRE tunnel mode.
Use the undo tunnel-protocol to restore the default.
By default, the GRE tunnel mode is adopted.
Select a tunnel mode according to the network topology and application. Note that both ends of a tunnel must be configured with the same tunnel mode. Otherwise, packet delivery will fail.
Related commands: interface tunnel.
Examples
# Create a tunnel between Switch 1 and Switch 2. Then, configure the encapsulation protocol as GRE and the transport protocol as IP.
l Configure Switch 1.
<Sysname> system-view
[Sysname] interface Tunnel 5/0/0
[Sysname1-Tunnel5/0/0] tunnel-protocol gre
l Configure Switch 2.
<Sysname> system-view
[Sysname] interface Tunnel 2/0/0
[Sysname2-Tunnel2/0/0] tunnel-protocol gre