05-Network Connectivity Configuration Guide

HomeSupportConfigure & DeployConfiguration GuidesH3C WX2800X&WSG1800X Configuration Guides(E5611)-5W10105-Network Connectivity Configuration Guide
19-GRE configuration
Title Size Download
19-GRE configuration 220.11 KB

Configuring GRE

About GRE

Generic Routing Encapsulation (GRE) is a tunneling protocol that can encapsulate a protocol (such as IP, MPLS, or Ethernet) into a virtual point-to-point tunnel over a network (such as an IP network). Packets are encapsulated at one tunnel end and de-encapsulated at the other tunnel end. The network layer protocol of the packets before encapsulation and after encapsulation can be the same or different.

GRE encapsulation format

As shown in Figure 1, a GRE-tunneled packet includes the following parts:

·     Payload packet—Original packet. The protocol type of the payload packet is called the passenger protocol. The passenger protocol can be any network layer protocol.

·     GRE header—Header that is added to the payload packet to change the payload packet to a GRE packet. A GRE header includes the number of encapsulations, version, passenger protocol type, checksum, and key. GRE is called the encapsulation protocol.

·     Delivery header—Header that is added to the GRE packet to deliver it to the tunnel end. The transport protocol (or delivery protocol) is the network layer protocol that transfers GRE packets.

The device supports GRE tunnels with IPv4 and IPv6 as the transport protocols. When the transport protocol is IPv4, the GRE tunnel mode is GRE over IPv4 (GRE/IPv4). When the transport protocol is IPv6, the GRE tunnel mode is GRE over IPv6 (GRE/IPv6).

Figure 1 GRE encapsulation format

GRE tunnel operating principle

As shown in Figure 2, an IPv6 protocol packet traverses an IPv4 network through a GRE tunnel as follows:

1.     After receiving an IPv6 packet from the interface connected to IPv6 network 1, Device A processes the packet as follows:

a.     Looks up the routing table to identify the outgoing interface for the IPv6 packet.

b.     Submits the IPv6 packet to the outgoing interface—the GRE tunnel interface Tunnel 0.

2.     Upon receiving the packet, the tunnel interface encapsulates the packet with GRE and then with IPv4. In the IPv4 header:

¡     The source address is the tunnel's source address (the IP address of Interface A of Device A).

¡     The destination address is the tunnel's destination address (the IP address of Interface B of Device B).

3.     Device A looks up the routing table according to the destination address in the IPv4 header, and forwards the IPv4 packet out of the physical interface (Interface A) of the GRE tunnel.

4.     When the IPv4 arrives at the GRE tunnel destination Device B, Device B checks the destination address. Because the destination is Device B itself and the protocol number in the IP header is 47 (the protocol number for GRE), Device B submits the packet to GRE for de-encapsulation.

5.     GRE first removes the IPv4 header, and then checks the GRE key, checksum, and packet sequence number. After GRE finishes the checking, it removes the GRE header, and submits the payload to the IPv6 protocol for forwarding.

Figure 2 IPv6 networks interconnected through a GRE tunnel

GRE security mechanisms

GRE supports the GRE key and GRE checksum security mechanisms.

GRE key

GRE keys ensure packet validity. The sender adds a GRE key into a packet. The receiver compares the GRE key 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.

GRE checksum

GRE checksums ensure packet integrity. The sender calculates a checksum for the GRE header and payload and sends the packet containing the checksum to the tunnel peer. The receiver calculates a checksum for the received packet and compares it with that carried in the packet. If the checksums are the same, the receiver considers the packet intact and continues to process the packet. If the checksums are different, the receiver discards the packet.

GRE application scenarios

The following shows typical GRE application scenarios:

Connecting networks running different protocols over a single backbone

As shown in Figure 3, IPv6 network 1 and IPv6 network 2 are IPv6 networks, and IPv4 network 1 and IPv4 network 2 are IPv4 networks. Through the GRE tunnel between Device A and Device B, IPv6 network 1 can communicate with IPv6 network 2 and IPv4 network 1 can communicate with IPv4 network 2, without affecting each other.

