Configuration example
Network requirements
As shown in Figure 124, configure an IPv6 over IPv4 tunnel between Router A and Router B so the two IPv6 networks can reach each other over the IPv4 network. Because the tunnel destination IPv4 address cannot be automatically obtained from the destination IPv6 addresses, configure an IPv6 over IPv4 manual tunnel.
Figure 124: Network diagram
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 192.168.100.1 255.255.255.0 [RouterA-GigabitEthernet1/0/2] quit
# Specify an IPv6 address for GigabitEthernet 1/0/1.
[RouterA] interface gigabitethernet 1/0/1 [RouterA-GigabitEthernet1/0/1] ipv6 address 3002::1 64 [RouterA-GigabitEthernet1/0/1] quit
# Create the IPv6 over IPv4 manual tunnel interface Tunnel 0.
[RouterA] interface tunnel 0 mode ipv6-ipv4
# Specify an IPv6 address for the tunnel interface.
[RouterA-Tunnel0] ipv6 address 3001::1/64
# Specify GigabitEthernet 1/0/2 as the source interface of the tunnel interface.
[RouterA-Tunnel0] source gigabitethernet 1/0/2
# Specify the destination address for the tunnel interface as the IP address of GigabitEthernet 1/0/2 on Router B.
[RouterA-Tunnel0] destination 192.168.50.1 [RouterA-Tunnel0] quit
# Configure a static route destined for IPv6 network 2 through Tunnel 0.
[RouterA] ipv6 route-static 3003:: 64 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 192.168.50.1 255.255.255.0 [RouterB-GigabitEthernet1/0/2] quit
# Specify an IPv6 address for GigabitEthernet 1/0/1.
[RouterB] interface gigabitethernet 1/0/1 [RouterB-GigabitEthernet1/0/1] ipv6 address 3003::1 64 [RouterB-GigabitEthernet1/0/1] quit
# Create the IPv6 over IPv4 manual tunnel interface Tunnel 0.
[RouterB] interface tunnel 0 mode ipv6-ipv4
# Specify an IPv6 address for the tunnel interface.
[RouterB-Tunnel0] ipv6 address 3001::2/64
# Specify GigabitEthernet 1/0/2 as the source interface of the tunnel interface.
[RouterB-Tunnel0] source gigabitethernet 1/0/2
# Specify the destination address for the tunnel interface as the IP address of GigabitEthernet 1/0/2 on Router A.
[RouterB-Tunnel0] destination 192.168.50.1 [RouterB-Tunnel0] quit
# Configure a static route destined for IPv6 network 1 through Tunnel 0.
[RouterB] ipv6 route-static 3002:: 64 tunnel 0
Verifying the configuration
# Use the display ipv6 interface command to display tunnel interface status on Router A and Router B. Verify that the interface tunnel 0 is up. (Details not shown.)
# Verify that Router B and Router A can ping the IPv6 address of GigabitEthernet 1/0/1 of each other. This example uses Router A.
[RouterA] ping ipv6 3003::1 Ping6(56 data bytes) 3001::1 --> 3003::1, press CTRL C to break 56 bytes from 3003::1, icmp_seq=0 hlim=64 time=45.000 ms 56 bytes from 3003::1, icmp_seq=1 hlim=64 time=10.000 ms 56 bytes from 3003::1, icmp_seq=2 hlim=64 time=4.000 ms 56 bytes from 3003::1, icmp_seq=3 hlim=64 time=10.000 ms 56 bytes from 3003::1, icmp_seq=4 hlim=64 time=11.000 ms --- Ping6 statistics for 3003::1 --- 5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss round-trip min/avg/max/std-dev = 4.000/16.000/45.000/14.711 ms