191Configuring a GRE over IPv4 tunnelConfiguration restrictions and guidelines• The source address or interface and the destination address that are specified for the tunnelinterface must be a public address or interface.• The source address and destination address of a tunnel uniquely identify a path. They must beconfigured at both ends of the tunnel and the source address at one end must be the destinationaddress at the other end and vice versa.• The source addresses, destination addresses, or both source and destination addresses must bedifferent for the tunnel interfaces using the same encapsulation protocol.• If you configure a source interface for a tunnel interface, the tunnel interface takes the primary IPaddress 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 whosedestination 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 foras 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 interfaceconnecting the private network, so that the dynamic routing protocol can establish a routingentry 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 sourceinterface of the tunnel interface (for example, a VLAN interface or loopback interface), and makesure this interface can normally communicate with the interface used as the source interface of thetunnel interface on the peer device.• Create a service loopback group, specify its service type as tunnel, and add an unused Layer 2Ethernet port to the service loopback group. For more information about service loopback groups,see Layer 2—LAN Switching Configuration Guide.Configuration procedureTo configure a GRE over IPv4 tunnel:Step Command Remarks1. Enter system view. system-view N/A2. Create a tunnel interface andenter tunnel interface view. interface tunnel interface-number By default, a device has no tunnelinterface.3. Configure an IPv4 address forthe tunnel interface.ip address ip-address { mask |mask-length }By default, a tunnel interface hasno IPv4 address.