Figure 3 Network diagram

Enlarging network scope

In an IP network, the maximum TTL value of a packet is 255. If two devices have more than 255 hops in between, they cannot communicate with each other. By using a GRE tunnel, you can hide some hops to enlarge the network scope. As shown in Figure 4, only the tunnel-end devices (Device A and Device D) of the GRE tunnel are counted in hop count calculation. Therefore, there are only three hops between Host A and Host B.

Figure 4 Network diagram

Protocols and standards

·     RFC 1701, Generic Routing Encapsulation (GRE)

·     RFC 1702, Generic Routing Encapsulation over IPv4 networks

·     RFC 2784, Generic Routing Encapsulation (GRE)

·     RFC 2890, Key and Sequence Number Extensions to GRE

Restrictions and guidelines: GRE configuration

When you configure a GRE tunnel, follow these restrictions and guidelines:

·     You must configure the tunnel source address and destination address at both ends of a tunnel. The tunnel source or destination address at one end must be the tunnel destination or source address at the other end.

·     As a best practice, do not configure the same tunnel source and destination addresses for local tunnel interfaces that use the same tunnel mode.

·     Do not configure the same tunnel source and destination addresses for a GRE tunnel interface and a GRE P2MP tunnel interface.

·     You can enable or disable GRE checksum at each end of a tunnel. If GRE checksum is enabled at a tunnel end, the tunnel end sends packets carrying the checksum to the peer end. A tunnel end checks the GRE checksum of a received packet if the packet carries a GRE checksum, whether or not the tunnel end is enabled with GRE checksum.

·     To ensure correct packet forwarding, identify whether the destination network of packets and the IP address of the local tunnel interface are on the same subnet. If they are not, configure a route reaching the destination network through the tunnel interface. You can configure the route by using one of the following methods:

¡     Configure a static route, using the local tunnel interface as the outgoing interface of the route.

¡     Enable a dynamic routing protocol on both the tunnel interface and the interface connecting the private network. This allows the dynamic routing protocol to establish a routing entry with the tunnel interface as the outgoing interface.

·     GRE encapsulation and de-encapsulation can decrease the forwarding efficiency of tunnel-end devices.

Configuring a GRE/IPv4 tunnel

Restrictions and guidelines

This task describes only GRE/IPv4 tunnel required tunnel interface commands (the interface tunnel, source, and destination commands). For more tunnel interface commands, see "Configuring tunneling."

Procedure

1.     Enter system view.

system-view

2.     Create a GRE tunnel interface, and specify the tunnel mode as GRE/IPv4.

interface tunnel number mode gre

You must configure the same tunnel mode on both ends of a tunnel. Otherwise, packet delivery might fail.

3.     Configure an IP address for the tunnel interface based on the passenger protocol.

IPv4:

For information about how to assign an IPv4 address to an interface, see "Configuring IP addressing."

IPv6:

For information about how to assign an IPv6 address to an interface, see "Configuring basic IPv6 settings."

By default, no IP address is configured for a tunnel interface.

4.     Configure a source address or source interface for the tunnel.

source { ip-address | interface-type interface-number }

By default, no source address or interface is configured for a tunnel.

If you configure a source address, the tunnel interface uses the source address as the source address of encapsulated packets.

If you configure a source interface, the tunnel interface uses the primary IP address of the source interface as the source address of encapsulated packets.

5.     Configure a destination address for the tunnel.

destination ip-address

By default, no destination address is configured for a tunnel.

The destination address is the address of the physical interface that the tunnel remote end uses to receive packets from the GRE tunnel.

The tunnel local end uses this address as the destination address of encapsulated packets.

The tunnel destination address and the IP address of the tunnel interface must be in different subnets.

6.     (Optional.) Enable GRE keepalive, and set the keepalive interval and keepalive number.

keepalive [ interval [ times ] ]

By default, GRE keepalive is disabled.

