6to4 relay configuration example
By default, Ethernet, VLAN, and aggregate interfaces are shut down. You must use the undo shutdown command to bring them up. This example assumes that all these interfaces are already up.
Network requirements
As shown in Figure 87, Switch A is a 6to4 switch, and 6to4 addresses are used on the connected IPv6 network. Switch B serves as a 6to4 relay switch and is connected to the IPv6 network (2001::/16). Configure a 6to4 tunnel between Switch A and Switch B to make Host A and Host B reachable to each other.
The configuration on a 6to4 relay switch is similar to that on a 6to4 switch. To enable communication between the 6to4 network and the IPv6 network, configure a route destined for the IPv6 network on the 6to4 switch. The IPv4 address of VLAN-interface 100 on the relay switch is 6.1.1.1/24 and its corresponding 6to4 prefix is 2002:0601:0101::/48. The next hop of the static route must be an address using this prefix.
Figure 87: Network diagram
Configuration procedure
Make sure Switch A and Switch B have the corresponding VLAN interfaces created and can reach each other through IPv4.
Configure Switch A:
# Specify an IPv4 address for VLAN-interface 100.
<SwitchA> system-view [SwitchA] interface vlan-interface 100 [SwitchA-Vlan-interface100] ip address 2.1.1.1 255.255.255.0 [SwitchA-Vlan-interface100] quit
# Specify a 6to4 address for VLAN-interface 101.
[SwitchA] interface vlan-interface 101 [SwitchA-Vlan-interface101] ipv6 address 2002:0201:0101:1::1/64 [SwitchA-Vlan-interface101] quit
# Create a 6to4 tunnel interface tunnel 0.
[SwitchA] interface tunnel 0 mode ipv6-ipv4 6to4
# Specify an IPv6 address for the tunnel interface.
[SwitchA-Tunnel0] ipv6 address 2002::1/64
# Specify the source interface as VLAN-interface 100 for the tunnel interface.
[SwitchA-Tunnel0] source vlan-interface 100 [SwitchA-Tunnel0] quit
# Configure a static route destined for the 6to4 relay switch.
[SwitchA] ipv6 route-static 2002:0601:0101:: 64 tunnel 0
# Configure a default route to reach the IPv6 network, which specifies the 6to4 address of the 6to4 relay switch as the next hop.
[SwitchA] ipv6 route-static :: 0 2002:0601:0101::1
Configure Switch B:
# Specify an IPv4 address for VLAN-interface 100.
<SwitchB> system-view [SwitchB] interface vlan-interface 100 [SwitchB-Vlan-interface100] ip address 6.1.1.1 255.255.255.0 [SwitchB-Vlan-interface100] quit
# Specify an IPv6 address for VLAN-interface 101.
[SwitchB] interface vlan-interface 101 [SwitchB-Vlan-interface101] ipv6 address 2001::1/16 [SwitchB-Vlan-interface101] quit
# Create a 6to4 tunnel interface tunnel 0.
[SwitchB] interface tunnel 0 mode ipv6-ipv4 6to4
# Specify an IPv6 address for the tunnel interface.
[SwitchB-Tunnel0] ipv6 address 2003::1/64
# Specify VLAN-interface 100 as the source interface of the tunnel interface.
[SwitchB-Tunnel0] source vlan-interface 100 [SwitchB-Tunnel0] quit
# Configure a static route destined for 2002::/16 through the tunnel interface.
[SwitchB] ipv6 route-static 2002:: 16 tunnel 0
Verifying the configuration
# Verify that Host A and Host B can ping each other.
D:\>ping6 -s 2002:201:101:1::2 2001::2 Pinging 2001::2 from 2002:201:101:1::2 with 32 bytes of data: Reply from 2001::2: bytes=32 time=13ms Reply from 2001::2: bytes=32 time=1ms Reply from 2001::2: bytes=32 time=1ms Reply from 2001::2: bytes=32 time<1ms Ping statistics for 2001::2: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 13ms, Average = 3ms