This section provides an example for configuring the 6to4 tunnel for the hosts on 6to4 networks and IPv6 networks to communicate. Configuring the 6to4 relay router is the same as configuring the 6to4 router. However, to ensure the communication between the hosts on the 6to4 network and IPv6 network, you need to configure static routes to the IPv6 network on the 6to4 router.
As shown in Figure 1, both FW_A and FW_B support the IPv6/IPv4 dual stack and connect to the IPv4 and IPv6 networks. FW_A is a 6to4 router, and its connected IPv6 network is a 6to4 network. FW_B is a 6to4 relay router, and its connected IPv6 network is a common one. A 6to4 tunnel is required between FW_A and FW_B to enable hosts on the two IPv6 networks to communicate.
The configuration roadmap is as follows:
To establish a 6to4 tunnel, set a source address and an IPv6 address for the 6to4 tunnel on the 6to4 router.
Because FW_A and FW_B are border devices of the 6to4 networks, the IPv6 address prefix of each interface connected to the IPv6 networks is 6to4 prefix. The IPv6 address prefix of PC1 is a 6to4 prefix. PC2 is on a native IPv6 network.
Based on the 6to4 prefix, set the address to 2002:0201:0101:1::2/64 for PC1. This address is on the same network segment as that of GigabitEthernet0/0/1 on FW_A. (The method for setting IPv6 addresses is determined by the operating system of PC1.)
Based on the 6to4 prefix, set the address to 2001::2/64 for PC2. This address is on the same network segment as that of GigabitEthernet0/0/1 on FW_B. (The method for setting IPv6 addresses is determined by the operating system of PC1.)
After you complete the preceding configurations, run the display interface tunnel command in any view to check the status and configuration of Tunnel0. The command output on FW_A is as follows:
[FW_A] display interface Tunnel 0 Tunnel0 current state : UP Line protocol current state : up Description: Tunnel0 Interface Route Port,The Maximum Transmit Unit is 1500 Internet protocol processing : disabled Encapsulation is TUNNEL, loopback not set Tunnel source 2.1.1.1 (GigabitEthernet0/0/0), destination auto Tunnel protocol/transport IPv6 over IPv4(6to4)
# Configure FW_A to ping the 6to4 address of GigabitEthernet0/0/1 on FW_B.
[FW_A] ping ipv6 2001::1
PING 2001::1 : 56 data bytes, press CTRL_C to break
Reply from 2001::1
bytes=56 Sequence=1 hop limit=255 time = 8 ms
Reply from 2001::1
bytes=56 Sequence=2 hop limit=255 time = 25 ms
Reply from 2001::1
bytes=56 Sequence=3 hop limit=255 time = 4 ms
Reply from 2001::1
bytes=56 Sequence=4 hop limit=255 time = 5 ms
Reply from 2001::1
bytes=56 Sequence=5 hop limit=255 time = 5 ms
--- 2001::1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 4/9/25 ms
PC1 can ping PC2.
Configuration script of FW_A
# sysname FW_A # ipv6 # interface GigabitEthernet0/0/2 ip address 2.1.1.1 255.255.255.0 # interface GigabitEthernet0/0/1 ipv6 enable ipv6 address 2002:0201:0101:1::1/64 # interface tunnel 0 ipv6 enable ipv6 address 2002:0201:0100::1/64 tunnel-protocol ipv6-ipv4 6to4 source GigabitEthernet0/0/2 # firewall zone trust add interface GigabitEthernet0/0/1 # firewall zone untrust add interface GigabitEthernet0/0/2 add interface tunnel0 # ipv6 route-static 2002:: 16 Tunnel 0 ipv6 route-static 2001:: 64 2002:0201:0201::1 ip route-static 0.0.0.0 2.1.1.2 # 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 2.1.2.1 255.255.255.0 # interface GigabitEthernet0/0/1 ipv6 enable ipv6 address 2001::1/64 # interface tunnel 0 ipv6 enable ipv6 address 2002:0201:0201::1/64 tunnel-protocol ipv6-ipv4 6to4 source GigabitEthernet0/0/2 # firewall zone trust add interface GigabitEthernet0/0/1 # firewall zone untrust add interface GigabitEthernet0/0/2 add interface tunnel0 # ipv6 route-static 2002:: 16 Tunnel 0 ip route-static 0.0.0.0 2.1.2.2 # 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