7.     (Optional.) Configure GRE security mechanisms.

¡     Enable GRE checksum.

gre checksum

By default, GRE checksum is disabled.

¡     Configure a GRE key for the GRE tunnel interface.

gre key key

By default, no GRE key is configured for a GRE tunnel interface.

The two ends of a GRE tunnel must have the same key or both have no key.

8.     (Optional.) Set the DF bit for encapsulated packets.

tunnel dfbit enable

By default, the DF bit is not set, allowing encapsulated packets to be fragmented.

Configuring a GRE/IPv6 tunnel

Restrictions and guidelines

This task describes only GRE/IPv6 tunnel required tunnel interface commands (the interface tunnel, source, and destination commands). For more tunnel interface commands, see "Configuring tunneling."

Procedure

1.     Enter system view.

system-view

2.     Create a GRE tunnel interface, and specify the tunnel mode as GRE/IPv6.

interface tunnel number mode gre ipv6

You must configure the same tunnel mode on both ends of a tunnel. Otherwise, packet delivery might fail.

3.     Configure an IP address for the tunnel interface based on the passenger protocol.

IPv4:

For information about how to assign an IPv4 address to an interface, see "Configuring IP addressing."

IPv6:

For information about how to assign an IPv6 address to an interface, see "Configuring basic IPv6 settings."

By default, no IP address is configured for a tunnel interface.

4.     Configure a source IPv6 address or source interface for the tunnel.

source { ipv6-address | interface-type interface-number }

By default, no source IPv6 address or interface is configured for a tunnel.

If you configure a source IPv6 address, the tunnel interface uses the source IPv6 address as the source IPv6 address of encapsulated packets.

If you configure a source interface, the tunnel interface uses the IPv6 address of the source interface as the source IPv6 address of encapsulated packets.

5.     Configure a destination IPv6 address for the tunnel.

destination ipv6-address

By default, no destination IPv6 address is configured for a tunnel.

The destination IPv6 address is the IPv6 address of the physical interface that the tunnel remote end uses to receive packets from the GRE tunnel.

The tunnel local end uses this address as the destination IPv6 address of encapsulated packets.

The tunnel destination address and the IP address of the tunnel interface must be in different subnets.

6.     (Optional.) Configure GRE security mechanisms.

¡     Enable GRE checksum.

gre checksum

By default, GRE checksum is disabled.

¡     (Optional.) Configure a GRE key for the tunnel interface.

gre key key

By default, no GRE key is configured for a GRE tunnel interface.

The two ends of a GRE tunnel must have the same key or both have no key.

Display and maintenance commands for GRE

Execute display commands in any view and reset commands in user view.

 

Task

Command

Remarks

Display information about tunnel interfaces.

display interface [ tunnel [ number ] ] [ brief [ description | down ] ]

For more information about the commands, see tunneling in Network Connectivity Command Reference.

Display IPv6 information about tunnel interface.

display ipv6 interface [ tunnel [ number ] ] [ brief ]

For more information about this command, see IPv6 basics in Network Connectivity Command Reference.

Clear tunnel interface statistics.

reset counters interface [ tunnel [ number ] ]

For more information about this command, see tunneling in Network Connectivity Command Reference.

Clear IPv6 statistics on tunnel interfaces.

reset ipv6 statistics

For more information about this command, see IPv6 basics in Network Connectivity Command Reference.

GRE configuration examples

Example: Configuring an IPv4 over IPv4 GRE tunnel

Network configuration

As shown in Figure 5, Group 1 and Group 2 are two private IPv4 networks. The two networks both use private network addresses. Establish a GRE tunnel between the AC and the peer device (Device) to interconnect the two private IPv4 networks Group 1 and Group 2.

Figure 5 Network diagram

Procedure

Before performing the following configuration, configure an IP address for each interface, and make sure the AC and Device can reach each other.

1.     Configure the AC:

# Create tunnel interface Tunnel 0, and specify the tunnel mode as GRE/IPv4.

<AC> system-view

