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, a device 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. By default, the tunnel is a GRE over IPv4 tunnel. 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 for packet forwarding through 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. |
8. Return to system view. | quit | N/A |
9. Configure the device to discard the IPv4-compatible IPv6 packets. | tunnel discard ipv4-compatible-packet | Optional. By default, the device does not discard the IPv4-compatible IPv6 packets. |
For information about tunnel interfaces and more configuration commands in a tunnel interface, see "Configuring tunneling."
For information about commands interface tunnel, tunnel-protocol, source, destination, and tunnel discard ipv4-compatible-packet, see Layer 3—IP Services Command Reference.