Example: Configuring an IPv6 over IPv4 tunnel
Network configuration
As shown in Figure 90, configure an IPv6 over IPv4 tunnel between Switch A and Switch B so the two IPv6 networks can reach each other over the IPv4 network.
Figure 90: Network diagram
Procedure
IMPORTANT: By default, interfaces on the devices are disabled (in ADM or Administratively Down state). To have an interface operate, you must use the undo shutdown command to enable that interface. | ||
Make sure Switch A and Switch B have the corresponding VLAN interfaces created and can reach each other through IPv4.
Configure Switch A:
# Add Ten-GigabitEthernet 1/0/2 (the physical interface of the tunnel) to VLAN 100.
<SwitchA> system-view [SwitchA] vlan 100 [SwitchA-vlan100] port ten-gigabitethernet 1/0/2 [SwitchA-vlan100] quit
# Specify an IPv4 address for VLAN-interface 100.
[SwitchA] interface vlan-interface 100 [SwitchA-Vlan-interface100] ip address 192.168.100.1 255.255.255.0 [SwitchA-Vlan-interface100] quit
# Add Ten-GigabitEthernet 1/0/1 to VLAN 101.
[SwitchA] vlan 101 [SwitchA-vlan101] port ten-gigabitethernet 1/0/1 [SwitchA-vlan101] quit
# Specify an IPv6 address for VLAN-interface 101.
[SwitchA] interface vlan-interface 101 [SwitchA-Vlan-interface101] ipv6 address 3002::1 64 [SwitchA-Vlan-interface101] quit
# Create service loopback group 1, and specify its service type as tunnel.
[SwitchA] service-loopback group 1 type tunnel
# Add Ten-GigabitEthernet 1/0/3 to service loopback group 1.
[SwitchA] interface ten-gigabitethernet 1/0/3 [SwitchA-Ten-GigabitEthernet1/0/3] port service-loopback group 1 [SwitchA-Ten-GigabitEthernet1/0/3] quit
# Create IPv6 over IPv4 tunnel interface Tunnel 0.
[SwitchA] interface tunnel 0 mode ipv6-ipv4
# Specify an IPv6 address for the tunnel interface.
[SwitchA-Tunnel0] ipv6 address 3001::1/64
# Specify VLAN-interface 100 as the source interface of the tunnel interface.
[SwitchA-Tunnel0] source vlan-interface 100
# Specify the destination address for the tunnel interface as the IP address of the VLAN-interface 100 on Switch B.
[SwitchA-Tunnel0] destination 192.168.50.1 [SwitchA-Tunnel0] quit
# Configure a static route destined for IPv6 network 2 through tunnel 0.
[SwitchA] ipv6 route-static 3003:: 64 tunnel 0
Configure Switch B:
# Add Ten-GigabitEthernet 1/0/2 (the physical interface of the tunnel) to VLAN 100.
<SwitchB> system-view [SwitchB] vlan 100 [SwitchB-vlan100] port ten-gigabitethernet 1/0/2 [SwitchB-vlan100] quit
# Specify an IPv4 address for VLAN-interface 100.
[SwitchB] interface vlan-interface 100 [SwitchB-Vlan-interface100] ip address 192.168.50.1 255.255.255.0 [SwitchB-Vlan-interface100] quit
# Add Ten-GigabitEthernet 1/0/1 to VLAN 101.
[SwitchB] vlan 101 [SwitchB-vlan101] port ten-gigabitethernet 1/0/1 [SwitchB-vlan101] quit
# Specify an IPv6 address for VLAN-interface 101.
[SwitchB] interface vlan-interface 101 [SwitchB-Vlan-interface101] ipv6 address 3003::1 64 [SwitchB-Vlan-interface101] quit
# Create service loopback group 1, and specify its service type as tunnel.
[SwitchB] service-loopback group 1 type tunnel
# Add Ten-GigabitEthernet 1/0/3 to service loopback group 1.
[SwitchB] interface ten-gigabitethernet 1/0/3 [SwitchB-Ten-GigabitEthernet1/0/3] port service-loopback group 1 [SwitchB-Ten-GigabitEthernet1/0/3] quit
# Create IPv6 over IPv4 tunnel interface Tunnel 0.
[SwitchB] interface tunnel 0 mode ipv6-ipv4
# Specify an IPv6 address for the tunnel interface.
[SwitchB-Tunnel0] ipv6 address 3001::2/64
# Specify VLAN-interface 100 as the source interface of the tunnel interface.
[SwitchB-Tunnel0] source vlan-interface 100
# Specify the destination address for the tunnel interface as the IP address of VLAN-interface 100 of Switch A.
[SwitchB-Tunnel0] destination 192.168.100.1 [SwitchB-Tunnel0] quit
# Configure a static route destined for IPv6 network 1 through tunnel 0.
[SwitchB] ipv6 route-static 3002:: 64 tunnel 0
Verifying the configuration
# Use the display ipv6 interface command to display tunnel interface status on Switch A and Switch B. Verify that the interface tunnel 0 is up. (Details not shown.)
# Verify that Switch B and Switch A can ping the IPv6 address of VLAN-interface 101 of each other. This example uses Switch A.
[SwitchA] 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