[AC] interface tunnel 0 mode gre

# Configure an IP address for the tunnel interface.

[AC-Tunnel0] ip address 10.1.2.1 255.255.255.0

# Configure the source address of the tunnel as the IP address of VLAN-interface 101.

[AC-Tunnel0] source 1.1.1.1

# Configure the destination address of the tunnel as the IP address of GigabitEthernet 1/0/2.

[AC-Tunnel0] destination 2.2.2.2

[AC-Tunnel0] quit

# Configure a static route from the AC through the tunnel to Group 2.

[AC] ip route-static 10.1.3.0 255.255.255.0 tunnel 0

2.     Configure Device:

# Create tunnel interface Tunnel 0, and specify the tunnel mode as GRE/IPv4.

<Device> system-view

[Device] interface tunnel 0 mode gre

# Configure an IP address for the tunnel interface.

[Device-Tunnel0] ip address 10.1.2.2 255.255.255.0

# Configure the source address of the tunnel as the IP address of GigabitEthernet 1/0/2.

[Device-Tunnel0] source 2.2.2.2

# Configure the destination address of the tunnel as the IP address of VLAN-interface 101.

[Device-Tunnel0] destination 1.1.1.1

[Device-Tunnel0] quit

# Configure a static route from Device through the tunnel to Group 1.

[Device] ip route-static 10.1.1.0 255.255.255.0 Tunnel 0

Verifying the configuration

# Display tunnel interface information on the AC.

[AC] display interface tunnel 0

Tunnel0

Current state: UP

Line protocol state: UP

Description: Tunnel0 Interface

Bandwidth: 64kbps

Maximum transmission unit: 64000

Internet address: 10.1.2.1/24 (primary)

Tunnel source 1.1.1.1 (Vlan-interface101), destination 2.2.2.2

Tunnel keepalive disabled

Tunnel TTL 255

Tunnel protocol/transport GRE/IP

    GRE key disabled

    Checksumming of GRE packets disabled

Last clearing of counters: Never

Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec

Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec

Input: 0 packets, 0 bytes, 0 drops

Output: 0 packets, 0 bytes, 0 drops

# Display tunnel interface information on Device.

[Device] display interface tunnel 0

Tunnel0

Current state: UP

Line protocol state: UP

Description: Tunnel0 Interface

Bandwidth: 64kbps

Maximum transmission unit: 64000

Internet address:10.1.2.2/24 (primary)

Tunnel source 2.2.2.2, destination 1.1.1.1

Tunnel keepalive disabled

Tunnel TTL 255

Tunnel protocol/transport GRE/IP

    GRE key disabled

    Checksumming of GRE packets disabled

Last clearing of counters: Never

Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec

Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec

Input: 0 packets, 0 bytes, 0 drops

Output: 0 packets, 0 bytes, 0 drops

# From Device, ping the IP address of VLAN-interface 100 on the AC.

[Device] ping -a 10.1.3.1 10.1.1.1

Ping 10.1.1.1 (10.1.1.1) from 10.1.3.1: 56 data bytes, press CTRL_C to break

56 bytes from 10.1.1.1: icmp_seq=0 ttl=255 time=11.000 ms

56 bytes from 10.1.1.1: icmp_seq=1 ttl=255 time=1.000 ms

56 bytes from 10.1.1.1: icmp_seq=2 ttl=255 time=0.000 ms

56 bytes from 10.1.1.1: icmp_seq=3 ttl=255 time=0.000 ms

56 bytes from 10.1.1.1: icmp_seq=4 ttl=255 time=0.000 ms

 

--- Ping statistics for 10.1.1.1 ---

5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss

round-trip min/avg/max/std-dev = 0.000/2.400/11.000/4.317 ms

The output shows that Device can successfully ping the AC.

Example: Configuring an IPv4 over IPv6 GRE tunnel

Network configuration

As shown in Figure 6, two IPv4 subnets Group 1 and Group 2 are connected to an IPv6 network. Create a GRE/IPv6 tunnel between the AC and the peer device (Device), so the two IPv4 subnets can communicate with each other through the GRE tunnel over the IPv6 network.

