< Home

Configuring an IPv6 over IPv4 GRE Tunnel

The IPv6 over IPv4 GRE tunnel is a simple point-to-point one. Compared with the manual tunnel, this tunnel has enhanced security.

Prerequisites

Before configuring an IPv6 over IPv4 GRE tunnel, ensure that devices at both ends support the dual stack and the following configurations are complete:
  • IPv6 packet forwarding is enabled globally.
  • The IPv4 address of the interface connecting to the IPv4 network is specified, the interface is Up, and the IPv4 address is routable.

Context

Application Scenario

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.

Figure 1 Networking diagram of configuring the IPv6 over IPv4 GRE tunnel

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+.

Procedure

  1. Access the system view.

    system-view

  2. Create a tunnel interface and access the tunnel interface view.

    interface tunnel interface-number

  3. Set the tunnel encapsulation mode to GRE tunnel.

    tunnel-protocol gre

  4. Specify the source address or source interface of the GRE tunnel.

    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.

  5. Specify the destination address of the GRE tunnel or the domain name.

    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.

  6. Enable the IPv6 function on the tunnel interface.

    ipv6 enable

  7. Set an IPv6 address for the tunnel interface.

    ipv6 address { ipv6-address prefix-length | ipv6-address/prefix-length }

  8. (Optional) Configure the keyword of the GRE packet header.

    gre key key-number

    If you set key-number for both ends of the tunnel, ensure that the same value is specified.

Example

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
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >