Example for Configuring a 6RD Relay
This section provides an example for configuring a 6RD relay to allow the hosts or devices on an isolated IPv6 network and in a 6RD domain to communicate with each other.
Networking Requirements
As shown in Figure 6-5, both Device A and Device B support the IPv4/IPv6 dual stack and are connected to an IPv6 network and an IPv4 network. Device A functions as a 6RD CE and is connected to an IPv6 6RD network. Device B functions as a 6RD BR and is connected to a common IPv6 network outside the 6RD domain. A 6RD tunnel needs to be established between Device A and Device B so that the hosts on the two IPv6 networks can communicate with one another.
Configuration Roadmap
The configuration roadmap is as follows:
On Device A and Device B, configure IPv4 addresses for the physical interfaces connected to the IPv4 network and enable IPv6 packet forwarding.
On Device A and Device B, configure the source IPv4 address, 6RD prefix, IPv6 prefix length, and IPv4 prefix length for a 6RD tunnel. Then calculate the 6RD delegated prefix based on a combination of these parameters.
On Device A and Device B, configure IPv6 addresses for the physical interfaces connected to the 6RD domain and IPv6 network based on the 6RD delegated prefix.
Configure the IPv6 addresses on PC1 and PC2 and set the IPv6 prefix of PC1 to a 64-bit address prefix that contains the 6RD prefix and subnet ID and the IPv6 prefix of PC2 to a common IPv6 address prefix.
On Device A, configure a static route destined for the IPv6 network on which Device B resides. On Device B, configure a static route destined for the 6RD domain in which Device A resides.
Data Preparation
To complete the configuration, you need the following data:
IPv4 addresses of interfaces
Source IPv4 address of a 6RD tunnel interface
6RD prefix of a 6RD tunnel
IPv4 prefix length of a 6RD tunnel
Procedure
- Configure IPv4 addresses for interfaces that connect devices to the IPv4 network.
# Configure Device A.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*HUAWEI] commit
[~DeviceA] interface gigabitethernet 0/1/1
[*DeviceA-GigabitEthernet0/1/1] ip address 10.1.1.1 24
[*DeviceA-GigabitEthernet0/1/1] commit
[~DeviceA-GigabitEthernet0/1/1] quit
# Configure Device B.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceB
[*HUAWEI] commit
[~DeviceB] interface gigabitethernet 0/1/1
[*DeviceB-GigabitEthernet0/1/1] ip address 10.1.1.2 24
[*DeviceB-GigabitEthernet0/1/1] commit
[~DeviceB-GigabitEthernet0/1/1] quit
- Configure a 6RD tunnel.
# Configure Device A.
[~DeviceA] interface Tunnel 1
[*DeviceA-Tunnel1] tunnel-protocol ipv6-ipv4 6rd
[*DeviceA-Tunnel1] ipv6 enable
[*DeviceA-Tunnel1] source GigabitEthernet 0/1/1
[*DeviceA-Tunnel1] ipv6-prefix 2001:db8::/32
[*DeviceA-Tunnel1] ipv4-prefix length 8
[*DeviceA-Tunnel1] border-relay address 10.1.1.2
[*DeviceA-Tunnel1] commit
# Configure Device B.
[~DeviceB] interface Tunnel 1
[*DeviceB-Tunnel1] tunnel-protocol ipv6-ipv4 6rd
[*DeviceB-Tunnel1] ipv6 enable
[*DeviceB-Tunnel1] source GigabitEthernet 0/1/1
[*DeviceB-Tunnel1] ipv6-prefix 2001:db8::/32
[*DeviceB-Tunnel1] ipv4-prefix length 8
[*DeviceB-Tunnel1] commit
The 6RD delegated prefix can be automatically calculated based on the configured source tunnel address or source interface, 6RD prefix, IPv6 prefix length, and IPv4 prefix length. You can run the display this interface command to view the 6RD delegated prefix and then configure an IPv6 address for the tunnel interface.
- Query the calculated 6RD delegated prefix.
# Display the calculated 6RD delegated prefix on Device A.
[~DeviceA-Tunnel1] display this interface
Tunnel1 current state : UP (ifindex: 9) Line protocol current state : DOWN Description: Route Port,The Maximum Transmit Unit is 1500 Internet protocol processing : disabled Encapsulation is TUNNEL, loopback not set Tunnel source 10.1.1.1, destination unknown Tunnel protocol/transport IPv6 over IPv4 (6rd) ipv6 prefix 2001:DB8::/32 ipv4 prefix length 8 6RD Operational, Delegated Prefix is 2001:DB8:101:100::/56 Current system time: 2017-09-02 10:14:49 300 seconds input rate 0 bits/sec, 0 packets/sec 300 seconds output rate 0 bits/sec, 0 packets/sec 0 seconds input rate 0 bits/sec, 0 packets/sec 0 seconds output rate 0 bits/sec, 0 packets/sec 0 packets input, 0 bytes 0 input error 0 packets output, 0 bytes 0 output error Input: Unicast: 0 packets, Multicast: 0 packets Output: Unicast: 0 packets, Multicast: 0 packets Last 300 seconds input utility rate: -- Last 300 seconds output utility rate: --
# Display the calculated 6RD delegated prefix on Device B.
[DeviceB-Tunnel1] display this interface
Tunnel1 current state : UP (ifindex: 10) Line protocol current state : DOWN Description: Route Port,The Maximum Transmit Unit is 1500 Internet protocol processing : disabled Encapsulation is TUNNEL, loopback not set Tunnel source 10.1.1.2, destination unknown Tunnel protocol/transport IPv6 over IPv4 (6rd) ipv6 prefix 2001:DB8::/32 ipv4 prefix length 8 6RD Operational, Delegated Prefix is 2001:db8:101:200::/56 Current system time: 2017-09-02 10:22:13 300 seconds input rate 0 bits/sec, 0 packets/sec 300 seconds output rate 0 bits/sec, 0 packets/sec 0 seconds input rate 0 bits/sec, 0 packets/sec 0 seconds output rate 0 bits/sec, 0 packets/sec 0 packets input, 0 bytes 0 input error 0 packets output, 0 bytes 0 output error Input: Unicast: 0 packets, Multicast: 0 packets Output: Unicast: 0 packets, Multicast: 0 packets Last 300 seconds input utility rate: -- Last 300 seconds output utility rate: --
- Configure IPv6 addresses for the tunnel interfaces based on the 6RD delegated prefix.
# Configure Device A.
[~DeviceA-Tunnel1] ipv6 address 2001:db8:101:100::1 56
[*DeviceA-Tunnel1] commit
[~DeviceA-Tunnel1] quit
# Configure Device B.
[~DeviceB-Tunnel1] ipv6 address 2001:db8:101:200::1 56
[*DeviceB-Tunnel1] commit
[~DeviceB-Tunnel1] quit
- Configure an IPv6 address for GE 0/1/2 on each Device.
# Configure Device A.
[~DeviceA] interface gigabitethernet 0/1/2
[*DeviceA-GigabitEthernet0/1/2] ipv6 enable
[*DeviceA-GigabitEthernet0/1/2] ipv6 address 2001:db8:101:101::1 64
[*DeviceA-GigabitEthernet0/1/2] commit
[~DeviceA-GigabitEthernet0/1/2] quit
# Configure Device B.
[~DeviceB] interface gigabitethernet 0/1/2
[*DeviceB-GigabitEthernet0/1/2] ipv6 enable
[*DeviceB-GigabitEthernet0/1/2] ipv6 address 2002:db8::1 64
[*DeviceB-GigabitEthernet0/1/2] commit
[~DeviceB-GigabitEthernet0/1/2] quit
- Configure static routes.
# Configure a static route destined for the IPv6 network connected to Device B.
[~DeviceA] ipv6 route-static 2001:db8:: 32 Tunnel 1
[~DeviceA] ipv6 route-static 2002:db8:: 32 Tunnel 1 2001:DB8:101:200::1
[*DeviceA] commit
# Configure a static route destined for the 6RD domain connected to Device A.
[~DeviceB] ipv6 route-static 2001:db8:: 32 Tunnel 1
[*DeviceB] commit
- Configure IPv6 addresses for PC1 and PC2.
# Configure PC1.
Configure the IPv6 address 2001:db8:101:101::2/64 for PC1 based on the 6RD delegated prefix. The PC1's IPv6 address must be on the same network segment as GE 0/1/2 of Device A. This IPv6 address is on the same network segment as that of GE 0/1/2 on Device A. The method of configuring an IPv6 address is determined by the operating system of PC1, and therefore is not described.
# Configure PC2.
Configure the IPv6 address 2002:db8::2/64 for PC2 based on the 6RD delegated prefix. The PC2's IPv6 address must be on the same network segment as GE 0/1/2 of Device B. This IPv6 address is on the same network segment as that of GE 0/1/2 on Device B. The method of configuring an IPv6 address is determined by the operating system of PC2, and therefore is not described.
- Verify the configuration.
# After completing the configuration, check the IPv6 status of Tunnel 1 on Device A or Device B. The following command output shows that the IPv6 status of Tunnel 1 is UP.
[DeviceA] display ipv6 interface Tunnel 1
Tunnel1 current state : UP IPv6 protocol current state : UP IPv6 is enabled, link-local address is FE80::3ABA:9A00:9DC:D303 Global unicast address(es): 2001:DB8:101:100::1, subnet is 2001:DB8:101:100::/56 Joined group address(es): FF02::1:FF00:1 FF02::1:FFDC:D303 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
# On Device A, ping the IPv6 address of GE 0/1/2 on Device B. The following command output shows that the ping is successful.
[DeviceA] ping ipv6 2002:db8::1
PING 2002:db8::1 : 56 data bytes, press CTRL_C to break Reply from 2002:db8::1 bytes=56 Sequence=1 hop limit=64 time = 4 ms Reply from 2002:db8::1 bytes=56 Sequence=2 hop limit=64 time = 3 ms Reply from 2002:db8::1 bytes=56 Sequence=3 hop limit=64 time = 2 ms Reply from 2002:db8::1 bytes=56 Sequence=4 hop limit=64 time = 2 ms Reply from 2002:db8::1 bytes=56 Sequence=5 hop limit=64 time = 2 ms --- 2002:db8::1 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 2/2/4 ms
# On PC1, ping the IPv6 address of PC2. The following command output shows that the ping is successful.
C:\> ping 2002:db8::2
Pinging 2002:db8::2 with 32 bytes of data: Reply from 2002:db8::2: time<1ms Reply from 2002:db8::2: time<1ms Reply from 2002:db8::2: time<1ms Reply from 2002:db8::2: time<1ms Ping statistics for 2002:db8::2: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms
Configuration Files
Device A configuration file
# sysname DeviceA # interface GigabitEthernet0/1/1 undo shutdown ip address 10.1.1.1 255.255.255.0 # interface GigabitEthernet0/1/2 undo shutdown ipv6 enable ipv6 address 2001:db8:101:101::1 64 # interface Tunnel 1 ipv6 enable ipv6 address 2001:db8:101:100::1 56 tunnel-protocol ipv6-ipv4 6rd source GigabitEthernet0/1/1 ipv6-prefix 2001:db8::/32 ipv4-prefix length 8 border-relay address 10.1.1.2 # ipv6 route-static 2001:db8:: 32 Tunnel1 ipv6 route-static 2002:DB8:: 32 Tunnel1 2001:DB8:101:200::1 # return
Device B configuration file
# sysname DeviceB # interface GigabitEthernet0/1/1 undo shutdown ip address 10.1.1.2 255.255.255.0 # interface GigabitEthernet0/1/2 undo shutdown ipv6 enable ipv6 address 2002:db8::1 64 # interface Tunnel 1 ipv6 enable ipv6 address 2001:db8:101:200::1 56 tunnel-protocol ipv6-ipv4 6rd source GigabitEthernet0/1/1 ipv6-prefix 2001:db8::/32 ipv4-prefix length 8 # ipv6 route-static 2001:db8:: 32 Tunnel1 # return