Example for Configuring a 6RD Tunnel
This section provides an example for configuring a 6RD tunnel to allow the clients or devices in different 6RD domains to communicate.
Networking Requirements
As shown in Figure 6-4, both Device A and Device B support the IPv4/IPv6 dual stack, and they are connected to an IPv6 network and an IPv4 network. Both Device A and Device B are 6RD CEs. The IPv6 networks are 6RD networks. A 6RD tunnel needs to be established between Device A and Device B so that the hosts on the two IPv6 networks can communicate.
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 so that the devices can 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 domains based on the 6RD delegated prefix.
Configure the IPv6 addresses on PC1 and PC2, with the IPv6 prefix set to a 64-bit address prefix that contains the 6RD prefix and subnet ID.
On Device A, configure a static route destined for the 6RD domain in 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 addresses of 6RD tunnel interfaces
6RD prefix of the 6RD tunnel
IPv4 prefix length of the 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] 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 IPv4 address or source interface name, 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.
In this example, the IPv4 prefix length of the 6RD tunnel is set to 8 bits. To generate a 56-bit 6RD delegated prefix, the device removes the left-most 8 bits from the tunnel source address (IPv4 address of GE 0/1/1) and adds the 6RD prefix 2001:db8::/32 before the remaining 24 bits (in hexadecimal notation) of the tunnel source address.
- Query the calculated 6RD delegated prefix.
# Query 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: --
# Query 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.
# 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 2001:db8:101:201::1 64
[*DeviceB-GigabitEthernet0/1/2] commit
[~DeviceB-GigabitEthernet0/1/2] quit
- Configure static routes destined for the 6RD domains connected to Device A and Device B.
# Configure a static route destined for the 6RD domain connected to Device B.
[~DeviceA] ipv6 route-static 2001:db8:: 32 Tunnel 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
The leftmost 56 bits of the IPv6 address of GE 0/1/2 must be the same as the 6RD delegated prefix.
- 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. This IPv6 address must be 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 2001:db8:101:201::2/64 for PC2 based on the 6RD delegated prefix. 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 configurations, run the display ipv6 interface Tunnel 1 command to check the IPv6 status of Tunnel1 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 2001:db8:101:201::1
PING 2001:db8:101:201::1 : 56 data bytes, press CTRL_C to break Reply from 2001:db8:101:201::1 bytes=56 Sequence=1 hop limit=64 time = 4 ms Reply from 2001:db8:101:201::1 bytes=56 Sequence=2 hop limit=64 time = 3 ms Reply from 2001:db8:101:201::1 bytes=56 Sequence=3 hop limit=64 time = 2 ms Reply from 2001:db8:101:201::1 bytes=56 Sequence=4 hop limit=64 time = 2 ms Reply from 2001:db8:101:201::1 bytes=56 Sequence=5 hop limit=64 time = 2 ms --- 2001:db8:101:201::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 2001:db8:101:201::2
Pinging 2001:db8:101:201::2 with 32 bytes of data: Reply from 2001:db8:101:201::2: time<1ms Reply from 2001:db8:101:201::2: time<1ms Reply from 2001:db8:101:201::2: time<1ms Reply from 2001:db8:101:201::2: time<1ms Ping statistics for 2001:db8:101:201::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 # ipv6 route-static 2001:db8:: 32 Tunnel1 # 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 2001:db8:101:201::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