6to4 tunnel configuration example
Network requirements
As shown in Figure 126, configure a 6to4 tunnel between 6to4 routers Router A and Router B so the two hosts can reach each other over the IPv4 network.
Figure 126: Network diagram
Requirements analysis
To enable communication between 6to4 networks, configure 6to4 addresses for 6to4 routers and hosts in the 6to4 networks.
The IPv4 address of GigabitEthernet 1/0/2 on Router A is 2.1.1.1/24, and the corresponding 6to4 prefix is 2002:0201:0101::/48. Host A must use this prefix.
The IPv4 address of GigabitEthernet 1/0/2 on Router B is 5.1.1.1/24, and the corresponding 6to4 prefix is 2002:0501:0101::/48. Host B must use this prefix.
Configuration procedure
Make sure Router A and Router B can reach each other through IPv4.
Configure Router A:
# Specify an IPv4 address for GigabitEthernet 1/0/2.
<RouterA> system-view [RouterA] interface gigabitethernet 1/0/2 [RouterA-GigabitEthernet1/0/2] ip address 2.1.1.1 24 [RouterA-GigabitEthernet1/0/2] quit
# Specify a 6to4 address for GigabitEthernet 1/0/1.
[RouterA] interface gigabitethernet 1/0/1 [RouterA-GigabitEthernet1/0/1] ipv6 address 2002:0201:0101:1::1/64 [RouterA-GigabitEthernet1/0/1] quit
# Create the 6to4 tunnel interface Tunnel 0.
[RouterB] interface tunnel 0 mode ipv6-ipv4 6to4
# Specify an IPv6 address for the tunnel interface.
[RouterA-Tunnel0] ipv6 address 3001::1/64
# Specify the source interface as GigabitEthernet 1/0/2 for the tunnel interface.
[RouterA-Tunnel0] source gigabitethernet 1/0/2 [RouterA-Tunnel0] quit
# Configure a static route destined for 2002::/16 through the tunnel interface.
[RouterA] ipv6 route-static 2002:: 16 tunnel 0
Configure Router B:
# Specify an IPv4 address for GigabitEthernet 1/0/2.
<RouterB> system-view [RouterB] interface gigabitethernet 1/0/2 [RouterB-GigabitEthernet1/0/2] ip address 5.1.1.1 24 [RouterB-GigabitEthernet1/0/2] quit
# Specify a 6to4 address for GigabitEthernet 1/0/1.
[RouterB] interface gigabitethernet 1/0/1 [RouterB-GigabitEthernet1/0/1] ipv6 address 2002:0501:0101:1::1/64 [RouterB-GigabitEthernet1/0/1] quit
# Create the 6to4 tunnel interface Tunnel 0.
[RouterB] interface tunnel 0 mode ipv6-ipv4 6to4
# Specify an IPv6 address for the tunnel interface.
[RouterB-Tunnel0] ipv6 address 3002::1/64
# Specify the source interface as GigabitEthernet 1/0/2 for the tunnel interface.
[RouterB-Tunnel0] source gigabitethernet 1/0/2 [RouterB-Tunnel0] quit
# Configure a static route destined for 2002::/16 through the tunnel interface.
[RouterB] ipv6 route-static 2002:: 16 tunnel 0
Verifying the configuration
# Verify that Linux-running hosts Host A and Host B can ping each other.
D:\>ping6 -s 2002:201:101:1::2 2002:501:101:1::2 Pinging 2002:501:101:1::2 from 2002:201:101:1::2 with 32 bytes of data: Reply from 2002:501:101:1::2: bytes=32 time=13ms Reply from 2002:501:101:1::2: bytes=32 time=1ms Reply from 2002:501:101:1::2: bytes=32 time=1ms Reply from 2002:501:101:1::2: bytes=32 time<1ms Ping statistics for 2002:501:101:1::2: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 13ms, Average = 3ms