The IPv6 over IPv4 GRE tunnel is a simple point-to-point one. Compared with the manual tunnel, this tunnel has enhanced security.
The IPv6 over IPv4 GRE tunnel is configured between two border devices.
As shown in Figure 1, FW_A and FW_B support the dual stack, and are connected to the IPv6 networks and IPv4 network respectively. The IPv6 over IPv4 manual tunnel connects to two different IPv6 networks, enabling the PCs or devices on different IPv6 networks to communicate.
Tunnel Route
Before you configure a tunnel route, ensure that the IPv4 interface connecting to the IPv4 network is in Up state, and IPv4 interfaces on both ends of the tunnel are routable.
After the tunnel is established, the source and destination are routable to each other to ensure normal packet forwarding. Either static routes or dynamic routes can be configured.
To configure a static route, set the destination address to the IPv6 address of the interface on the peer IPv6 network and the outbound interface to the local tunnel interface.
To configure a dynamic route, enable dynamic routing protocols on the tunnel interface and interfaces connected to the IPv4 network and IPv6 network. The IPv6 over IPv4 GRE tunnel supports RIPng, OSPFv3 and BGP4+.
interface tunnel interface-number
tunnel-protocol gre
source { ipv4-address | interface-type interface-number }
You can set the source address of a GRE tunnel to the IPv4 address of the interface connecting to the IPv4 network or configure this interface as the source interface.
Moreover, you can specify a physical interface or a logical interface, such as the loopback interface, as the source interface.
destination ipv4-address
The destination address is the source address of the peer device. As shown in Figure 1, the source IP address of FW_A is 1.1.2.1/24 and that of FW_B is 1.1.1.1/24.
The destination address is the domain name of the peer device.
ipv6 address { ipv6-address prefix-length | ipv6-address/prefix-length }
gre key key-number
If you set key-number for both ends of the tunnel, ensure that the same value is specified.
FW_A and FW_B are border devices between IPv6 and IPv4 networks. The IPv4 address of the GigabitEthernet0/0/1 interface on FW_A that connects to the IPv4 network is 1.1.1.1/24, and that of the GigabitEthernet0/0/1 interface on FW_B that connects to the IPv4 network is 1.1.1.2/24. The IPv6 over IPv4 GRE tunnel is established between FW_A and FW_B.
# Set the encapsulation type, source address, and destination address of the tunnel, and the IPv6 address of the tunnel interface for FW_A.
<FW> system-view [FW] sysname FW_A [FW_A] ipv6 [FW_A] interface tunnel 1 [FW_A-Tunnel1] tunnel-protocol gre [FW_A-Tunnel1] ipv6 enable [FW_A-Tunnel1] source 1.1.1.1 [FW_A-Tunnel1] destination 1.1.2.1 [FW_A-Tunnel1] ipv6 address 3001::1 64
# Suppose that the IPv6 address of the interface on FW_B that connects to the IPv6 network is 3011::1/64 and configure a route from FW_B to the IPv6 network.
[FW_A] ipv6 route-static 3011:: 64 tunnel 1
# Set the encapsulation type, source address, and destination address of the tunnel, and the IPv6 address of the tunnel interface for FW_B.
<FW> system-view [FW] sysname FW_B [FW_B] ipv6 [FW_B] interface tunnel 1 [FW_B-Tunnel1] tunnel-protocol gre [FW_B-Tunnel1] ipv6 enable [FW_B-Tunnel1] source 1.1.2.1 [FW_B-Tunnel1] destination 1.1.1.1 [FW_B-Tunnel1] ipv6 address 3001::2 64
# Suppose that the IPv6 address of the interface on FW_A that connects to the IPv6 network is 2011::1/64 and configure a route from FW_A to the IPv6 network.
[FW_B] ipv6 route-static 2011:: 64 tunnel 1