Figure 6 Network diagram

Procedure

Before performing the following configuration, configure an IP address for each interface, and make sure the AC and Device can reach each other.

1.     Configure the AC:

# Create tunnel interface Tunnel 0, and specify the tunnel mode as GRE/ IPv6.

<AC> system-view

[AC] interface tunnel 0 mode gre ipv6

# Configure an IP address for the tunnel interface.

[AC-Tunnel0] ip address 10.1.2.1 255.255.255.0

# Configure the source address of the tunnel as the IPv6 address of VLAN-interface 101.

[AC-Tunnel0] source 2002::1:1

# Configure the destination address of the tunnel as the IPv6 address of GigabitEthernet 1/0/2.

[AC-Tunnel0] destination 2001::2:1

[AC-Tunnel0] quit

# Configure a static route from the AC through the tunnel to Group 2.

[AC] ip route-static 10.1.3.0 255.255.255.0 tunnel 0

2.     Configure Device:

# Create tunnel interface Tunnel 0, and specify the tunnel mode as GRE/IPv6.

<Device> system-view

[Device] interface tunnel 0 mode gre ipv6

# Configure an IP address for the tunnel interface.

[Device-Tunnel0] ip address 10.1.2.2 255.255.255.0

# Configure the source address of the tunnel as the IPv6 address of GigabitEthernet 1/0/2.

[Device-Tunnel0] source 2001::2:1

# Configure the destination address of the tunnel as the IPv6 address of VLAN-interface 101.

[Device-Tunnel0] destination 2002::1:1

[Device-Tunnel0] quit

# Configure a static route from Device through the tunnel to Group 1.

[Device] ip route-static 10.1.1.0 255.255.255.0 tunnel 0

Verifying the configuration

# Display tunnel interface information on the AC.

[AC] display interface tunnel 0

Tunnel0

Current state: UP

Line protocol state: UP

Description: Tunnel0 Interface

Bandwidth: 64kbps

Maximum transmission unit: 64000

Internet address: 10.1.2.1/24 (primary)

Tunnel source 2002::1:1, destination 2001::2:1

Tunnel TTL 255

Tunnel protocol/transport GRE/IPv6

    GRE key disabled

    Checksumming of GRE packets disabled

Last clearing of counters: Never

Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec

Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec

Input: 0 packets, 0 bytes, 0 drops

Output: 0 packets, 0 bytes, 0 drops

# Display tunnel interface information on Device.

[Device] display interface tunnel 0

Tunnel0

Current state: UP

Line protocol state: UP

Description: Tunnel0 Interface

Bandwidth: 64kbps

Maximum transmission unit: 64000

Internet address:10.1.2.2/24 (primary)

Tunnel source 2001::2:1, destination 2002::1:1

Tunnel TTL 255

Tunnel protocol/transport GRE/IPv6

    GRE key disabled

    Checksumming of GRE packets disabled

Last clearing of counters: Never

Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec

Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec

Input: 0 packets, 0 bytes, 0 drops

Output: 0 packets, 0 bytes, 0 drops

# From Device, ping the IP address of VLAN-interface 100 on the AC.

[Device] ping -a 10.1.3.1 10.1.1.1

Ping 10.1.1.1 (10.1.1.1) from 10.1.3.1: 56 data bytes, press CTRL_C to break

56 bytes from 10.1.1.1: icmp_seq=0 ttl=255 time=2.000 ms

56 bytes from 10.1.1.1: icmp_seq=1 ttl=255 time=1.000 ms

56 bytes from 10.1.1.1: icmp_seq=2 ttl=255 time=1.000 ms

56 bytes from 10.1.1.1: icmp_seq=3 ttl=255 time=0.000 ms

56 bytes from 10.1.1.1: icmp_seq=4 ttl=255 time=1.000 ms

 

--- Ping statistics for 10.1.1.1 ---

5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss

