Configuration procedure
To configure a GRE/IPv6 tunnel:
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Create a GRE tunnel interface, and specify the tunnel mode as GRE/IPv6. | interface tunnel interface-number mode gre ipv6 | By default, no tunnel interfaces exist. You must configure the same tunnel mode on both ends of a tunnel. Otherwise, packet delivery might fail. |
3. Configure an IPv4 or IPv6 address for the tunnel interface. | For information about how to assign an IPv4 address to an interface, see "Configuring IP addressing." For information about how to assign an IPv6 address to an interface, see "Configuring basic IPv6 settings." | By default, no IPv4 or IPv6 address is configured for a tunnel interface. When the passenger protocol is IPv4, configure an IPv4 address for the tunnel interface. When the passenger protocol is IPv6, configure an IPv6 address for the tunnel interface. |
4. Configure a source IPv6 address or source interface for the tunnel interface. | source { ipv6-address | interface-type interface-number } | By default, no source IPv6 address or interface is configured for a tunnel interface. If you configure a source IPv6 address for a tunnel interface, the tunnel interface uses the source IPv6 address as the source IPv6 address of the encapsulated packets. If you configure a source interface for a tunnel interface, the tunnel interface uses the IPv6 address of the source interface as the source IPv6 address of the encapsulated packets. |
5. Configure a destination IPv6 address for the tunnel interface. | destination ipv6-address | By default, no destination IPv6 address is configured for a tunnel interface. 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 the encapsulated packets. |
6. (Optional.) Enable GRE checksum. | gre checksum | By default, GRE checksum is disabled. |
7. (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. |
8. Return to system view. | quit | N/A |
9. (Optional.) Configure the device to discard IPv6 packets with IPv4-compatible IPv6 addresses | tunnel discard ipv4-compatible-packet | By default, the device does not discard such IPv6 packets. |
For more information about the interface tunnel, source, destination, and tunnel discard ipv4-compatible-packet commands and additional configuration commands on a tunnel interface, see tunnel configuration and commands in Layer 3—IP Services Configuration Guide and Layer 3—IP Services Command Reference.