Example for Configuring a 6to4 Tunnel
This section provides an example for configuring a 6to4 tunnel.
Networking Requirements
As shown in Figure 6-2, two IPv6 networks are both 6to4 networks; both Device A and Device B connect to a 6to4 network and the IPv4 backbone network. To interconnect the two 6to4 networks, a 6to4 tunnel needs to be configured between Device A and Device B.
To allow interworking of 6to4 networks, a 6to4 address needs to be configured for the host, with the prefix of 2002:IPv4 address: and prefix length of 48 bits. As shown in Figure 6-2, the IPv4 address of the interface connecting Device A and the IPv4 network is 1.1.1.1. Then, the 6to4 address for the 6to4 network where Device A resides should have a prefix of 2002:0101:0101:: and a prefix length of 64 bits.
Precautions
When configuring a 6to4 tunnel, note the following points:
Create a tunnel interface and set parameters for the tunnel interface.
Configure only the source IPv4 address of the tunnel. The destination IPv4 address of the tunnel is contained in the original IPv6 packet. The source IPv4 address of a 6to4 tunnel must be unique.
Assign a 6to4 address to the interface that connects a border router to a 6to4 network and an IPv4 address to the interface that connects a border router to an IPv4 network.
Configure an IP address for the tunnel interface to support a routing protocol.
Configuration Roadmap
The configuration roadmap is as follows:
Configure the IPv4/IPv6 dual stack on the routers.
Configure a 6to4 tunnel between Device A and Device B.
Configure static routes on the routers.
Data Preparation
To complete the configuration, you need the following data:
IPv4 and IPv6 addresses of the interfaces
Source IP address of the tunnel interface
Procedure
- Configure Device A.
# Configure the IPv4/IPv6 dual stack.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*HUAWEI] commit
[~DeviceA] interface GigabitEthernet 0/1/0
[~DeviceA-GigabitEthernet0/1/0] ip address 1.1.1.1 8
[*DeviceA-GigabitEthernet0/1/0] undo shutdown
[*DeviceA-GigabitEthernet0/1/0] quit
[*DeviceA] interface gigabitethernet 0/2/0
[*DeviceA-GigabitEthernet0/2/0] ipv6 enable
[*DeviceA-GigabitEthernet0/2/0] ipv6 address 2002:0101:0101:1::1 64
[*DeviceA-GigabitEthernet0/2/0] undo shutdown
[*DeviceA-GigabitEthernet0/2/0] quit
# Configure a 6to4 tunnel.
[*DeviceA] interface Tunnel 10
[*DeviceA-Tunnel10] tunnel-protocol ipv6-ipv4 6to4
[*DeviceA-Tunnel10] ipv6 enable
[*DeviceA-Tunnel10] ipv6 address 2002:0101:0101::1 64
[*DeviceA-Tunnel10] source 1.1.1.1
[*DeviceA-Tunnel10] quit
# Configure a route destined for the other 6to4 network.
[*DeviceA] ipv6 route-static 2002:: 16 Tunnel 10
[*DeviceA] commit
- Configure Device B.
# Configure the IPv4/IPv6 dual stack.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceB
[*HUAWEI] commit
[~DeviceB] interface GigabitEthernet 0/1/0
[~DeviceB-GigabitEthernet0/1/0] ip address 2.2.2.2 8
[*DeviceB-GigabitEthernet0/1/0] undo shutdown
[*DeviceB-GigabitEthernet0/1/0] quit
[*DeviceB] interface gigabitethernet 0/2/0
[*DeviceB-GigabitEthernet0/2/0] ipv6 enable
[*DeviceB-GigabitEthernet0/2/0] ipv6 address 2002:0202:0202:1::1 64
[*DeviceB-GigabitEthernet0/2/0] undo shutdown
[*DeviceB-GigabitEthernet0/2/0] quit
# Configure a 6to4 tunnel.
[*DeviceB] interface Tunnel 10
[*DeviceB-Tunnel10] tunnel-protocol ipv6-ipv4 6to4
[*DeviceB-Tunnel10] ipv6 enable
[*DeviceB-Tunnel10] ipv6 address 2002:0202:0202::1 64
[*DeviceB-Tunnel10] source 2.2.2.2
[*DeviceB-Tunnel10] quit
# Configure a route destined for the other 6to4 network.
[*DeviceB] ipv6 route-static 2002:: 16 Tunnel 10
[*DeviceB] commit
Available routes are required between Device A and Device B. In this example, the two routers are directly connected. Therefore, no routing protocol is configured.
- Verify the configuration.
# Check the IPv6 status of Tunnel 10 on Device A. The command output shows that the tunnel is UP.
[~DeviceA] display ipv6 interface Tunnel 10
Tunnel10 current state : UP
IPv6 protocol current state : UP
link-local address is FE80::101:101
Global unicast address(es):
2002:101:101::1, subnet is 2002:101:101::/64
Joined group address(es):
FF02::1:FF01:101
FF02::1:FF00:1
FF02::2
FF02::1
MTU is 1500 bytes
ND DAD is enabled, number of DAD attempts: 1.
ND reachable time is 1200000 milliseconds.
ND retransmit interval is 1000 milliseconds.
Hosts use stateless autoconfig for addresses.
# Ping the 6to4 address of GE 0/2/0 on Device B from Device A. The command output shows the ping is successful.
[~DeviceA] ping ipv6 2002:0202:0202:1::1
PING 2002:202:202:1::1 : 56 data bytes, press CTRL_C to break
Reply from 2002:202:202:1::1
bytes=56 Sequence=1 hop limit=64 time=37 ms
Reply from 2002:202:202:1::1
bytes=56 Sequence=2 hop limit=64 time=2 ms
Reply from 2002:202:202:1::1
bytes=56 Sequence=3 hop limit=64 time=8 ms
Reply from 2002:202:202:1::1
bytes=56 Sequence=4 hop limit=64 time=1 ms
Reply from 2002:202:202:1::1
bytes=56 Sequence=5 hop limit=64 time=2 ms
---2002:202:202:1::1 ping statistics---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 4/9/25 ms
Configuration Files
Device A configuration file
#
sysname DeviceA
#
interface GigabitEthernet0/1/0
undo shutdown
ip address 1.1.1.1 255.0.0.0
#
interface GigabitEthernet 0/2/0
undo shutdown
ipv6 enable
ipv6 address 2002:101:101:1::1/64
#
interface Tunnel 10
ipv6 enable
ipv6 address 2002:101:101::1/64
tunnel-protocol ipv6-ipv4 6to4
source 1.1.1.1
#
ipv6 route-static 2002:: 16 Tunnel 10
#
return
Device B configuration file
#
sysname DeviceB
#
interface GigabitEthernet0/1/0
undo shutdown
ip address 2.2.2.2 255.0.0.0
#
interface GigabitEthernet0/2/0
undo shutdown
ipv6 enable
ipv6 address 2002:202:202:1::1/64
#
interface Tunnel 10
ipv6 enable
ipv6 address 2002:202:202::1/64
tunnel-protocol ipv6-ipv4 6to4
source 2.2.2.2
#
ipv6 route-static 2002:: 16 Tunnel 10
#
return