round-trip min/avg/max/std-dev = 0.000/1.000/2.000/0.632 ms

The output shows that Device can successfully ping the AC.

Troubleshooting GRE

The key to configuring GRE is to keep the configuration consistent. Most faults can be located by using the debugging gre or debugging tunnel command. This section analyzes one type of fault for illustration, with the scenario shown in Figure 7.

Figure 7 Network diagram

Hosts at both ends of a GRE tunnel cannot ping each other

Symptom

The interfaces at both ends of the tunnel are configured correctly and can ping each other, but Host A and Host B cannot ping each other.

Solution

To resolve the issue:

1.     Execute the display ip routing-table command on Device A and Device C to view whether Device A has a route over tunnel 0 to 10.2.0.0/16 and whether Device C has a route over tunnel 0 to 10.1.0.0/16.

2.     If such a route does not exist, execute the ip route-static command in system view to add the route. Take Device A as an example:

[DeviceA] ip route-static 10.2.0.0 255.255.0.0 tunnel 0

3.     If the issue persists, contact H3C Support.


Configuring GRE P2MP tunnels

About GRE P2MP tunnels

The GRE point-to-multipoint (P2MP) tunnel technology allows the device to use a GRE P2MP tunnel interface to establish a tunnel with multiple destinations.

Application scenario

As shown in Figure 8, an enterprise has multiple branches. For the headquarters to communicate with the branches through tunnels, you can deploy GRE P2MP.

Configure a GRE P2MP tunnel interface on the gateway of the headquarters. Configure GRE/IPv4 or GRE/IPv6 tunnel interfaces (also called point-to-point GRE tunnel interfaces) on the gateways of the branch networks. Use the GRE P2MP tunnel interface on the headquarters gateway to set up a point-to-multipoint tunnel with the point-to-point GRE tunnel interfaces on the branch gateways.

Figure 8 GRE P2MP tunnel application

Benefits

Compared with GRE point-to-point tunnels and other dynamic VPN technologies, GRE P2MP has the following benefits:

·     Simplified configuration—One GRE P2MP tunnel interface can set up a point-to-multipoint tunnel with multiple point-to-point GRE tunnel interfaces. You do not need to create multiple GRE tunnel interfaces for the headquarters gateway to establish point-to-point tunnels with each branch.

·     Good interoperability and decreased TCO—The device implements GRE P2MP based on the standard GRE protocol. It does not require other proprietary protocols. GRE P2MP does not have special requirements for the branch gateways. You can use any devices that support GRE as branch gateways.

Working mechanisms

GRE uses the same packet encapsulation and de-encapsulation processes for point-to-multipoint and point-to-point tunnels.

When the device uses a GRE P2MP tunnel to forward traffic, it searches the tunnel entries for the tunnel destination address based on the packet destination IP address. GRE encapsulates the tunnel destination address as the destination IP address in the GRE transport protocol header.

GRE P2MP static tunnel entry configuration

In the current software version, the device supports only IPv4 static tunnel entries for GRE P2MP.

Restrictions and guidelines: GRE P2MP tunnel configuration

For more information about the interface tunnel and source commands and additional configuration commands on a tunnel interface, see "Configuring tunneling" and tunneling commands in Network Connectivity Command Reference.

Restrictions and guidelines for the headquarters end of a P2MP tunnel

When you configure the headquarters end of a P2MP tunnel, follow these restrictions and guidelines:

·     Do not configure the same tunnel source address for multiple P2MP tunnel interfaces on the gateway.

·     Do not configure the same tunnel source and destination addresses for a GRE P2MP tunnel interface and a GRE tunnel interface.

·     Do not configure a GRE key on a GRE P2MP tunnel interface.

Restrictions and guidelines for the branch ends of a P2MP tunnel

The branch networks cannot communicate with one another. They do not have tunnels to reach one another.

When you configure the branch ends of a P2MP tunnel, follow these restrictions and guidelines:

·     The tunnel destination address at each branch end must be the tunnel source address configured on the P2MP tunnel interface on the headquarters.

