To configure an IPv6 over IPv4 GRE tunnel, configure source and destination IPv4 addresses for the tunnel on the devices at both ends of the tunnel. GRE enhances tunnel security.
As shown in Figure 1, FW_A and FW_B support the IPv6/IPv4 dual stack and connect to the IPv6 networks and IPv4 network. To enhance security, an IPv6 over IPv4 GRE tunnel needs to be established between FW_A and FW_B, so that hosts on the two IPv6 networks can communicate. Figure 1 Networking diagram of configuring the IPv6 over IPv4 GRE tunnel
The configuration roadmap is as follows:
You must configure an address and a gateway for each PC. The methods for configuring addresses and routes for PCs vary according to the operating systems of the PCs.
After you complete the preceding configurations, run the display interface tunnel command in any view to check the status and configuration of Tunnel1. The command output on FW_A is as follows:
[FW_A]display interface Tunnel 1 Tunnel1 current state : UP Line protocol current state : DOWN Description:Huawei, Tunnel1 Interface Route Port,The Maximum Transmit Unit is 1500 Internet protocol processing : disabled Encapsulation is TUNNEL, loopback not set Tunnel source 192.168.50.2 (GigabitEthernet0/0/2), destination 1.1.2.1 Tunnel protocol/transport GRE/IP, key 1 keepalive disabled Checksumming of packets enabled 5 minutes input rate 0 bits/sec, 0 packets/sec 5 minutes output rate 0 bits/sec, 0 packets/sec 0 seconds input rate 0 bits/sec, 0 packets/sec 0 seconds output rate 0 bits/sec, 0 packets/sec 0 packets input, 0 bytes 0 input error 0 packets output, 0 bytes 0 output error Input: Unicast: 0 packets, Multicast: 0 packets Output: Unicast: 0 packets, Multicast: 0 packets
# Configure FW_B to ping the IPv6 address of Tunnel1 on FW_A. FW_B can receive reply packets from FW_A.
[FW_B] ping ipv6 3001::1
PING 3001::1 : 56 data bytes, press CTRL_C to break
Reply from 3001::1
bytes=56 Sequence=1 hop limit=255 time = 28 ms
Reply from 3001::1
bytes=56 Sequence=2 hop limit=255 time = 27 ms
Reply from 3001::1
bytes=56 Sequence=3 hop limit=255 time = 26 ms
Reply from 3001::1
bytes=56 Sequence=4 hop limit=255 time = 27 ms
Reply from 3001::1
bytes=56 Sequence=5 hop limit=255 time = 27 ms
Reply from 3001::1
--- 3001::1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 26/26/28 ms
# PC1 can ping through PC2.
C:\> ping6 3003::2
from 3002::2 with 32 bytes of data:
Reply from 3003::2: time<1ms
Reply from 3003::2: time<1ms
Reply from 3003::2: time<1ms
Reply from 3003::2: time<1ms
Ping statistics for 3003::2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
Configuration script of FW_A:
# sysname FW_A # ipv6 # interface GigabitEthernet0/0/2 ip address 1.1.1.1 255.255.255.0 # interface GigabitEthernet0/0/1 ipv6 enable ipv6 address 3002::1 64 # interface Tunnel 1 tunnel-protocol gre ipv6 enable source GigabitEthernet0/0/2 destination 1.1.2.1 gre checksum gre key 1 ipv6 address 3001::1 64 # firewall zone trust add interface GigabitEthernet0/0/1 # firewall zone untrust add interface GigabitEthernet0/0/2 add interface tunnel1 # ipv6 route-static 3003:: 64 Tunnel 1 # security-policy rule name policy1 source-zone trust source-zone untrust destination-zone trust destination-zone untrust action permit rule name policy2 source-zone local source-zone untrust destination-zone local destination-zone untrust action permit # return
Configuration script of FW_B:
# sysname FW_B # ipv6 # interface GigabitEthernet0/0/2 ip address 1.1.2.1 255.255.255.0 # interface GigabitEthernet0/0/1 ipv6 enable ipv6 address 3003::1 64 # interface Tunnel 1 tunnel-protocol gre ipv6 enable source GigabitEthernet0/0/2 destination 1.1.1.1 gre checksum gre key 1 ipv6 address 3001::2 64 # firewall zone trust add interface GigabitEthernet0/0/1 # firewall zone untrust add interface GigabitEthernet0/0/2 add interface tunnel1 # ipv6 route-static 3002:: 64 Tunnel 1 # security-policy rule name policy1 source-zone trust source-zone untrust destination-zone trust destination-zone untrust action permit rule name policy2 source-zone local source-zone untrust destination-zone local destination-zone untrust action permit # return