Configuration prerequisites, Configuration procedure – H3C Technologies H3C S12500 Series Switches User Manual

Page 241

Advertising
background image

227

If you configure a source interface for a tunnel interface, the tunnel interface takes the primary IP

address of the source interface as its source address.

When configuring a route through the tunnel, you are not allowed to set up a static route whose
destination address is in the subnet of the tunnel interface. Instead, you can do one of the following:

{

Configure a static route, using the address of the subnet that the original packet is destined for
as its destination address and the address of the peer tunnel interface as its next hop.

{

Enable a dynamic routing protocol on both the tunnel interface and the router interface
connecting the private network, so that the dynamic routing protocol can establish a routing

entry that allows the tunnel to forward packets through the tunnel.

Configuration prerequisites

On each of the peer devices, configure an IP address for the interface to be used as the source interface

of the tunnel interface (which can be a, for example, VLAN interface, Ethernet interface, or loopback

interface), and make sure that this interface can correctly communicate with the interface used as the
source interface of the tunnel interface on the peer device.

Configuration procedure

To configure a GRE over IPv4 tunnel:

Step Command

Remarks

1.

Enter system view.

system-view

N/A

2.

Create a tunnel interface and
enter tunnel interface view.

interface tunnel interface-number

By default, the switch has no tunnel
interface.

3.

Configure an IPv4 address for
the tunnel interface.

ip address ip-address { mask |
mask-length }

By default, a tunnel interface has
no IPv4 address.

4.

Set the tunnel mode to GRE
over IPv4.

tunnel-protocol gre

Optional.
The default tunnel mode is GRE

over IPv4.
You must configure the same tunnel
mode on both ends of a tunnel.

Otherwise, packet delivery will

fail.

5.

Configure the source address
or interface for the tunnel

interface.

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

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

6.

Configure the destination

address for the tunnel
interface.

destination ip-address

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

7.

Configure a route to direct
traffic to the tunnel.

See Layer 3—IP Routing
Configuration Guide
.

Each end of the tunnel must have a
route (static or dynamic) through

the tunnel to the other end.

Advertising