·     On each gateway, the IP address of the tunnel interface and the tunnel destination address configured on the tunnel interface must be in different subnets.

Restrictions and guidelines for all ends of a P2MP tunnel

The following restrictions and guidelines apply to all ends of a P2MP tunnel:

·     You can enable or disable GRE checksum at each end of a tunnel. If GRE checksum is enabled at a tunnel end, the tunnel end sends packets carrying the checksum to the peer end. A tunnel end checks the GRE checksum of a received packet if the packet carries a GRE checksum, whether or not the tunnel end is enabled with GRE checksum.

·     Configure routes reaching the destination networks through the local tunnel interface. You can configure the routes by using one of the following methods:

¡     Configure static routes, using the local tunnel interface as the outgoing interface of the routes.

¡     Enable a dynamic routing protocol on both the tunnel interface and the interface connecting the private network. This allows the dynamic routing protocol to establish routing entries with the tunnel interface as the outgoing interface.

Configuring a GRE P2MP tunnel interface

Configuring a GRE P2MP tunnel interface for static entry-based tunnel setup

1.     Enter system view.

system-view

2.     Create a GRE P2MP tunnel template and enter its view.

gre p2mp-template template-name

3.     Configure a tunnel mapping entry.

map branch-network-address branch-network-address { mask | mask-length } tunnel-destination tunnel-dest-address [ checksum-fill checksum-value ]

By default, no tunnel mapping entries are configured for a GRE P2MP tunnel template.

Specify the checksum-fill checksum-value option depending on your network. The option might cause GRE checksum failures.

4.     Return to system view.

quit

5.     Create a GRE P2MP tunnel interface and enter its view.

interface tunnel interface-number mode gre-p2mp

The other end of a GRE P2MP tunnel interface must be a GRE/IPv4 tunnel interface.

6.     Configure an IPv4 address for the tunnel interface.

For information about how to assign an IPv4 address to an interface, see "Configuring IP addressing."

By default, no IPv4 address is configured for a tunnel interface.

7.     Configure a source IP address or source interface for the tunnel.

source { ipv4-address | interface-type interface-number }

By default, no source IP address or interface is configured for a tunnel.

If you configure a source IP address, the tunnel interface uses the source IP address as the source IP address of encapsulated packets.

If you configure a source interface, the tunnel interface uses the primary IP address of the source interface as the source IP address of encapsulated packets.

8.     Apply the GRE P2MP tunnel template to the tunnel interface.

gre p2mp-template template-name

By default, no GRE P2MP tunnel template is applied to a GRE P2MP tunnel interface.

You must specify an existing GRE P2MP tunnel template for this command.

9.     (Optional.) Enable GRE checksum.

gre checksum

By default, GRE checksum is disabled.

Display and maintenance commands for GRE P2MP tunnels

Execute display commands in any view and reset commands in user view.

 

Task

Command

Display packet statistics of static tunnel entries for a GRE P2MP tunnel interface.

display gre p2mp tunnel-table statistics interface tunnel number [ branch-network-address branch-network-address { mask | mask-length } ]

Clear packet statistics of static tunnel entries for a GRE P2MP tunnel interface.

reset gre p2mp tunnel-table statistics interface tunnel number [ branch-network-address branch-network-address { mask | mask-length } ]

 

GRE P2MP tunnel configuration examples

Example: Configuring a static entry-based GRE P2MP tunnel

Network configuration

As shown in Figure 9, Device A is the gateway of the headquarters, and Device B and Device C are the gateways of the branches.

Configure the devices as follows:

·     On Device A, configure a GRE P2MP tunnel interface for the device to set up a GRE P2MP tunnel with multiple branch gateways.

·     On Device A, configure a GRE P2MP tunnel template that contains tunnel mapping entries for Branch 1 and Branch 2. Apply the GRE P2MP tunnel template to the GRE P2MP tunnel interface so that the headquarters gateway can actively send packets to the branches.

