Basic IPv6 Configuration
The IPv6 protocol stack is a support for the routing protocols and application protocols on IPv6 networks.
- Overview of IPv6
- Limitations for Basics of IPv6
- Configuring IPv6 Addresses for Interfaces
- Configuring an IPv6 Address Selection Policy Table
- Disabling the IPv6 Address Conflict Detection Function and Configuring the Preemption Function
- Configuring ICMPv6 Message Control
- Configuring a Filtering Policy for an IPv6 Extension Header
- Configuring PMTUs
- Configuring TCP6
- Maintaining IPv6
- Configuration Examples for IPv6
Overview of IPv6
Internet Protocol version 6 (IPv6), also called IP Next Generation (IPng), is a standard network protocol of the second generation. It is designed by the Internet Engineering Task Force (IETF) as an upgraded version of IPv4 and makes up the defects of IPv4.
The most significant difference between IPv6 and IPv4 is that IP addresses are lengthened from 32 bits to 128 bits. Featuring a simplified header format, sufficient address space, hierarchical address structure, flexible extended header, and an enhanced neighbor discovery (ND) mechanism, IPv6 has a competitive future in the market.
Limitations for Basics of IPv6
Limitations for Basics of IPv6 on NE20E-S2E
Restrictions |
Guidelines |
Impact |
---|---|---|
IPv6 does not support per-packet load balancing. |
Configure per-flow load balancing. |
Per-packet load balancing does not take effect. |
If the VLANIF interface is not Down, during VLAN member interface switching on the Layer 3 forwarding outbound interface, the packet loss time depends on the ND update or aging time. This scenario is not recommended. |
None |
VLANIF member interface switching is affected. |
Limitations for Basics of IPv6 on NE20E-S2F
Restrictions |
Guidelines |
Impact |
---|---|---|
IPv6 does not support per-packet load balancing. |
Configure per-flow load balancing. |
Per-packet load balancing does not take effect. |
If the VLANIF interface is not Down, during VLAN member interface switching on the Layer 3 forwarding outbound interface, the packet loss time depends on the ND update or aging time. This scenario is not recommended. |
None |
VLANIF member interface switching is affected. |
Configuring IPv6 Addresses for Interfaces
Assigning IPv6 addresses to a network device enables the device to communicate with other devices on the network.
Usage Scenario
IPv6 addresses must be configured for router interfaces so that the routers can communicate with IPv6 devices.
Link-local addresses are used in neighbor discovery and in the communication between nodes on the local link during stateless address autoconfiguration. The packets with link-local addresses as source or destination addresses are only forwarded on the local link.
Link-local addresses can be automatically generated or manually configured.
After the IPv6 function is enabled on an interface, the system automatically generates a link-local address for the interface.
The link-local address that is manually configured must be valid (usually with the FE80::/10 prefix).
Link-local addresses are used for the communication between link-local nodes. It means that link-local addresses are usually used for the communication between protocols, and are not directly related to the communication between users. Therefore, automatic generation of link-local addresses is recommended.
Global unicast addresses, equivalent to public IPv4 addresses, are used for data forwarding on a public network and are necessary for the communication between users.
EUI-64 addresses function the same as global unicast addresses. The difference is that only the network bits need to be specified for an EUI-64 address, and the host bits are derived from the interface MAC address; for a global unicast address, all the 128 bits must be specified. You must note that the prefix length of the network bits of an EUI-64 address cannot be more than 64 bits.
Both or either of EUI-64 addresses and global unicast addresses can be configured on an interface for communications. The addresses that are configured on the same interface, however, must belong to different network segments.
IPv6 addresses are classified into unicast addresses, multicast addresses, and anycast addresses.
- Multicast address: assigned to a group of interfaces that belong to different nodes and is similar to an IPv4 multicast address. A packet destined for a multicast address is delivered to all the interfaces identified by that address.
- Anycast address: assigned to a group of interfaces that generally belong to different nodes. A packet destined for an anycast address is delivered to only one of the member interfaces, typically the nearest to the sender based on the distance vector in the interface group identified by the anycast address. Currently, anycast addresses are applicable to a few scenarios. In typical applications, anycast addresses are used by a large number of 6to4 relay routers in a 6to4 tunnel to enhance the network expandability.
Pre-configuration Tasks
Before configuring IPv6 addresses for interfaces, complete the following tasks:
Connect interfaces and configure physical parameters for the interfaces to ensure that the physical status of the interfaces is Up.
Configure link layer protocol parameters for the interfaces to ensure that the link layer protocol status of the interfaces is Up.
Enabling IPv6
You can perform IPv6-related configurations on an interface only when IPv6 is enabled in the interface view.
Configuring a Link-local Address for an Interface
Link-local addresses are used in neighbor discovery and in the communication between nodes on the local link during stateless address autoconfiguration. Link-local addresses are valid only on local links, meaning that packets with link-local addresses as source or destination addresses are not forwarded to other links.
Procedure
- Run system-view
The system view is displayed.
- Run interface interface-type interface-number
The interface view is displayed.
- Perform either of the following operations according to on-site requirements:
To automatically configure the link-local address of the interface, run the ipv6 address auto link-local command.
To manually configure the link-local address of the interface, run the ipv6 address ipv6-address link-local command.
You can configure multiple IPv6 addresses but only one link-local address for an interface.
- Run commit
The configuration is committed.
Configuring a Global Unicast Address for an Interface
Global unicast addresses function the same as public IPv4 addresses. They are used for links whose route prefixes can be aggregated, reducing the number of routing entries.
Procedure
- Run system-view
The system view is displayed.
- Run interface interface-type interface-number
The interface view is displayed.
- Run ipv6 address { ipv6-address prefix-length | ipv6-address/prefix-length } or ipv6 address { ipv6-address prefix-length | ipv6-address/prefix-length } eui-64
A global unicast address is configured for the interface.
An interface can be configured with a maximum of 16 global unicast addresses.
A global unicast address cannot be the same as its network prefix because an IPv6 address which is the same as its network prefix is a subnet-router anycast address reserved for a device. However, this rule does not apply to an IPv6 address with a 127-bit network prefix.
- Run commit
The configuration is committed.
Configuring an IPv6 Anycast Address for an Interface
An anycast address is used to identify a group of interfaces.
Context
Anycast addresses and unicast addresses are in the same address range. An anycast address is used to identify a group of interfaces on different nodes.
- Similar to a multicast address, an anycast address is listened to by multiple nodes. Therefore, it is only used as a destination address.
- The packets destined for an anycast address are transmitted to an interface that is in the interface group identified by the anycast address and is closest to the source node. (The distance between an interface and the source node is calculated based on the routing protocol). The packets destined for a multicast address are transmitted to a group of interfaces with the multicast address.
When the 6to4 tunnel is used for the communication between the 6to4 network and the native IPv6 network, the NE20E supports the configuration of an anycast address with the prefix of 2002:c058:6301/48 on the tunnel interface of the 6to4 relay route device.
Alternatively, you can configure a 6to4 address on the tunnel interface of the 6to4 relay route device. When multiple 6to4 relay route devices are configured on the network, the difference between the two methods is as follows:
- If an 6to4 address is used, you need to configure different addresses for tunnel interfaces of all devices.
- If an anycast address is used, you need to configure the same address for the tunnel interfaces of all devices. In this manner, the number of addresses is reduced. If a 6to4 relay route device fails, the 6to4 route device can send packets to another 6to4 relay route device based on the anycast address.
Before configuring an IPv6 anycast address, ensure that the system has been configured with a 6to4 tunnel whose source interface has been configured with an IPv4 anycast address on the network segment 192.168.99.0/24.
Procedure
- Run system-view
The system view is displayed.
- Run interface interface-type interface-number
The interface view is displayed.
- Run ipv6 address { ipv6-address prefix-length | ipv6-address/prefix-length } anycast
An IPv6 anycast address is configured for the interface.
An interface can be configured with a maximum of 16 anycast IPv6 addresses.
An anycast address is not necessarily a subnet-router anycast address and can be a global unicast address configured using the ipv6 address anycast command.
- Run commit
The configuration is committed.
Configuring an IPv6 Address Selection Policy Table
If multiple addresses are configured on an interface of the device, the IPv6 address selection policy table can be used to select source and destination addresses for packets.
Usage Scenario
IPv6 addresses can be classified into different types based on different applications.
- Link local addresses and global unicast addresses based on the effective range of the IPv6 addresses
- Temporary addresses and public addresses based on security levels
- Home addresses and care-of addresses based on the application in the mobile IPv6 field
- Physical interface addresses and logical interface addresses based on the interface attributes
The preceding IPv6 addresses can be configured on the same interface of the router. In this case, the device must select a source address or a destination addresses from multiple addresses on the interface. If the device supports the IPv4/IPv6 dual-stack, it also must select IPv4 addresses or IPv6 addresses for communication. For example, if a domain name maps both an IPv4 address and an IPv6 address, the system must select an address to respond to the DNS request of the client.
An IPv6 address selection policy table solves the preceding problems. It defines a group of address selection rules. The source and destination addresses of packets can be specified or planned based on these rules. This table, similar to a routing table, can be queried by using the longest matching rule. The address is selected based on the source and destination addresses.
- The label parameter can be used to determine the result of source address selection. The address whose label value is the same as the label value of the destination address is selected preferably as the source address.
- The destination address is selected based on both the label and the precedence parameters. If label values of the candidate addresses are the same, the address whose precedence value is largest is selected preferably as the destination address.
Procedure
- Run system-view
The system view is displayed.
- Run ipv6 address-policy [ vpn-instance vpn-instance-name ] ipv6-address prefix-length precedence label
- Run commit
The configuration is committed.
Verifying the Configuration of an IPv6 Address Selection Policy Table
After configuring an IPv6 address selection policy table, verify the configuration.
Run the display ipv6 address-policy [ vpn-instance vpn-instance-name ]{ all | ipv6-address prefix-length } command to check the IPv6 address selection policy entry information.
Disabling the IPv6 Address Conflict Detection Function and Configuring the Preemption Function
This section describes how to configure conflicting IPv6 addresses for different interfaces after the IPv6 address conflict detection function is disabled as well as to configure the preemption function so that conflicting IPv6 addresses take effect on interfaces with higher priorities.
Usage Scenario
In scenarios of upgrade and capacity expansion on the live network, existing interfaces need to be replaced. If a customer has limited IPv6 address resources and therefore is unwilling to assign new IPv6 addresses for replacement interfaces, disable the IPv6 address conflict detection function so that conflicting IPv6 addresses can be configured on different interfaces. Configure IPv6 addresses of the to-be-replaced interfaces for new interfaces. The IP addresses take effect on the new interfaces after the to-be-replaced interfaces are shut down or their IPv6 addresses are deleted.
If the IPv6 address or broadcast address of an interface is the same as that of another interface, IPv6 address conflict occurs. After the IPv6 address conflict detection function is disabled and the preemption function for conflicting IP addresses is enabled, conflicting IPv6 addresses take effect on interfaces with higher priorities.
Procedure
- Run system-view
The system view is displayed.
- Run ipv6 address conflict check disable
The IPv6 address conflict detection is disabled.
- Run ipv6 address conflict preempt enable
The preemption function for conflicting IPv6 addresses is enabled.
After the preemption function for conflicting IPv6 addresses is enabled, IPv6 addresses take effect on interfaces with higher priorities in IPv6 address conflict scenarios.
If the primary IPv6 address of an interface does not take effect due to IPv6 address conflict, its secondary IPv6 address also becomes invalid. If the primary IPv6 address of an interface takes effect, its secondary IP address takes effect only when no duplicate IPv6 address exists on the network.
- Run commit
The configuration is committed.
Configuring ICMPv6 Message Control
In ICMPv6 message control, the token bucket algorithm is adopted, and one token represents one ICMPv6 message. Tokens are placed in the virtual bucket at fixed intervals until the capacity of the token bucket reaches the upper threshold. If the number of ICMPv6 messages exceeds the upper threshold, extra messages are discarded.
Pre-configuration Tasks
Before configuring ICMPv6 message control, complete the following tasks:
Connect interfaces and configure physical parameters for the interfaces to ensure that the physical status of the interfaces is Up.
Configure link layer protocol parameters for the interfaces to ensure that the link layer protocol status of the interfaces is Up.
Configure IPv6 addresses for interfaces.
Procedure
- Run system-view
The system view is displayed.
- Run ipv6 icmp-error { bucket bucket-size | ratelimit interval } *
- Run undo ipv6 icmp { icmpv6-type icmpv6-code | icmpv6-name | all } send
- Run undo ipv6 icmp { icmpv6-type icmpv6-code | icmpv6-name | all } receive
- (Optional) Run undo ipv6 icmp too-big-rate-limit
- Run interface interface-type interface-number
The interface view is displayed.
- Run undo ipv6 icmp hop-limit-exceeded send
- Run undo ipv6 icmp host-unreachable send
An interface is disabled from sending ICMPv6 Host Unreachable messages.
- Run undo ipv6 icmp port-unreachable send
- (Optional) Run ipv6 icmp { hop-limit-exceeded | port-unreachable } source-address
- Run commit
The configuration is committed.
Verifying the Configuration of ICMPv6 Message Control
After configuring ICMPv6 message control, verify the configuration.
Run the display ipv6 interface [ interface-type interface-number | brief ] command to check IPv6 configurations on an interface.
Run the display icmpv6 statistics [ interface-type interface-number ] command to check statistics about ICMPv6 traffic on an interface.
Configuring a Filtering Policy for an IPv6 Extension Header
You can configure a filtering policy for an IPv6 extension header to filter packets.
Prerequisites
Before configuring a filtering policy for an IPv6 extension header in the interface view, enable the IPv6 function (for details, see Enabling IPv6).
Context
To prevent the system from being attacked by specific packets, run the ipv6 extension-header command to configure a filtering policy (deny or permit) for an extension header in the packets. The methods of configuring filtering policies for different types of extended headers are as follows:
- If the extension header is Hop-by-Hop or Destination Options, you can configure a filtering policy for all options or a specified one in the header.
- If the extension header is Routing, you can configure a filtering policy for all routing types or a specified one in the header.
- If the extension header is Fragment, Encapsulation Security Payload, or Authentication, you can configure a filtering policy directly for the header because it carries neither options nor routing types.
Procedure
- Run system-view
The system view is displayed.
- Configure a filtering policy for an IPv6 extension header in the system or interface view.
- To configure a filtering policy for an IPv6 extension header in the system view, perform the following steps as needed:
- Run the ipv6 extension-header { hop-by-hop | destination } option-code { all | optcodevalue } { deny | permit } command to configure a filtering policy for the IPv6 Hop-by-Hop Options or Destination Options header.
- Run the ipv6 extension-header routing routing-type { all | routing-number } { deny | permit } command to configure a filtering policy for the IPv6 Routing header.
- Run the ipv6 extension-header { fragment | esp | ah } { deny | permit } command to configure a filtering policy for the IPv6 Fragment, Encapsulating Security Payload, or Authentication header.
- To configure a filtering policy for an IPv6 extension header in the interface view, perform the following steps:
- Run the interface interface-type interface-number command to enter the interface view.
- Run the ipv6 enable command to enable the IPv6 function.
- Perform the following steps as needed:
- Run the ipv6 extension-header { hop-by-hop | destination } option-code { all | optcodevalue } { deny | permit } command to configure a filtering policy for the IPv6 Hop-by-Hop Options or Destination Options header.
- Run the ipv6 extension-header routing routing-type { all | routing-number } { deny | permit } command to configure a filtering policy for the IPv6 Routing header.
- Run the ipv6 extension-header { fragment | esp | ah } { deny | permit } command to configure a filtering policy for the IPv6 Fragment, Encapsulating Security Payload, or Authentication header.
- To configure a filtering policy for an IPv6 extension header in the system view, perform the following steps as needed:
- Run the commit command to commit the configuration.
A filtering policy configured for an IPv6 extension header in the interface view takes precedence over that in the system view.
Configuring PMTUs
After a PMTU is configured, devices on a network send packets based on the same MTU so that packets do not need to be fragmented in the transmission process and the burden of intermediate devices is reduced. Therefore, network resources are efficiently utilized to achieve the optimal traffic throughput.
Usage Scenario
Devices can determine the dynamic PMTU by default. The dynamic PMTU is the smallest MTU of all interface MTUs on the path along the source to the destination.
To protect a device against attacks initiated by sending jumbo packets, configure a static PMTU that defines the maximum length of a packet that can be sent from the source to the destination.
The static PMTU is usually less than or equal to an IPv6 MTU of an interface along the link. If a static PMTU value is greater than the IPv6 MTU value of an interface, the device fragments packets based on the IPv6 MTU.
Configuring a Static PMTU
You can manually configure a static PMTU according to the minimum MTU of the path along which packets are sent, resulting in higher transmission efficiency.
Setting the Aging Time of Dynamic PMTU Entries
The PMTU aging time changes the lifetime of dynamic PMTU entries in the buffer. Static PMTU entries do not age.
Procedure
- Run system-view
The system view is displayed.
- Run ipv6 pathmtu age age-time
The aging time of dynamic PMTU entries is set.
The PMTU aging time changes the lifetime of the dynamic PMTU entries in the buffer and does not function static PMTU entries, because static PMTU entries do not age.
When both static and dynamic PMTUs are configured, only static PMTUs take effect.
- Run commit
The configuration is committed.
Configuring TCP6
The network performance can be improved by setting TCP6 packet attributes.
Pre-configuration Tasks
Before configuring TCP6, complete the following tasks:
Connect interfaces and configure physical parameters for the interfaces to ensure that the physical status of the interfaces is Up.
Configure link layer protocol parameters for the interfaces to ensure that the link layer protocol status of the interfaces is Up.
Configuring TCP6 Timers
Set two TCP6 timers to control the TCP6 connection time.
Context
Two TCP6 timers are available:
SYN-Wait timer: When SYN packets are sent, the SYN-Wait timer starts. If response packets are not received before the SYN-Wait timer expires, the TCP6 connection is terminated. The SYN-Wait timeout period ranges from 2 to 600, in seconds, and the default value is 75 seconds.
FIN-Wait timer: When the TCP connection status changes from FIN_WAIT_1 to FIN_WAIT_2, the FIN-Wait timer starts. If FIN packets are not received before the FIN-Wait timer expires, the TCP6 connection is terminated. The FIN-Wait timeout period ranges from 76 to 3600, in seconds, and the default value is 675 seconds.
Perform the following steps on the router:
Procedure
- Run system-view
The system view is displayed.
- Run tcp ipv6 timer syn-timeout interval
The SYN-Wait timeout period is configured for TCP6 connections.
- Run tcp ipv6 timer fin-timeout interval
The FIN_WAIT_2 timeout period is configured for TCP6 connections.
- Run commit
The configuration is committed.
Specifying the Size of a TCP6 Sliding Window
The TCP6 sliding window size determines the size of the receiving buffer and transmitting buffer in the socket. This function improves network performance.
Setting the MSS Value for a TCP6 Connection
Verifying the TCP6 Configuration
After configuring TCP6, verify the configuration.
Procedure
- Run the display tcp ipv6 status [ local-ip local-ip ] [ local-port local-port ] [ remote-ip remote-ip ] [ remote-port remote-port ] [ cid cid ] [ socket-id socket-id ] command to check the TCP connection status.
- Run the display tcp ipv6 statistics command to check the TCP traffic statistics.
- Run the display ipv6 socket [ socket-type socket-type ] [ cid cid ] [ socket-id socket-id ] command to check socket configurations.
Maintaining IPv6
This section describes how to clear IPv6 statistics and monitor the IPv6 operating status.
Clearing IPv6 Statistics
This section describes how to clear IPv6 statistics.
Context
IPv6 statistics cannot be restored after they are cleared. Exercise caution when running reset commands.
Procedure
- Run the reset ipv6 statistics command in the user view to clear IPv6 statistics.
- Run the reset tcp ipv6 statistics command in the user view to clear TCP6 statistics.
- Run the reset udp ipv6 statistics command in the user view to clear UDP6 statistics.
- Run the reset ipv6 pathmtu [ vpn-instance vpn-instance-name ] dynamic command in the user view to clear the PMTU entries in the buffer.
- To clear statistics about packets that have been discarded because the packets' destination MAC addresses are different from an interface's MAC address or the packets' sizes exceed the interface's MTU, run the reset forward-statistics packet discard [ mac | mtu ] ipv6 { interface [ interface-type interface-number ] | slot slot-id } command.
Monitoring the IPv6 Operating Status
This section describes how to monitor the IPv6 operating status.
Context
You can run the following command in any view to check the IPv6 operating status in routine maintenance.
Procedure
- Run the display ipv6 interface [ interface interface-type interface-number | brief ] command to check IPv6 configurations on an interface.
- Run the display ipv6 statistics [ interface interface-type interface-number ] command to check IPv6 statistics.
- Run the display icmpv6 statistics [ interface interface-type interface-number ] command to check ICMPv6 statistics.
- Run the display tcp ipv6 statistics command to check TCP6 statistics.
- Run the display ipv6 address-policy [ vpn-instance vpn-instance-name ] { all | ipv6-address prefix-length } command to check address selection policy entries.
- Run the display ipv6 pathmtu [ vpn-instance vpn-instance-name ] { ipv6-address | all | dynamic | static } command to check all PMTU entries.
- Run the display forward-statistics packet discard [ mac | mtu ] [ ipv6 | ipv6 ] { interface interface-type interface-number | slot slot-id } command to view statistics about packets that have been discarded because the packets' destination MAC addresses are different from an interface's MAC address or the packets' sizes exceed the interface's MTU.
Configuration Examples for IPv6
This section provides IPv6 configuration examples.
Example for Configuring IPv6 Addresses for Interfaces
This example shows how to configure IPv6 addresses for interfaces.
Networking Requirements
As shown in Figure 12-1, DeviceA and DeviceB are connected through GE interfaces. To check the connectivity between the two interfaces, configure global unicast IPv6 addresses 2001:db8::1/32 and 2001:db8::2/32 for the GE interfaces.
Device Name |
Interface |
IP Address |
---|---|---|
DeviceA |
GE0/1/0 |
2001:db8::1/32 |
DeviceB |
GE0/1/0 |
2001:db8::2/32 |
Configuration Roadmap
The configuration roadmap is as follows:
Enable IPv6 forwarding on the two Devices.
Configure global unicast IPv6 addresses for interfaces.
Data Preparation
To complete the configuration, you need global unicast IPv6 addresses of the interfaces.
Procedure
- Configure global unicast IPv6 addresses for interfaces.
# Configure Device A.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*HUAWEI] commit
[~DeviceA] interface GigabitEthernet 0/1/0
[~DeviceA-GigabitEthernet0/1/0] ipv6 enable
[*DeviceA-GigabitEthernet0/1/0] ipv6 address 2001:db8::1 32
[*DeviceA-GigabitEthernet0/1/0] undo shutdown
[*DeviceA-GigabitEthernet0/1/0] commit
[~DeviceA-GigabitEthernet0/1/0] quit
# Configure Device B.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceB
[*HUAWEI] commit
[~DeviceB] interface GigabitEthernet 0/1/0
[~DeviceB-GigabitEthernet0/1/0] ipv6 enable
[*DeviceB-GigabitEthernet0/1/0] ipv6 address 2001:db8::2 32
[*DeviceB-GigabitEthernet0/1/0] undo shutdown
[*DeviceB-GigabitEthernet0/1/0] commit
[~DeviceB-GigabitEthernet0/1/0] quit
- Verify the configuration.
If you can view the configured unicast global addresses and that the interfaces and the IPv6 protocol are in the Up state, it indicates that the configuration is successful.
# Display the interface information of Device A.
[~DeviceA] display ipv6 interface GigabitEthernet 0/1/0
GigabitEthernet0/1/0 current state : UP
IPv6 protocol current state : UP
link-local address is FE80::C964:0:B8B6:1
Global unicast address(es):
2001:db8::1, subnet is 2001:db8::/32
Joined group address(es):
FF02::1:FF00:1
FF02::1:FFB6:1
FF02::2
FF02::1
MTU is 4470 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
# Display the interface information of Device B.
[~DeviceB] display ipv6 interface GigabitEthernet 0/1/0
GigabitEthernet0/1/0 current state : UP
IPv6 protocol current state : UP
link-local address is FE80::2D6F:0:7AF3:1
Global unicast address(es):
2001:db8::2, subnet is 2001:db8::/32
Joined group address(es):
FF02::1:FF00:2
FF02::1:FFF3:1
FF02::2
FF02::1
MTU is 4470 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
# Ping the link-local address of Device B from Device A. Note that you need to use the parameter -i to specify the interface corresponding to the link-local address.
[~DeviceA] ping ipv6 fe80::2d6f:0:7af3:1 -i GigabitEthernet 0/1/0
PING FE80::2D6F:0:7AF3:1 : 56 data bytes, press CTRL_C to break
Reply from FE80::2D6F:0:7AF3:1
bytes=56 Sequence=1 hop limit=64 time = 60 ms
Reply from FE80::2D6F:0:7AF3:1
bytes=56 Sequence=2 hop limit=64 time = 50 ms
Reply from FE80::2D6F:0:7AF3:1
bytes=56 Sequence=3 hop limit=64 time = 50 ms
Reply from FE80::2D6F:0:7AF3:1
bytes=56 Sequence=4 hop limit=64 time = 30 ms
Reply from FE80::2D6F:0:7AF3:1
bytes=56 Sequence=5 hop limit=64 time = 1 ms
--- FE80::2D6F:0:7AF3:1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/38/60 ms
# Ping the global unicast IPv6 address of Device B from Device A.
[~DeviceA] ping ipv6 2001:db8::2
PING 2001:db8::2 : 56 data bytes, press CTRL_C to break
Reply from 2001:db8::2
bytes=56 Sequence=1 hop limit=64 time = 30 ms
Reply from 2001:db8::2
bytes=56 Sequence=2 hop limit=64 time = 50 ms
Reply from 2001:db8::2
bytes=56 Sequence=3 hop limit=64 time = 50 ms
Reply from 2001:db8::2
bytes=56 Sequence=4 hop limit=64 time = 20 ms
Reply from 2001:db8::2
bytes=56 Sequence=5 hop limit=64 time = 40 ms
--- 2001:db8::2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/38/50 ms
Configuration Files
Device A configuration file
#
sysname DeviceA
#
admin
interface GigabitEthernet0/1/0
undo shutdown
ipv6 enable
ipv6 address 2001:db8::1/32
#
return
Device B configuration file
#
sysname DeviceB
#
admin
interface GigabitEthernet0/1/0
undo shutdown
ipv6 enable
ipv6 address 2001:db8::2/32
#
return
Example for Configuring an IPv6 Address Selection Policy Table
This section provides an example for configuring an IPv6 address selection policy table.
Networking Requirements
As shown in Figure 12-2, the domain name (huawei.com) of Server A maps multiple IPv6 addresses. When DeviceA, as an IPv6 DNS client, accesses Server A by using the domain name (huawei.com), the DNS Server sends all IPv6 addresses of Server A to DeviceA. Then DeviceA queries the IPv6 address selection policy table to select a proper IPv6 address as the destination address of Server A.
Configuration Roadmap
The configuration roadmap is as follows:
Configure IPv6 address selection policy entries.
Configure dynamic IPv6 DNS services.
Data Preparation
To complete the configuration, you need the following data:
IPv6 addresses on the interface of DeviceA
Addresses, label values, and precedence values of IPv6 address selection policy entries
IPv6 addresses of the DNS server
Procedure
- Configure IPv6 address selection policy entries.
# Configure IPv6 addresses for the interface.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*HUAWEI] commit
[~DeviceA] interface gigabitethernet 0/1/0
[~DeviceA-GigabitEthernet0/1/0] undo shutdown
[*DeviceA-GigabitEthernet0/1/0] ipv6 enable
[*DeviceA-GigabitEthernet0/1/0] ipv6 address fe80::1 link-local
[*DeviceA-GigabitEthernet0/1/0] ipv6 address 2001:db8:fed0:1::2 64
[*DeviceA-GigabitEthernet0/1/0] ipv6 address 2001:db8:2::2 64
[*DeviceA-GigabitEthernet0/1/0] ipv6 address 2001:db8:abcd::77 64
[*DeviceA-GigabitEthernet0/1/0] commit
[~DeviceA-GigabitEthernet0/1/0] quit
# Configure destination address selection policies.
[~DeviceA] ipv6 address-policy 2001:db8:fed0:1::2 128 100 100
[*DeviceA] ipv6 address-policy 2001:db8:1::1 128 100 100
[*DeviceA] commit
- Configure dynamic IPv6 DNS services.
[~DeviceA] dns resolve
[*DeviceA] dns server ipv6 2001:db8:abcd::1234
[*DeviceA] dns domain com
[*DeviceA] commit
[~DeviceA] quit
- Verify the configuration.
# Run the ping ipv6 huawei.com command on DeviceA. The command output shows that Server A can be pinged, with the destination IP address 2001:db8:1::1.
<DeviceA> ping ipv6 huawei.com
Resolved Host (huawei.com -> 2001:db8:1::1)
PING huawei.com : 56 data bytes, press CTRL_C to break
Reply from 2001:db8:1::1: bytes=56 Sequence=1 ttl=126 time=6 ms
Reply from 2001:db8:1::1: bytes=56 Sequence=2 ttl=126 time=4 ms
Reply from 2001:db8:1::1: bytes=56 Sequence=3 ttl=126 time=4 ms
Reply from 2001:db8:1::1: bytes=56 Sequence=4 ttl=126 time=4 ms
Reply from 2001:db8:1::1: bytes=56 Sequence=5 ttl=126 time=4 ms
--- huawei.com ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 4/4/6 ms
# Run the display ipv6 interface gigabitethernet 0/1/0 command on DeviceA. The command output shows information about the IPv6 address of GE 0/1/0.
<DeviceA> display ipv6 interface gigabitethernet 0/1/0
GigabitEthernet0/1/0 current state : UP
IPv6 protocol current state : UP
IPv6 is enabled, link-local address is FE80::1
Global unicast address(es):
2001:db8:fed0:1::2, subnet is 2001:db8:fed0:1::/64
2001:db8:2::2, subnet is 2001:db8:2::/64
2001:db8:abcd::77, subnet is 2001:db8:abcd::/64
Joined group address(es):
FF02::1:FF00:77
FF02::2
FF02::1
FF02::1:FF00:2
FF02::1:FF00: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
# Run the display ipv6 address-policy all command on DeviceA. The command output shows information about address selection policy entries.
<DeviceA> display ipv6 address-policy all
Policy Table : Total:7 ------------------------------------------------------------------------------- Prefix : :: PrefixLength : 0 Precedence : 40 Label : 1 Default : Yes Prefix : ::1 PrefixLength : 128 Precedence : 50 Label : 0 Default : Yes Prefix : ::FFFF:0.0.0.0 PrefixLength : 96 Precedence : 10 Label : 4 Default : Yes Prefix : 2001:db8:1::1 PrefixLength : 128 Precedence : 100 Label : 100 Default : No Prefix : 2002:: PrefixLength : 16 Precedence : 30 Label : 2 Default : Yes Prefix : FC00:: PrefixLength : 7 Precedence : 20 Label : 3 Default : Yes Prefix : 2001:db8:fed0:1::2 PrefixLength : 128 Precedence : 100 Label : 100 Default : No -------------------------------------------------------------------------------
Configuration Files
DeviceA configuration file
# sysname DeviceA # dns resolve dns server ipv6 2001:db8:abcd::1234 dns domain com # interface GigabitEthernet0/1/0 undo shutdown ipv6 enable ipv6 address 1001::1/64 ipv6 address 2001:db8:2::2/64 ipv6 address FE80::1 link-local ipv6 address 2001:db8:fed0:1::2/64 # ipv6 address-policy 2001:db8:1::1 128 100 100 ipv6 address-policy 2001:db8:fed0:1::2 128 100 100 # return
- Overview of IPv6
- Limitations for Basics of IPv6
- Configuring IPv6 Addresses for Interfaces
- Configuring an IPv6 Address Selection Policy Table
- Disabling the IPv6 Address Conflict Detection Function and Configuring the Preemption Function
- Configuring ICMPv6 Message Control
- Configuring a Filtering Policy for an IPv6 Extension Header
- Configuring PMTUs
- Configuring TCP6
- Maintaining IPv6
- Configuration Examples for IPv6