·     On Device B and Device C, configure GRE/IPv4 tunnel interfaces for the devices to set up GRE tunnels with Device A.

Figure 9 Network diagram

Table 1 IP address assignment

Device

Interface

IP address

Device

Interface

IP address

Device A

GE1/0/1

11.1.1.1/24

Device B

GE1/0/1

11.1.2.1/24

GE1/0/2

192.168.11.1/24

GE1/0/2

192.168.12.1/24

Tunnel0

192.168.22.1/24

Tunnel0

192.168.22.2/24

Device C

GE1/0/1

11.1.3.1/24

Device C

Tunnel0

192.168.22.3/24

GE1/0/2

192.168.13.1/24

 

 

 

Prerequisites

Configure IP addresses as shown in Figure 9. Make sure Device A and Device B have routes to reach each other, and Device A and Device C have routes to reach each other.

Procedure

This example uses Device B to describe the gateway configuration for a branch. The gateway configuration for other branches is the same as the gateway configuration on Device B.

In this example, a tunnel mapping entry is configured for reaching Host B in Branch 1. The tunnel mapping entry configuration for reaching other devices or branch networks is the same as that for reaching Host B.

1.     Configure Device A:

# Create a GRE P2MP tunnel template named aa and enter its view.

<DeviceA> system-view

[DeviceA] gre p2mp-template aa

# Configure a tunnel mapping entry. The branch network address is 192.168.12.2, the branch network mask length is 32, and the tunnel destination address is 11.1.2.1.

[DeviceA-p2mp-template-aa] map branch-network-address 192.168.12.2 32 tunnel-destination 11.1.2.1

# Create tunnel interface Tunnel 0 and specify the tunnel mode as GRE P2MP.

[DeviceA] interface tunnel 0 mode gre-p2mp

# Specify an IP address for the tunnel interface.

[DeviceA-Tunnel0] ip address 192.168.22.1 255.255.255.0

# Specify the source IP address of the tunnel. The IP address is the IP address of GigabitEthernet 1/0/1 on Device A.

[DeviceA-Tunnel0] source 11.1.1.1

# Apply GRE P2MP tunnel template aa to GRE P2MP tunnel interface Tunnel 0.

[DeviceA-Tunnel0] gre p2mp-template aa

[DeviceA-Tunnel0] quit

2.     Configure Device B:

# Create tunnel interface Tunnel 0 and specify the tunnel mode as GRE/IPv4.

<DeviceB> system-view

[DeviceB] interface tunnel 0 mode gre

# Specify an IP address for the tunnel interface.

[DeviceB-Tunnel0] ip address 192.168.22.2 255.255.255.0

# Specify the source IP address of the tunnel. The source IP address is the IP address of GigabitEthernet 1/0/1 on Device B.

[DeviceB-Tunnel0] source 11.1.2.1

# Specify the destination address of the tunnel. The destination address is the IP address of GigabitEthernet 1/0/1 on Device A.

[DeviceB-Tunnel0] destination 11.1.1.1

[DeviceB-Tunnel0] quit

# Configure a static route from Device B through Tunnel 0 to the headquarters.

[DeviceB] ip route-static 192.168.11.0 255.255.255.0 tunnel 0

Verifying the configuration

# Verify that you can ping Host B from Host A. (Details not shown.)

# Display GRE P2MP static tunnel entries and packet statistics on Device A. The output shows that Device A has GRE P2MP static tunnel entries and packet statistics.

[DeviceA] display gre p2mp tunnel-table statistics interface Tunnel 0

 

VPN-instance name: -  Map number: 1

 

  Branch network address: 192.168.12.2/32

  Tunnel destination address: 11.1.2.1

  Input:

    5 packets, 420 bytes, 0 drops

  Output:

    5 packets, 420 bytes, 0 drops

 

 

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Intelligent Storage
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
  • Technical Blogs
All Support
  • Become A Partner
  • Partner Policy & Program
  • Global Learning
  • Partner Sales Resources
  • Partner Business Management
  • Service Business
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网