You are on page 1of 68

S12700 Series Agile Switches

Configuration Guide - IP Service 10 DHCPv6 Configuration

10 DHCPv6 Configuration

About This Chapter

10.1 Overview of DHCPv6


10.2 Understanding DHCPv6
10.3 Application Scenarios for DHCPv6
10.4 Licensing Requirements and Limitations for DHCPv6
10.5 Default Settings for DHCPv6
10.6 Configuring a DHCPv6 Server
10.7 Configuring a DHCPv6 PD Server
10.8 Configuring a DHCPv6 Relay Agent
10.9 Configuring a DHCPv6 Client
10.10 Configuring a DHCPv6 PD Client
10.11 Maintaining DHCPv6
10.12 Configuration Examples for DHCPv6

10.1 Overview of DHCPv6

Definition
Dynamic Host Configuration Protocol for IPv6 (DHCPv6) is designed to assign IPv6
addresses, prefixes, and other network configuration parameters to hosts.

Purpose
The IPv6 protocol provides huge address space formed by 128-bit IPv6 addresses
that require proper and efficient assignment and management policies. IPv6
stateless address autoconfiguration is widely used. Hosts configured with the

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 335


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

stateless address autoconfiguration function automatically configure IPv6


addresses based on prefixes carried in Route Advertisement (RA) packets sent
from a neighboring device.

When stateless address autoconfiguration is used, devices do not record IPv6


addresses of hosts. Therefore, stateless address autoconfiguration has poor
manageability. In addition, hosts configured with stateless address
autoconfiguration cannot obtain other configuration parameters such as the DNS
server address. Internet service providers (ISPs) do not provide instructions for
automatic allocation of IPv6 prefixes for devices. Therefore, users need to
manually configure IPv6 addresses for devices during IPv6 network deployment.

DHCPv6 solves this problem. DHCPv6 is a stateful protocol for configuring IPv6
addresses automatically.

Compared with manual address configuration and IPv6 stateless address


autoconfiguration that uses network prefixes in RA packets, DHCPv6 has the
following advantages:

● Controls IPv6 address assignment better. A DHCPv6 device can record


addresses assigned to hosts and assign requested addresses. This function
facilitates network management.
● Assigns IPv6 address prefixes to network devices. This function facilitates
automatic configuration and hierarchical network management.
● Provides other network configuration parameters such as the DNS server
address.

10.2 Understanding DHCPv6

10.2.1 DHCPv6 Basics

DHCPv6 runs between a client and a server. Similar to DHCP for IPv4, DHCPv6
clients and DHCPv6 servers exchange DHCPv6 packets using the User Datagram
Protocol (UDP). In IPv6, packets cannot be broadcast; therefore, DHCPv6 uses
multicast packets. In this case, DHCPv6 clients do not need to be configured with
IPv6 addresses of DHCPv6 servers.

IPv6 Address Allocation Methods


The IPv6 protocol provides huge address space formed by 128-bit IPv6 addresses
that require proper and efficient assignment and management policies.

Currently, the following methods are available to allocate IPv6 addresses:


● Manual configuration: You can manually configure IPv6 addresses, prefixes,
and other network configuration parameter, such as addresses of the Domain
Name System (DNS), Network Information Service (NIS), and Simple Network
Time Protocol (SNTP) servers.
● Stateless address autoconfiguration: Hosts generate a link-local address based
on the interface ID and automatically configure IPv6 addresses based on
prefixes carried in Router Advertisement (RA) packets.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 336


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

● Stateful autoconfiguration, that is DHCPv6, DHCPv6 allocation has the


following two methods:
– DHCPv6 stateful autoconfiguration: DHCPv6 servers automatically
provide IPv6 addresses, PD prefixes, and other network configuration
parameters, such as addresses of the DNS, NIS, and SNTP servers.
– DHCPv6 stateless autoconfiguration: IPv6 addresses are generated based
on RA packets. A DHCPv6 server does not provide IPv6 addresses but
provides other configuration parameters about the DNS, NIS, and SNTP
servers.

DHCPv6 Architecture
Figure 10-1 shows the DHCPv6 architecture.

Figure 10-1 DHCPv6 architecture

IPv6
Network
DHCPv6 Client DHCPv6 Relay

DHCPv6 Server

DHCPv6 involves the following roles:


● DHCPv6 client
A DHCPv6 client applies to a DHCPv6 server for IPv6 addresses, prefixes, and
network configuration parameters to complete its address configuration.
● DHCPv6 relay
A DHCPv6 relay agent relays DHCPv6 packets between a DHCPv6 client and a
DHCPv6 server to help the DHCPv6 client complete its address configuration.
Generally, a DHCPv6 client communicates with a DHCPv6 server through the
link-local multicast address to obtain IPv6 addresses, prefixes, and other
network configuration parameters. If a DHCPv6 server and a DHCPv6 client
are on different links, a DHCPv6 relay agent is required to forward DHCPv6
packets. In this case, you do not need to deploy a DHCPv6 server on each link,
which saves costs and facilitates centralized management.
A DHCPv6 relay agent is optional. If a DHCPv6 client and a DHCPv6 server are
on the same link or a DHCPv6 client communicates with a DHCPv6 server in
unicast mode to complete address allocation or information configuration,
you do not need to deploy a DHCPv6 relay agent. A DHCPv6 relay agent is
required only when a DHCPv6 client and a DHCPv6 server are located on
different links or a DHCPv6 client cannot communicate with a DHCPv6 server
in unicast mode.
● DHCPv6 server
A DHCPv6 server processes requests of address allocation, address lease
extension, and address release from a DHCPv6 client or a DHCPv6 relay

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 337


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

agent, and assigns IPv6 addresses and other network configuration


parameters to the DHCPv6 client.

Basic DHCPv6 Concepts


● Multicast address
– In DHCPv6, a DHCPv6 client does not need to be configured with the
IPv6 address of a DHCPv6 server. Instead, the DHCPv6 client locates
DHCPv6 servers by sending Solicit packets with multicast addresses as
destination addresses.
– In DHCPv4, a DHCP client locates DHCP servers by broadcasting DHCP
packets. To prevent broadcast storms, IPv6 does not use broadcast
packets. Instead, IPv6 uses multicast packets. DHCPv6 uses the following
two multicast addresses:

▪ FF02::1:2 (All DHCP Relay Agents and Servers): indicates the


multicast address of all the DHCPv6 servers and DHCPv6 relay
agents. The address is a link-local multicast address and is used for
communication between a DHCPv6 client and its neighboring servers
or between a DHCPv6 client and DHCPv6 relay agents. All DHCPv6
servers and relay agents are members of this multicast group.

▪ FF05::1:3 (All DHCP Servers): indicates the multicast address of all


the DHCPv6 servers. The address is a site-local address and is used
for communication between DHCPv6 relay agents and DHCPv6
servers within a site. All DHCPv6 servers within a site are members of
this multicast group.
● UDP port number
– DHCPv6 packets are transmitted through UDPv6.
– DHCPv6 clients only process DHCPv6 packets with UDP port number 546.
– DHCPv6 servers and relay agents only process DHCPv6 packets with UDP
port number 547.
● DHCPv6 Unique Identifier (DUID)
– A DUID identifies a DHCPv6 device. Each DHCPv6 server or client has a
unique DUID. DHCPv6 servers use DUIDs to identify DHCPv6 clients and
DHCPv6 clients use DUIDs to identify DHCPv6 servers.
– The DUIDs of a DHCPv6 client and a DHCPv6 server are carried in the
Client Identifier option and the Server Identifier option respectively. The
Client Identifier option and the Server Identifier option have the same
format and are distinguished by the option-code field value.
● Identity association (IA)
– An IA enables a DHCPv6 server and a DHCPv6 client to identify, group,
and manage IPv6 addresses. Each IA consists of an identity association
identifier (IAID) and associated configuration information.
– A DHCPv6 client must associate at least one IA with each of its network
interfaces for which the DHCPv6 client requests IPv6 addresses from a
DHCP server. The DHCPv6 client uses IAs associated with network
interfaces to obtain configuration information from a DHCPv6 server.
Each IA must be associated with at least one interface.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 338


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

– The IAID identifies an IA, and IAIDs on the same DHCPv6 client must be
unique. The IAID is not lost or changed because of factors such as
DHCPv6 client reboot.
– The configuration information in an IA consists of one or more IPv6
addresses along with the lifetimes T1 and T2. Each address in an IA has a
preferred lifetime and a valid lifetime.
– An interface must be associated with at least one IA; an IA can contain
information about one or more addresses.

10.2.2 DHCPv6 Packets

DHCPv6 Packet Format


Figure 10-2 shows the DHCPv6 packet format.

Figure 10-2 DHCPv6 packet format


0 7 31
msg-type transaction-ID
options (variable)

Table 10-1 Description of each field in a DHCPv6 packet

Field Lengt Description


h

msg-type 1 byte Indicates the packet type. The value ranges from 1 to 13.
For details, see the DHCPv6 Packet Type.

transactio 3 bytes Identifies packet transaction between DHCPv6 clients and


n-ID servers. For example, a DHCPv6 client initiates a Solicit/
Advertise transaction or a Request/Reply transaction.
Their transaction IDs are different. Transaction IDs have
the following characteristics:
● The transaction ID is randomly generated by a DHCPv6
client.
● Transaction IDs of request and reply packets must be
the same.
● The transaction ID of a packet initiated by a DHCPv6
server is 0.

Options Variabl Indicates the option field in a DHCPv6 packet. The option
e field contains configurations that the DHCPv6 server
assigns to IPv6 hosts, such as the IPv6 address of the DNS
server.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 339


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

DHCPv6 Packet Type


DHCPv6 defines 13 types of packets. A DHCPv6 server and a DHCPv6 client
communicate by exchanging these types of packets. Table 10-2 lists DHCPv6
packets and their corresponding DHCPv4 packets and describes the DHCPv6
packets.

Table 10-2 Comparisons between DHCPv6 packets and DHCPv4 packets


DHC DHCPv6 DHCPv4 Description
P Packet Packet
Pack
et
Type

1 SOLICIT DHCP A DHCPv6 client sends a Solicit packet to locate


DISCOVE DHCPv6 servers.
R

2 ADVERTI DHCP A DHCPv6 server sends an Advertise packet in


SE OFFER response to a Solicit packet to declare that it can
provide DHCPv6 services.

3 REQUEST DHCP A DHCPv6 client sends a Request packet to


REQUEST request IPv6 addresses and other configuration
parameters from a DHCPv6 server.

4 CONFIR - A DHCPv6 client sends a Confirm packet to any


M available DHCPv6 server to check whether the
obtained IPv6 address applies to the link that
the DHCPv6 client is connected to.

5 RENEW DHCP A DHCPv6 client sends a Renew packet to the


REQUEST DHCPv6 server that provides the IPv6 addresses
and other configuration parameters to extend
the lifetime of the addresses and to update
configuration parameters.

6 REBIND DHCP A DHCPv6 client sends a Rebind packet to any


REQUEST available DHCPv6 server to extend the lifetime
of the assigned IPv6 address and to update
configuration parameters when the client does
not receive a response to its Renew packet.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 340


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

DHC DHCPv6 DHCPv4 Description


P Packet Packet
Pack
et
Type

7 REPLY DHCP A DHCPv6 server sends a Reply packet in the


ACK/NAK following situations:
1. A DHCPv6 server sends a Reply packet
containing IPv6 addresses and configuration
parameters in response to a Solicit, Request,
Renew or Rebind packet received from a
DHCPv6 client.
2. A DHCPv6 server sends a Reply packet
containing configuration parameters in
response to an Information-Request packet.
3. A DHCPv6 server sends a Reply packet in
response to a Confirm, Release, or Decline
packet received from a DHCPv6 client.

8 RELEASE DHCP A DHCPv6 client sends a Release packet to the


RELEASE DHCPv6 server that assigns IPv6 addresses to
the DHCPv6 client, indicating that the DHCPv6
client will no longer use the obtained addresses.

9 DECLINE DHCP A DHCPv6 client sends a Decline packet to a


DECLINE DHCPv6 server, indicating that the IPv6
addresses assigned by the DHCPv6 server are
already in use on the link to which the DHCPv6
client is connected.

10 RECONFI - A DHCPv6 server sends a Reconfigure packet to


GURE a DHCPv6 client, informing the DHCPv6 client
that the DHCPv6 server has new addresses or
updated configuration parameters.

11 INFORM DHCP A DHCPv6 client sends an Information-Request


ATION- INFORM packet to a DHCPv6 server to request
REQUEST configuration parameters except for IPv6
addresses.

12 RELAY- - A DHCPv6 relay agent sends a Relay-Forward


FORW packet to relay Request packets to DHCPv6
servers.

13 RELAY- - A DHCPv6 server sends a Relay-Reply packet to


REPL a DHCPv6 relay agent. The Relay-Reply packet
carries a packet that the DHCPv6 relay agent
needs to deliver to a DHCPv6 client.

10.2.3 DHCPv6 Implementation

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 341


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

DHCPv6 autoconfiguration is classified as stateful or stateless.


● DHCPv6 stateful autoconfiguration: A DHCPv6 server automatically configures
IPv6 addresses, prefixes, and network configuration parameters of the DNS,
NIS, and SNTP servers.
● DHCPv6 stateless autoconfiguration: IPv6 addresses are generated based on
the Route Advertisement (RA) packets. A DHCPv6 server provides other
configuration parameters such as addresses of the DNS, NIS, and SNTP
servers except for IPv6 addresses.

DHCPv6 Stateful Autoconfiguration


The IPv6 node obtains addresses and other configuration parameters (such as the
IPv6 address of the DNS server) through stateful DHCPv6 autoconfiguration.
A DHCPv6 server assigns addresses and prefixes to a DHCPv6 client in the
following ways:
● DHCPv6 four-message exchange
● DHCPv6 two-message exchange
DHCPv6 Four-Message Exchange
Four-message exchange applies to a network where multiple DHCPv6 servers are
available. A DHCPv6 client first multicasts a Solicit packet to locate DHCPv6
servers that can provide DHCPv6 services. After receiving Advertise packets from
multiple DHCPv6 servers, the DHCPv6 client selects one of the DHCPv6 servers
according to priorities of DHCPv6 servers. Then the DHCPv6 client and the
selected DHCPv6 server complete address application and allocation by
exchanging Request and Reply packets.
If a DHCPv6 server does not have two-message exchange enabled, the DHCPv6
server allocates addresses and configuration parameters through four-message
exchange, regardless of whether the Solicit packet contains the Rapid Commit
option.
Figure 10-3 shows the process of address allocation using four-message exchange.

Figure 10-3 Process of address allocation using four-message exchange

DHCPv6 Client DHCPv6 Server

(1) Solicit

(2) Advertise

(3) Request

(4) Reply

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 342


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

The process of address allocation using four-message exchange is as follows:


1. A DHCPv6 client sends a Solicit packet to request a DHCPv6 server to allocate
IPv6 addresses and network configuration parameters.
2. If the DHCPv6 server does not support fast address allocation, the DHCPv6
server returns an Advertise packet containing the allocated addresses and
network configuration parameters regardless of whether the Solicit packet
contains the Rapid Commit option.
3. If receiving Advertise packets from multiple DHCPv6 servers, the DHCPv6
client selects the DHCPv6 server with the highest priority and sends Request
multicast packets to all DHCPv6 servers. The Request multicast packets carry
the DUID of the selected DHCPv6 server.
4. The DHCPv6 server responds with a Reply packet that contains the addresses
and network configuration parameters allocated to the client.
DHCPv6 Two-Message Exchange
Two-message exchange applies to a network where only one DHCPv6 server is
available. A DHCPv6 client multicasts a Solicit packet to locate the DHCPv6 server
that can allocate addresses and configuration parameters. After receiving the
Solicit packet, the DHCPv6 server responds with a Reply packet carrying addresses
and configuration parameters allocated to the DHCPv6 client.
This packet exchange improves address allocation efficiency. On the network
where multiple DHCPv6 servers are available, multiple DHCPv6 servers can
allocate addresses to DHCPv6 clients and respond with Reply packets. The DHCPv6
clients, however, use the addresses and configuration parameters allocated by one
DHCPv6 server. To prevent the preceding situation, the administrator can configure
only one DHCPv6 server to support two-message exchange.
● If a DHCPv6 server is configured with two-message exchange and the Solicit
packet from a DHCPv6 client contains the Rapid Commit option, the DHCPv6
server allocates IPv6 addresses and configuration parameters in two-message
exchange mode.
● If a DHCPv6 server does not support fast address allocation, the DHCPv6
server allocates IPv6 addresses and other network configuration parameters
to clients using four-message exchange.
Figure 10-4 shows the process of address allocation using two-message exchange.

Figure 10-4 Process of address allocation using two-message exchange

DHCPv6 Client DHCPv6 Server

(1) Solicit (contains a Rapid Commit option)

(2) Reply

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 343


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

The process of address allocation using two-message exchange is as follows:


1. A DHCPv6 client sends a Solicit packet carrying the Rapid Commit option,
indicating that the DHCPv6 client requires fast address allocation and network
configuration parameters from a DHCPv6 server.
2. After receiving the Solicit message, the DHCPv6 server will process it as
follows:
– If the DHCPv6 server supports fast address allocation, it returns a Reply
packet and allocates IPv6 addresses and other network configuration
parameters to the DHCPv6 client.
– If the DHCPv6 server does not support fast address allocation, the
DHCPv6 server uses four-message exchange to allocate IPv6 addresses,
prefixes, and other network configuration parameters.

DHCPv6 Stateless Autoconfiguration


The IPv6 node obtains network configuration parameters (including configuration
parameters of DNS, SIP, and SNTP servers, without IPv6 addresses) through
DHCPv6 stateless autoconfiguration.
Figure 10-5 shows the working process of DHCPv6 stateless autoconfiguration.

Figure 10-5 Working process of DHCPv6 stateless autoconfiguration

DHCPv6 Client DHCPv6 Server

Information-request:
includes an Option Request option

Reply:
includes the requested options

The working process of DHCPv6 stateless autoconfiguration is as follows:


1. A DHCPv6 client multicasts an Information-Request packet with the Option
Request option to DHCPv6 servers. The Option Request option specifies the
configuration parameters that the DHCPv6 client needs to obtain from a
DHCPv6 server.
2. After receiving the Information-Request packet, the DHCPv6 server sends a
Reply packet to the client in unicast mode. The Reply packet carries the
allocated network configuration parameters. The DHCPv6 client performs
stateless autoconfiguration based on parameters carried in the Reply packet.

10.2.4 DHCPv6 PD Implementation

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 344


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

DHCPv6 prefix delegation (PD) is a prefix allocation mechanism and defined in


RFC 3633. On a layered network, IPv6 addresses of different layers are configured
manually. Manually configured IPv6 addresses have poor extensibility and cannot
be planned and managed in a centralized manner.
The DHCPv6 PD mechanism allows a downstream device to request IPv6 prefixes
from the upstream device and an upstream device to assign appropriate prefixes
for the downstream device. In this way, you do not need to configure IPv6 prefixes
for user-side links on the downstream device. The downstream device divides the
obtained prefix (the length of the obtained prefix is smaller than 64 bits) into 64-
bit prefix of subnet segments and sends a Route Advertisement (RA) packet on
the link that IPv6 hosts directly connect to. This enables hosts to automatically
configure addresses, completing IPv6 network deployment.
Figure 10-6 shows the working process of DHCPv6 PD.

Figure 10-6 DHCPv6 PD implementation

IPv6 HostA

Switch A Switch B

IPv6 HostB

DHCPv6 PD Client DHCPv6 PD Server


IPv6 HostC

The process of DHCPv6 PD using four-message exchange is as follows:


1. A DHCPv6 PD client sends a Solicit packet, requesting an IPv6 address prefix
from a DHCPv6 PD server.
2. If the DHCPv6 PD server does not support fast address allocation, the DHCPv6
PD server returns an Advertise packet containing the allocated address
prefixes regardless of whether the Solicit packet contains the Rapid Commit
option.
3. If receiving Advertise packets from multiple DHCPv6 PD servers, the DHCPv6
PD client selects the DHCPv6 PD server with the highest priority and sends a
Request packet to this DHCPv6 PD server to request address prefixes.
4. The DHCPv6 PD server responds with a Reply packet to assign an IPv6 address
prefix to the DHCPv6 PD client.
DHCPv6 PD also supports two-message exchange using packets carrying the Rapid
Commit option. For details, see DHCPv6 Two-Message Exchange

10.2.5 DHCPv6 Relay Agent Implementation


Figure 10-7 shows the working process of a DHCPv6 relay agent. A DHCPv6 client
sends packets to a DHCPv6 server through a DHCPv6 relay agent to obtain IPv6
addresses, prefixes, and other network configuration parameters, such as IPv6
addresses of DNS servers.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 345


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

Figure 10-7 DHCPv6 relay agent implementation

DHCPv6 Client DHCPv6 Relay DHCPv6 Server

(1) DHCPv6 message from client

(2) Relay-forward

(3) Relay-reply

(4) DHCPv6 message to client

The working process of a DHCPv6 relay agent is as follows:


1. A DHCPv6 client sends DHCPv6 Request packets with the destination
multicast address FF02::1:2 to all DHCPv6 servers and DHCPv6 relay agents.
2. A DHCPv6 relay agent processes packets in the following two ways:
– If a DHCPv6 relay agent and a DHCPv6 client are located on the same
link, that is, the DHCPv6 relay agent is the first-hop relay agent of the
DHCPv6 client, the DHCPv6 relay agent is the IPv6 gateway of the
DHCPv6 client. After receiving a packet from the DHCPv6 client, the
DHCPv6 relay agent encapsulates the packet in the Relay Message option
of a Relay-Forward packet. Then the DHCPv6 relay agent sends the
Relay-forward packet to a DHCPv6 server or the next hop relay agent.
– If the DHCPv6 relay agent and DHCPv6 client are on different links, the
DHCPv6 relay agent receives Relay-Forward packets sent from other relay
agents. The DHCPv6 relay agent constructs a new Relay-Forward packet
and sends the packet to the DHCPv6 server or the next hop relay agent.
3. The DHCPv6 server parses the request of the DHCPv6 client in the Relay-
Forward packet and selects IPv6 addresses and other network configuration
parameters to construct a reply packet. Then the DHCPv6 server encapsulates
the reply packet in the Relay Message option in a Relay-Reply packet and
sends the Relay-reply packet to the DHCPv6 relay agent.
4. The DHCPv6 relay agent parses the reply packet of the DHCPv6 server in the
Relay-Reply packet and forwards the reply packet to the DHCPv6 client. If the
DHCPv6 client receives reply packets from multiple DHCPv6 servers, the
DHCPv6 client selects the DHCPv6 server with the highest priority, and
obtains the IPv6 address and other network configuration parameters from
the DHCPv6 server.

10.2.6 IPv6 Address/Prefix Allocation and Lease Updating

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 346


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

IPv6 Address Allocation Sequence


The DHCPv6 server allocates an IPv6 address or prefix to a DHCPv6 client in the
following sequence:

1. Select an IPv6 address pool.


An IPv6 address pool can be bound to an interface of the DHCPv6 server. The
DHCPv6 server assigns an address or prefix to the DHCPv6 client from the
IPv6 address pool. If a relay exists, the IPv6 address pool cannot be bound to
the interface of the DHCPv6 server. Based on the first link-address field
(identifies the link range of the DHCPv6 clients) whose value is not 0 in the
packet, the address pool that can be bound must be in the same link range
with the network prefixes or IPv6 address prefixes in the configured address
pools.
2. Select an IPv6 address or prefix.
After the address pool is configured, the DHCPv6 server assigns IPv6
addresses or prefixes to DHCPv6 clients in the following procedures:
a. If IPv6 addresses or prefixes have been specified in the address pool,
these addresses and prefixes matching the client DUIDs are preferentially
assigned to clients.
b. If the IA option in the packet sent from the client carries valid addresses
or prefixes, these addresses or prefixes are preferentially assigned to
clients from the address pool. If these addresses or prefixes are
unavailable in the address pool, other idle addresses or prefixes are
assigned to clients. If the IPv6 prefix length exceeds the assigned length,
the IPv6 prefix of the assigned length is assigned.
c. Idle addresses and prefixes are assigned to clients from the address pool.
Reserved addresses, conflicted addresses, and used addresses cannot be
assigned to clients. Reserved addresses include unspecified addresses,
multicast addresses, loopback addresses, link-local addresses, NSAP
addresses, and anycast addresses (defined in RFC 2526).
d. If no IPv6 address or prefix can be assigned, address or prefix allocation
fails.

DHCPv6 Address Lease Updating


The addresses allocated by DHCPv6 servers to DHCPv6 clients have leases. A lease
is composed of the lifetime (including the preferred lifetime and valid lifetime)
and lease extension time (T1 and T2 in an IA). After the valid lifetime of an
address is reached, a DHCPv6 client can no longer use this address. Before the
valid lifetime is reached, a DHCPv6 client needs to update the address lease if it
needs to continue to use this address.

To extend the valid lifetime and preferred lifetime for the addresses associated
with an IA, a DHCPv6 client sends a Renew packet to the DHCPv6 server at T1.
The IA option in the Renew packet carries the addresses whose leases need to be
extended. If the DHCPv6 client does not receive a response packet, it sends a
Rebind packet at T2 to the DHCPv6 server to continue to extend the address lease.

Figure 10-8 shows the process of updating the address lease at T1.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 347


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

Figure 10-8 Process of updating the address lease at T1


DHCPv6 Client DHCPv6 Server

(1) Renew
T1

(2) Reply

The process of updating the address lease at T1 is as follows:

1. A DHCPv6 client sends a Renew packet to request to update the address lease
at T1 (the recommended value of T1 is half the preferred lifetime).
2. A DHCPv6 server responds with a Reply packet.
– If the DHCPv6 client can continue to use the address, the DHCPv6 server
responds with a Reply packet indicating that the address lease is
extended successfully. In addition, the DHCPv6 server informs the
DHCPv6 client that the address lease is updated successfully.
– If the DHCPv6 client cannot use the address, the DHCPv6 server responds
with a Reply packet indicating that address lease extension fails. In
addition, the DHCPv6 server informs the DHCPv6 client that the DHCPv6
client cannot obtain a new address lease.

Figure 10-9 shows the process of updating the address lease at T2.

Figure 10-9 Process of updating the address lease at T2


DHCPv6 Client DHCPv6 Server

(1) Renew
T1

(2) Rebind
T2
(3) Reply

The process of updating the address lease at T2 is as follows:

1. A DHCPv6 client sends a Renew packet to request to update the address lease
at T1, but does not receive a response packet from a DHCPv6 server.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 348


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

2. The DHCPv6 client multicasts a Rebind packet to all the DHCPv6 servers to
request them to update the address lease at T2 (the recommended value of
T2 is 0.8 times the preferred lifetime).
3. A DHCPv6 server responds with a Reply packet.
– If the DHCPv6 client can continue to use the address, the DHCPv6 server
responds with a Reply packet indicating that the address lease is
extended successfully. In addition, the DHCPv6 server informs the
DHCPv6 client that the address or prefix lease is updated successfully.
– If the DHCPv6 client cannot use the address, the DHCPv6 server responds
with a Reply packet indicating that address lease extension fails. In
addition, the DHCPv6 server informs the DHCPv6 client that the DHCPv6
client cannot obtain a new address lease.
If the DHCPv6 client does not receive a response packet from the DHCPv6
server, the DHCPv6 client stops using this address after the valid lifetime is
reached.

IP Address Reservation
The DHCPv6 server supports reserved IPv6 addresses that cannot be dynamically
allocated. For example, an IPv6 address can be reserved for a DNS server.

10.3 Application Scenarios for DHCPv6

10.3.1 Typical Networking of the DHCPv6 Server


Figure 10-10 shows a typical networking of the DHCPv6 server.

Figure 10-10 Networking of the DHCPv6 server

Switch

DHCPv6 Server

DHCPv6 Client

The device functions as the DHCPv6 server to assign IPv6 addresses to clients. The
DHCPv6 client applies to the DHCPv6 server for configurations including an IPv6
address and DNS server address. The DHCPv6 server replies with related
configurations according to policies.
The DHCPv6 server assigns a complete IPv6 address to a host and provides other
configuration parameters such as the DNS server address. The DHCPv6 server also
provides stateless DHCPv6 services. That is, the DHCPv6 server does not assign
IPv6 addresses but provides hosts with configuration parameters such as the DNS

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 349


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

server address and domain name. Hosts automatically configure IPv6 addresses
based on RA messages. This overcomes the limitations of IPv6 stateless address
autoconfiguration.

10.3.2 Typical Networking of the DHCPv6 PD Server


Figure 10-11 shows a typical networking of the DHCPv6 PD server.

Figure 10-11 Networking of the DHCPv6 PD server

IPv6 HostC

SwitchB SwitchA

DHCPv6 PD Client DHCPv6 PD Server

IPv6 HostA IPv6 HostB

The device functions as the DHCPv6 PD server to assign IPv6 address prefixes to
DHCPv6 PD clients.
The DHCPv6 PD mechanism allows SwitchB to function as a DHCPv6 PD client to
request IPv6 prefixes from the DHCPv6 PD server and allows the DHCPv6 PD
server to assign prefixes to SwitchB. In this way, SwitchB does not need to assign
IPv6 prefixes for user-side links. SwitchB divides the obtained prefix (the length of
the obtained prefix is smaller than 64 bits) into 64-bit prefix of subnet segments
and sends an RA message on the link that hosts directly connect to. The RA
message contains 64-bit prefix of subnet segments. This enables hosts to
automatically configure addresses.

10.3.3 Typical Networking of the DHCPv6 Relay Agent


Figure 10-12 shows a typical networking of the DHCPv6 relay agent.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 350


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

Figure 10-12 Networking of the DHCPv6 relay agent

Switch A Switch B

Internet
DHCPv6 Relay DHCPv6 Server

DHCPv6 Client

The device functions as a DHCPv6 relay agent, the client can communicate with a
DHCPv6 server on another network segment through the DHCPv6 relay agent,
and obtain an IPv6 address and other configuration parameters from the global
address pool on the DHCP server. In this manner, DHCPv6 clients on multiple
network segments can share one DHCPv6 server. This reduces costs and facilitates
centralized management.

10.3.4 Typical Networking of the DHCPv6 Client


Figure 10-13 shows a typical networking of the DHCPv6 client.

Figure 10-13 Networking of the DHCPv6 client

SwitchB SwitchA
DHCPv6 Client DHCPv6 Server

When the DHCPv6 client function is configured on the device, the device
dynamically obtains IPv6 addresses and other network configuration parameters
from the DHCPv6 server. This operation facilitates user configurations and
centralized management.

10.3.5 Typical Networking of the DHCPv6 PD Client


Figure 10-14 shows a typical networking of the DHCPv6 PD client.

Figure 10-14 Networking of the DHCPv6 PD client

IPv6 HostA

Switch A Switch B

IPv6 HostB

DHCPv6 PD Client DHCPv6 PD Server

IPv6 HostC

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 351


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

The DHCPv6 PD client function is configured on the device, the device dynamically
obtains IPv6 addresses and other network configuration parameters from the
DHCPv6 PD server. This operation facilitates user configurations and centralized
management. The device divides the obtained IPv6 prefix (the length of the
obtained prefix is smaller than 64 bits) into 64-bit prefix of subnet segments and
sends an RA message on the link that hosts directly connect to. The RA message
contains 64-bit prefix of subnet segments. This enables hosts to automatically
configure addresses.

10.4 Licensing Requirements and Limitations for


DHCPv6

Involved Network Elements


Other network elements are not required.

Licensing Requirements
DHCPv6 requires that the device should support IPv6. The IPv6 function is
controlled by a license. By default, the IPv6 function is disabled on a new device.
To use the IPv6 function, apply for and purchase the license from the device
supplier.

For details about how to apply for a license, see S Series Switch License Use
Guide.

Version Requirements

Table 10-3 Products and versions supporting DHCPv6

Product Product Software Version


Model

S12700 S12708/ DHCPv6 client and DHCPv6 PD client: V200R006C00,


S12712 V200R007C00, V200R007C20, V200R008C00,
V200R009C00, V200R010C00, V200R011C10
DHCPv6 relay agent, DHCPv6 server, and DHCPv6
PD server: V200R005C00, V200R006C00,
V200R007C00, V200R007C20, V200R008C00,
V200R009C00, V200R010C00, V200R011C10

S12710 V200R010C00, V200R011C10

S12704 V200R008C00, V200R009C00, V200R010C00,


V200R011C10

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 352


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

NOTE
To know details about software mappings, see Hardware Query Tool.

Feature Limitations
Wireless users do not support DHCPv6.

In V200R010C00 and later versions, L3 sub-interfaces support the DHCPv6


function.

10.5 Default Settings for DHCPv6

Context
Parameter Default Setting

DHCPv6 DUID based on the link-layer (LL) address

the time for updating IPv6 86400s (24 hours).


address pool configurations

10.6 Configuring a DHCPv6 Server


Pre-configuration Tasks
You can configure a DHCPv6 server to dynamically assign configuration
information such as IPv6 addresses to DHCPv6 clients.

Before configuring the DHCPv6 server, complete the following tasks:

● Ensure that the link between the DHCPv6 client and the switch works
properly and the DHCPv6 client can communicate with the switch.
● (Optional) In the scenario where the DHCPv6 relay exists, configure the route
between the switch and DHCPv6 relay agent or client.

Configuration Procedure
The configuration tasks are performed in sequence.

10.6.1 Configuring the DHCPv6 DUID

Context
The DUID identifies a DHCPv6 device. Each DHCPv6 server or client has a unique
DUID. DHCPv6 servers use DUIDs to identify DHCPv6 clients and DHCPv6 clients
use DUIDs to identify DHCPv6 servers.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 353


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run dhcpv6 duid { ll | llt | duid }
A DUID is configured for the device.
By default, the device generates a DUID based on the link-layer (LL) address.

----End

10.6.2 Configuring an IPv6 Address Pool


Context
To implement the DHCPv6 function, you need to create an IPv6 address pool and
configure its attributes including the IPv6 address range, IPv6 configuration
update time, IPv6 addresses not to be automatically allocated, and IPv6 addresses
to be statically bound to clients. IPv6 addresses can be dynamically assigned or
statically bound to clients based on client requirements.

Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run dhcpv6 pool pool-name
An IPv6 address pool is created and the address pool view is displayed.
By default, no IPv6 address pool is created on the device.
Step 3 Run the commands in the IPv6 address pool view to configure the network prefix.
When functioning as a DHCPv6 server, the device supports the DHCPv6 stateful
mode and DHCPv6 stateless mode to assign network parameters to clients. In
DHCPv6 stateful mode, the DHCPv6 server automatically provides IPv6 addresses,
prefixes, and other network configuration parameters, such as DNS, NIS, and
SNTP server addresses. In DHCPv6 stateless mode, the DHCPv6 server does not
provide IPv6 addresses but provides other configuration parameters about the
DNS, NIS, and SNTP servers. IPv6 addresses for clients are still generated based on
Route Advertisement (RA) packets.
● When the DHCPv6 server needs to automatically assign network parameters
in DHCPv6 stateful mode, run the address prefix ipv6-prefix/ipv6-prefix-
length [ eui-64 ] [ life-time { valid-lifetime | infinite } { preferred-lifetime |
infinite } ] command to configure network prefixes and lifetimes in the IPv6
address pool view.
By default, no network prefix and lifetime are configured in the IPv6 address
pool view.
● When the DHCPv6 server needs to automatically assign network parameters
in DHCPv6 stateless mode, run the link-address ipv6-prefix/ipv6-prefix-length
command to configure networks prefixes in the IPv6 address pool view.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 354


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

By default, no network prefix is configured in the IPv6 address pool view.


The DHCPv6 server determines the clients on network segments to which the
server assigns network configuration parameters from an address pool based
on the configured network prefixes.
Step 4 (Optional) Run lock
The IPv6 address pool is locked
By default, the IPv6 address pool is unlocked.
Step 5 (Optional) Run static-bind address ipv6-address duid client-duid [ iaid iaid ]
[ life-time { valid-lifetime | infinite } { preferred-lifetime | infinite } ]
The IPv6 address is statically bound to the client DUID.
By default, no IPv6 address is bound to client DUID in the address pool view.
To statically assign specified IPv6 addresses to some specific clients, specify the
mapping between IPv6 addresses and client DUIDs. When such a client requests
an IPv6 address from the DHCPv6 server, the device functioning as the DHCPv6
server assigns the specified IPv6 address to the client.
Configure the specified IPv6 addresses to be assigned only to the clients with
specified DUIDs.
Step 6 (Optional) Run excluded-address start-ipv6-address [ to end-ipv6-address ]
The range of the IPv6 addresses that cannot be automatically assigned is specified
in the IPv6 address pool.
By default, all IPv6 addresses in the address pool can be automatically assigned to
clients. If only one IPv6 address is not automatically assigned, you can specify only
the value of start-ipv6-address.
Step 7 (Optional) Run information-refresh time
The time is configured for updating configuration parameters assigned to clients
through stateless DHCPv6 address autoconfiguration.
By default, the time for updating IPv6 address pool configuration is 86400s (24
hours).
Step 8 (Optional) Run capwap-ac ipv6-address
The IPv6 address for the AC is configured.
By default, the AC's IPv6 address is not configured in the IPv6 address pool view.
In the AC+Fit AP scenario, the AC needs to establish connections with APs. The
device functioning as a DHCPv6 server can specify the AC's IPv6 address for an AP.
The AP then can connect to the specified AC. If the AC and AP are located in the
same network segment, this step is optional because the AP will send a broadcast
packet to automatically discover the AC. If the AC and AP are located in different
network segments, this step is mandatory.
Step 9 (Optional) Run renew-time-percent renew-time-percent rebind-time-percent
rebind-time-percent
The percentage of the lease renewal time and the percentage of the rebinding
time in the preferred lifetime of an IPv6 address pool are configured.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 355


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

By default, the percentage of the lease renewal time in the preferred lifetime of an
IPv6 address pool is 50%, and the percentage of the rebinding time is 80%.

Step 10 (Optional) Run conflict-address expire-time expire-time

The aging time is set for conflicted addresses in the IPv6 address pool.

By default, the aging time of conflicted addresses is 172800s (two days).

----End

10.6.3 (Optional) Configuring Network Server Addresses for


the IPv6 Address Pool

Context
To successfully connect DHCPv6 clients to the Internet, the DHCPv6 server needs
to specify network service configurations such as the DNS server address and SIP
server address when assigning IPv6 addresses to the clients. The DHCPv6 server
dynamically allocates carrier-assigned configurations such as the DNS server
address and SIP server address to DHCPv6 clients.

Procedure
Step 1 Run system-view

The system view is displayed.

Step 2 Run dhcpv6 pool pool-name

An IPv6 address pool is created and the address pool view is displayed.

By default, no IPv6 address pool is created on the device.

Step 3 In the IPv6 address pool view, you can run one or more following commands to
configure network server addresses.
● Run the dns-server ipv6-address command to configure the DNS server
address for the DHCPv6 address pool.
● Run the dns-domain-name dns-domain-name command to configure the
DNS domain name suffix allocated by the DHCPv6 server to the client.
● Run the sip-server ipv6-address command to configure the SIP server IPv6
address for the DHCPv6 address pool.
● Run the sip-domain-name sip-domain-name command to configure the SIP
domain name suffix allocated by the DHCPv6 server to the client.
● Run the nis-server ipv6-address command to configure the NIS server IPv6
address for the DHCPv6 address pool.
● Run the nis-domain-name nis-domain-name command to configure the NIS
domain name suffix allocated by the DHCPv6 server to the client.
● Run the nisp-server ipv6-address command to configure the NISP server IPv6
address for the DHCPv6 address pool.
● Run the nisp-domain-name nisp-domain-name command to configure the
NISP domain name suffix allocated by the DHCPv6 server to the client.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 356


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

● Run the sntp-server ipv6-address command to configure the SNTP server


IPv6 address for the DHCPv6 address pool.

By default, DNS, SIP, NIS, NISP, and SNTP server addresses are not configured for
the IPv6 address pool.

----End

10.6.4 (Optional) Configuring the Options of an IPv6 Address


Pool

Context
DHCPv6 provides various options. To use these options, add them to the attribute
list of the DHCPv6 server manually. If the DHCPv6 server is configured with the
vendor-defined Option field, the client can obtain the configuration information in
the Option field of the DHCPv6 reply packet from the server when a DHCPv6
client applies for an IPv6 address.

Procedure
Step 1 Run system-view

The system view is displayed.

Step 2 Run dhcpv6 pool pool-name

An IPv6 address pool is created and the address pool view is displayed.

By default, no IPv6 address pool is created on the device.

Step 3 Run vendor-specific vendor-id

Vendor-defined options are configured for the IPv6 address pool and the vendor-
defined mode view is displayed.

By default, no vendor-defined option is configured. A maximum of 8 vendor-


defined options can be configured for one IPv6 address pool.

vendor-id indicates the vendor identifier ID, which is assigned by the IANA. The
identifier ID of Huawei is 2011.

Step 4 Run suboption suboption-code { address ipv6-address &<1-4> | ascii ascii-string |


hex hex-string }

Vendor-defined DHCPv6 sub-options are configured in the vendor-defined mode


view.

A maximum of 16 vendor-defined sub-options can be configured in the vendor-


defined mode view.

----End

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 357


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

10.6.5 (Optional) Configuring the DHCPv6 Data Saving


Function

Context
When the device functions as a DHCPv6 or DHCPv6 PD server, you can configure
the DHCPv6 data saving function to prevent data loss caused by device faults.
After the DHCPv6 data saving function is enabled, the device periodically saves
DHCPv6 data. The data includes the last data recording time, address pool name,
client DUID, IAID, address and prefix bound to the client DUID and IAID, conflicted
address, and conflict detection time.

Procedure
Step 1 Run system-view

The system view is displayed.

Step 2 Run dhcpv6 server database url [ write-delay interval ]

The DHCPv6 data saving function is configured.

By default, the DHCPv6 data saving function is disabled.

You can specify write-delay to modify the DHCPv6 data saving interval. By
default, the device saves DHCPv6 data every 86400 seconds.

----End

10.6.6 Enabling the DHCPv6 Server Function

Context
When the device functions as a DHCPv6 server, the DHCPv6 server function can be
enabled in the system view or interface view.
● Enable the DHCPv6 server function in the interface view.
Enable the DHCPv6 server function and specify the IPv6 address pool on the
interface that connects the device to the DHCPv6 clients. After receiving the
DHCPv6 request packets sent by the clients from the interface, the device
assigns configuration parameters such as IPv6 addresses or DNS server
addresses to the DHCPv6 clients from the IPv6 address pool bound to the
interface.
– If the DHCPv6 server and DHCPv6 clients are in the same link scope (that
is, no DHCPv6 relay exists), configuration parameters such as IPv6
addresses or DNS server addresses are assigned to the DHCPv6 clients on
the interface of the DHCPv6 server.
– If the DHCPv6 server and DHCPv6 clients are in different link scopes (that
is, a DHCPv6 relay exists), configuration parameters such as IPv6
addresses or DNS server addresses are assigned to the DHCPv6 clients in
one network segment connected to the DHCPv6 relay.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 358


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

NOTE

● Only one IPv6 address pool can be specified on an interface.


● If the DHCPv6 server function is enabled in the interface view, the configuration
information only takes effect on the interface.
● Enable the DHCPv6 server function in the system view.
The DHCPv6 server and DHCPv6 clients are in different link scopes (that is,
the DHCPv6 relay exists). If the DHCPv6 server function is enabled in the
interface view, configuration parameters such as IPv6 addresses are assigned
only to the clients in one network segment connected to the DHCPv6 relay,
because only one IPv6 address pool can be specified on an interface. If
configuration parameters such as IPv6 addresses need to be assigned to the
DHCPv6 clients in multiple network segments through the DHCPv6 relay,
enable the DHCPv6 server function in the system view.
The configuration method of enabling the DHCPv6 server function in the
interface view is affected by the physical interface status. If the interface
status is Down, the DHCPv6 server cannot successfully assign network
configuration parameters to clients through the DHCPv6 relay. When the
DHCPv6 server function is enabled in the system view and there are multiple
reachable routes between the DHCPv6 relay and DHCPv6 server, configuration
parameters such as IPv6 addresses can be assigned to clients through the
DHCPv6 relay as long as one route between the DHCPv6 relay and DHCPv6
server is reachable. This improves reliability of the configuration information
obtained by the clients. In addition, no configuration is required on the
interface, which reduces the administrator's maintenance workload.
NOTE

● If the DHCPv6 server function is enabled in the system view, the configuration
information takes effect on all interfaces of the device.
● If the DHCPv6 server function is enabled concurrently in the system view and interface
view, the configuration in the interface view takes precedence over that in the system
view.

Procedure
● Enable the DHCPv6 server function in the interface view.
a. Run system-view
The system view is displayed.
b. Run dhcp enable
The DHCP service is enabled.
c. Run ipv6
The IPv6 function is enabled globally.
d. Run interface interface-type interface-number
The interface view is displayed.
e. (Optional) On an Ethernet interface, run undo portswitch
The interface is switched to Layer 3 mode.
By default, an Ethernet interface works in Layer 2 mode.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 359


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

f. Run ipv6 enable

The IPv6 service is enabled on the interface.


g. Run ipv6 address { ipv6-address prefix-length |ipv6-address/prefix-
length }
The global unicast IPv6 address is configured for the interface.
h. Run dhcpv6 server pool-name [ allow-hint | preference preference-
value | rapid-commit | unicast ] *
The DHCPv6 server function is enabled on the interface.

By default, the DHCPv6 server function is disabled in the interface view.


● Enable the DHCPv6 server function in the system view.
a. Run system-view

The system view is displayed.


b. Run dhcp enable

The DHCP service is enabled.


c. Run ipv6

The IPv6 function is enabled globally.


d. (Optional) Run dhcpv6 server { allow-hint | preference preference-value
| rapid-commit | unicast } *

The DHCPv6 server function is enabled in the system view.

By default, the DHCPv6 server function is disabled in the system view.

When functioning as a DHCPv6 server, the device may be configured with


multiple IPv6 address pools. After receiving the DHCPv6 request packets,
the DHCPv6 server chooses the IPv6 address pool based on the following
rules:

▪ If a relay exists, the server chooses the address pool that belongs to
the same link scope with the configured network prefix (using the
link-address command) or IPv6 address prefix (using the address
prefix command) based on the first link-address field that is not 0.
The link-address field identifies the link scope of the DHCPv6 clients.

▪ If no relay exists, the DHCPv6 PD server function cannot be enabled


in the system view.

----End

Follow-up Procedure
For clients (such as PCs) that automatically obtain IPv6 addresses based on IPv6
RA packets by default, flags in RA messages need to be configured on the client
gateways so that the clients can obtain IPv6 addresses using DHCPv6.

● When the DHCPv6 relay does not exist and the device function as the client
gateway:

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 360


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

a. Run system-view
The system view is displayed.
b. Run interface interface-type interface-number
The interface view is displayed.
c. Run undo ipv6 nd ra halt
The RA packet sending function is enabled on the device.
By default, the switch for sending the RA packets is disabled.
d. Run ipv6 nd autoconfig managed-address-flag
The managed address configuration flag (M flag) of stateful auto-
configuration in an RA packet is configured.
By default, the M flag in the RA packet is not configured.
e. Run ipv6 nd autoconfig other-flag
The other flag (O flag) of stateful auto-configuration in an RA packet is
configured.
By default, the O flag in the RA packet is not configured.
After the M flag and O flag of stateful autoconfiguration in the RA
packet are configured, the client can obtain an IPv6 address using
DHCPv6.
● When the DHCPv6 relay exists and functions as the client gateway, the
configuration needs to be performed on the DHCPv6 relay device. Perform
configuration based on the preceding steps.

10.6.7 (Optional) Configuring the DHCPv6 Message Rate


Limit and Alarm Function of DHCPv6 Messages Discarded

Context
To prevent clients from sending a large number of messages to attack the device,
the device limits the rate of DHCPv6 messages.
After rate limit of DHCPv6 messages is enabled, the DHCPv6 messages are
discarded when the rate threshold is exceeded. After the alarm function of
DHCPv6 messages discarded is enabled, the device sends alarms when the number
of discarded DHCPv6 messages exceeds the threshold.

Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run dhcpv6 packet-rate packet-rate
Rate limit of DHCPv6 packets is enabled and the rate threshold is configured.
By default, rate limit of DHCPv6 messages is disabled on the switch.
Step 3 Run dhcpv6 packet-rate drop-alarm enable
The alarm function of DHCPv6 messages discarded is enabled on the device.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 361


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

By default, the alarm function of DHCPv6 messages discarded is disabled.


Step 4 Run dhcpv6 packet-rate drop-alarm threshold threshold
An alarm threshold for the number of discarded DHCPv6 messages when the
DHCPv6 message rate exceeds the rate threshold is set.
By default, the alarm threshold is 100 when the alarm function of DHCPv6
messages discarded is enabled.

----End

10.6.8 Verifying the DHCPv6 Server Configuration

Procedure
● Run the display dhcpv6 duid command to check the DUID of the DHCPv6
device on the network.
● Run the display dhcpv6 pool [ pool-name [ allocated { address | prefix } |
binding [ duid ] | conflict address | ipv6-address | ipv6-prefix/prefix-length ] ]
command to check IPv6 address pool configurations.
● Run the display dhcpv6 server [ database | [ statistics ] [ interface
interface-type interface-number ] ] command to check information about the
DHCPv6 server function.
----End

10.7 Configuring a DHCPv6 PD Server


Pre-configuration Tasks
You can configure a DHCPv6 PD server to dynamically assign configuration
information such as IPv6 addresses to DHCPv6 PD clients.
Before configuring the DHCPv6 PD server, complete the following tasks:
● Ensure that the link between the DHCPv6 client and the switch works
properly and the DHCPv6 client can communicate with the switch.
● (Optional) In the scenario where the DHCPv6 relay exists, configure the route
between the switch and DHCPv6 relay agent or client.

Configuration Logic
The configuration tasks are performed in sequence.

10.7.1 Configuring the DHCPv6 DUID

Context
The DUID identifies a DHCPv6 device. Each DHCPv6 server or client has a unique
DUID. DHCPv6 servers use DUIDs to identify DHCPv6 clients and DHCPv6 clients
use DUIDs to identify DHCPv6 servers.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 362


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

Procedure
Step 1 Run system-view

The system view is displayed.

Step 2 Run dhcpv6 duid { ll | llt | duid }

A DUID is configured for the device.

By default, the device generates a DUID based on the link-layer (LL) address.

----End

10.7.2 Configuring an IPv6 PD Address Pool

Context
IPv6 PD address pool refers to an IPv6 address pool used by a DHCPv6 server to
assign IPv6 address prefixes to DHCPv6 clients.

Procedure
Step 1 Run system-view

The system view is displayed.

Step 2 Run dhcpv6 pool pool-name

An IPv6 PD address pool is created and the address pool view is displayed.

By default, no IPv6 PD address pool is created on the device.

Switch supports 512 DHCPv6 PD users.

Step 3 Run prefix-delegation ipv6-prefix/ipv6-prefix-length assign-prefix-length [ life-


time { valid-lifetime | infinite } { preferred-lifetime | infinite } ]

An IPv6 address prefix agent is bound to the IPv6 address pool.

By default, no IPv6 address prefix agent is bound to the IPv6 address pool.

Step 4 (Optional) Run lock

The IPv6 PD address pool is locked

By default, the IPv6 PD address pool is unlocked.

Step 5 (Optional) Run link-address ipv6-prefix/ipv6-prefix-length

The network prefix is configured in the IPv6 address pool.

By default, no network prefix is configured in the IPv6 address pool view.

To enable the DHCPv6 PD server function in the system view, you must perform
this step to determine the network segment where the clients need to be assigned
IPv6 addresses prefixes by the PD address pool.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 363


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

Step 6 (Optional) Run static-bind prefix ipv6-prefix/ipv6-prefix-length duid client-duid


[ iaid iaid-value ] [ life-time { valid-lifetime | infinite } { preferred-lifetime |
infinite } ]

An IPv6 address prefix agent is statically bound to the DHCPv6 PD client in the
address pool view.

By default, no IPv6 address prefix agent is bound to the DHCPv6 PD client.

To statically assign specified IPv6 address prefixes to some specific clients, specify
the mapping between IPv6 address prefixes and client DUIDs. When such a client
requests an IPv6 address from the DHCPv6 PD server, the device functioning as
the DHCPv6 PD server assigns the specified IPv6 address to the client.

Configure the specified IPv6 address prefixes to be assigned only to the clients
with specified DUIDs.

----End

10.7.3 (Optional) Configuring Network Server Addresses for


the IPv6 Address Pool
Context
To successfully connect DHCPv6 clients to the Internet, the DHCPv6 server needs
to specify network service configurations such as the DNS server address and SIP
server address when assigning IPv6 addresses to the clients. The DHCPv6 server
dynamically allocates carrier-assigned configurations such as the DNS server
address and SIP server address to DHCPv6 clients.

Procedure
Step 1 Run system-view

The system view is displayed.

Step 2 Run dhcpv6 pool pool-name

An IPv6 address pool is created and the address pool view is displayed.

By default, no IPv6 address pool is created on the device.

Step 3 In the IPv6 address pool view, you can run one or more following commands to
configure network server addresses.
● Run the dns-server ipv6-address command to configure the DNS server
address for the DHCPv6 address pool.
● Run the dns-domain-name dns-domain-name command to configure the
DNS domain name suffix allocated by the DHCPv6 server to the client.
● Run the sip-server ipv6-address command to configure the SIP server IPv6
address for the DHCPv6 address pool.
● Run the sip-domain-name sip-domain-name command to configure the SIP
domain name suffix allocated by the DHCPv6 server to the client.
● Run the nis-server ipv6-address command to configure the NIS server IPv6
address for the DHCPv6 address pool.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 364


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

● Run the nis-domain-name nis-domain-name command to configure the NIS


domain name suffix allocated by the DHCPv6 server to the client.
● Run the nisp-server ipv6-address command to configure the NISP server IPv6
address for the DHCPv6 address pool.
● Run the nisp-domain-name nisp-domain-name command to configure the
NISP domain name suffix allocated by the DHCPv6 server to the client.
● Run the sntp-server ipv6-address command to configure the SNTP server
IPv6 address for the DHCPv6 address pool.

By default, DNS, SIP, NIS, NISP, and SNTP server addresses are not configured for
the IPv6 address pool.

----End

10.7.4 (Optional) Configuring the Options of an IPv6 Address


Pool

Context
DHCPv6 provides various options. To use these options, add them to the attribute
list of the DHCPv6 server manually. If the DHCPv6 server is configured with the
vendor-defined Option field, the client can obtain the configuration information in
the Option field of the DHCPv6 reply packet from the server when a DHCPv6
client applies for an IPv6 address.

Procedure
Step 1 Run system-view

The system view is displayed.

Step 2 Run dhcpv6 pool pool-name

An IPv6 address pool is created and the address pool view is displayed.

By default, no IPv6 address pool is created on the device.

Step 3 Run vendor-specific vendor-id

Vendor-defined options are configured for the IPv6 address pool and the vendor-
defined mode view is displayed.

By default, no vendor-defined option is configured. A maximum of 8 vendor-


defined options can be configured for one IPv6 address pool.

vendor-id indicates the vendor identifier ID, which is assigned by the IANA. The
identifier ID of Huawei is 2011.

Step 4 Run suboption suboption-code { address ipv6-address &<1-4> | ascii ascii-string |


hex hex-string }

Vendor-defined DHCPv6 sub-options are configured in the vendor-defined mode


view.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 365


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

A maximum of 16 vendor-defined sub-options can be configured in the vendor-


defined mode view.

----End

10.7.5 (Optional) Configuring the DHCPv6 Data Saving


Function
Context
When the device functions as a DHCPv6 or DHCPv6 PD server, you can configure
the DHCPv6 data saving function to prevent data loss caused by device faults.
After the DHCPv6 data saving function is enabled, the device periodically saves
DHCPv6 data. The data includes the last data recording time, address pool name,
client DUID, IAID, address and prefix bound to the client DUID and IAID, conflicted
address, and conflict detection time.

Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run dhcpv6 server database url [ write-delay interval ]
The DHCPv6 data saving function is configured.
By default, the DHCPv6 data saving function is disabled.
You can specify write-delay to modify the DHCPv6 data saving interval. By
default, the device saves DHCPv6 data every 86400 seconds.

----End

10.7.6 Enabling the DHCPv6 PD Server Function

Context
When the device functions as a DHCPv6 PD server, the DHCPv6 server function
can be enabled in the system view or interface view.
● Enable the DHCPv6 PD server function in the interface view.
Enable the DHCPv6 PD server function and specify the IPv6 PD address pool
on the interface that connects the device to the DHCPv6 clients. After
receiving the DHCPv6 request packets sent by the clients from the interface,
the device assigns configuration parameters such as IPv6 address prefixes or
DNS server addresses to the DHCPv6 clients from the IPv6 address pool
bound to the interface.
– If the DHCPv6 PD server and DHCPv6 PD clients are in the same link
scope (that is, no DHCPv6 relay exists), configuration parameters such as
IPv6 address prefixes or DNS server addresses are assigned to the
DHCPv6 PD clients on the interface of the DHCPv6 PD server.
– If the DHCPv6 PD server and DHCPv6 PD clients are in different link
scopes (that is, a DHCPv6 relay exists), configuration parameters such as

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 366


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

IPv6 address prefixes or DNS server addresses are assigned to the


DHCPv6 PD clients in one network segment connected to the DHCPv6
relay agent.
NOTE

● Only one IPv6 PD address pool can be specified on an interface.


● If the DHCPv6 PD server function is enabled in the interface view, the configuration
information only takes effect on the interface.
● Enable the DHCPv6 PD server function in the system view.
The DHCPv6 PD server and DHCPv6 PD clients are in different link scopes and
a DHCPv6 relay exists. If the DHCPv6 PD server function is enabled in the
interface view, configuration parameters such as IPv6 address prefixes are
assigned only to the clients in one network segment connected to the
DHCPv6 relay, because only one IPv6 PD address pool can be specified on an
interface. If configuration parameters such as IPv6 address prefixes need to be
assigned to the DHCPv6 PD clients in multiple network segments through the
DHCPv6 relay, enable the DHCPv6 PD server function in the system view.
The configuration method of enabling the DHCPv6 PD server function in the
interface view is affected by the physical interface status. If the interface
status is Down, the DHCPv6 PD server cannot successfully assign network
configuration parameters to clients through the DHCPv6 relay. If the DHCPv6
PD server function is enabled in the system view and there are multiple
reachable routes between the DHCPv6 relay and DHCPv6 PD server,
configuration parameters such as IPv6 address prefixes can be assigned to
clients through the DHCPv6 relay as long as one route between the DHCPv6
relay and DHCPv6 PD server is reachable. This improves reliability of the
configuration information obtained by the clients. In addition, no
configuration is required on the interface, which reduces the administrator's
maintenance workload.
NOTE

● If the DHCPv6 PD server function is enabled in the system view, the configuration
information takes effect on all interfaces of the device.
● If the DHCPv6 PD server function is enabled concurrently in the system view and
interface view, the configuration in the interface view takes precedence over that in the
system view.

Procedure
● Enable the DHCPv6 PD server function in the interface view.
a. Run system-view

The system view is displayed.


b. Run dhcp enable

The DHCP service is enabled.


c. Run ipv6

The IPv6 function is enabled globally.


d. Run interface interface-type interface-number

The interface view is displayed.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 367


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

e. (Optional) On an Ethernet interface, run undo portswitch


The interface is switched to Layer 3 mode.
By default, an Ethernet interface works in Layer 2 mode.
f. Run ipv6 enable
The IPv6 service is enabled on the interface.
g. Run ipv6 address { ipv6-address prefix-length | ipv6-address/prefix-
length }
The global unicast IPv6 address is configured for the interface.
h. Run dhcpv6 server pool-name [ allow-hint | preference preference-
value | rapid-commit | unicast ] *
The DHCPv6 PD server function is enabled on the interface.
By default, the DHCPv6 PD server function is disabled in the interface
view.
● Enable the DHCPv6 PD server function in the system view.
a. Run system-view
The system view is displayed.
b. Run dhcp enable
The DHCP service is enabled.
c. Run ipv6
The IPv6 function is enabled globally.
d. (Optional) Run dhcpv6 server { allow-hint | preference preference-value
| rapid-commit | unicast } *
The DHCPv6 PD server function is enabled in the system view.
By default, the DHCPv6 PD server function is disabled in the system view.
When functioning as a DHCPv6 PD server, the device may be configured
with multiple IPv6 address pools. After receiving the DHCPv6 request
packets, the DHCPv6 server chooses the IPv6 PD address pool based on
the following rules:

▪ If a relay exists, choose the address pool in the same link scope with
the configured network prefix (using the link-address command)
based on the first link-address field that is not 0. The link-address
field identifies the link scope of the DHCPv6 clients.

▪ If no relay exists, the DHCPv6 PD server function cannot be enabled


in the system view.
----End

Follow-up Procedure
The uplink interface of the DHCPv6 PD client, namely, the interface connecting to
the DHCPv6 PD server or relay agent, needs to automatically generate global
unicast IPv6 addresses through RA messages and further generate routes destined

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 368


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

for the DHCPv6 PD server. Therefore, the RA message advertisement function


needs to be configured on the interface of the DHCPv6 PD server or relay agent
connected to the uplink interface of the DHCPv6 PD client.
1. Run system-view
The system view is displayed.
2. Run interface interface-type interface-number
The interface view is displayed.
3. Run undo ipv6 nd ra halt
The RA message advertisement function is enabled on the device.
By default, the RA message advertisement function is disabled on a device.

10.7.7 (Optional) Configuring the DHCPv6 Message Rate


Limit and Alarm Function of DHCPv6 Messages Discarded

Context
To prevent clients from sending a large number of messages to attack the device,
the device limits the rate of DHCPv6 messages.
After rate limit of DHCPv6 messages is enabled, the DHCPv6 messages are
discarded when the rate threshold is exceeded. After the alarm function of
DHCPv6 messages discarded is enabled, the device sends alarms when the number
of discarded DHCPv6 messages exceeds the threshold.

Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run dhcpv6 packet-rate packet-rate
Rate limit of DHCPv6 packets is enabled and the rate threshold is configured.
By default, rate limit of DHCPv6 messages is disabled on the switch.
Step 3 Run dhcpv6 packet-rate drop-alarm enable
The alarm function of DHCPv6 messages discarded is enabled on the device.
By default, the alarm function of DHCPv6 messages discarded is disabled.
Step 4 Run dhcpv6 packet-rate drop-alarm threshold threshold
An alarm threshold for the number of discarded DHCPv6 messages when the
DHCPv6 message rate exceeds the rate threshold is set.
By default, the alarm threshold is 100 when the alarm function of DHCPv6
messages discarded is enabled.

----End

10.7.8 Verifying the DHCPv6 PD Server Configuration

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 369


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

Procedure
● Run the display dhcpv6 duid command to check the DUID of the DHCPv6
device on the network.
● Run the display dhcpv6 pool [ pool-name [ allocated { address | prefix } |
binding [ duid ] | conflict address | ipv6-address | ipv6-prefix/prefix-length ] ]
command to check IPv6 address pool configurations.
● Run the display dhcpv6 server [ database | [ statistics ] [ interface
interface-type interface-number ] ] command to check information about the
DHCPv6 server function.

----End

10.8 Configuring a DHCPv6 Relay Agent


Pre-configuration Tasks
A DHCPv6 relay agent enables the DHCPv6 client and server on different links to
exchange DHCPv6 messages. The DHCPv6 relay agent forwards DHCP messages
to the destination DHCPv6 server on a different network segment. DHCPv6 clients
on multiple networks can share one DHCPv6 server.

Before configuring a DHCPv6 relay agent, complete the following tasks:

● Configure the peer DHCPv6 server or DHCPv6 PD server.


● Configure a route from the switch to the DHCPv6 server or DHCPv6 PD server.

10.8.1 Configuring the DHCPv6 DUID

Context
The DUID identifies a DHCPv6 device. Each DHCPv6 server or client has a unique
DUID. DHCPv6 servers use DUIDs to identify DHCPv6 clients and DHCPv6 clients
use DUIDs to identify DHCPv6 servers.

Procedure
Step 1 Run system-view

The system view is displayed.

Step 2 Run dhcpv6 duid { ll | llt | duid }

A DUID is configured for the device.

By default, the device generates a DUID based on the link-layer (LL) address.

----End

10.8.2 Configuring the DHCPv6 Relay Function

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 370


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

Context
The device supports the following methods of configuring the DHCPv6 relay
function:
● Configure an IPv6 address for a DHCPv6 server or next-hop relay agent on an
interface. This method applies to the scenario in which the peer of the
DHCPv6 relay is connected to one DHCPv6 server or next-hop relay agent.
● Bind a DHCPv6 server group to an interface. The detailed procedure is as
follows: Create a DHCPv6 server group in the system view, add IPv6 addresses
of multiple DHCPv6 servers or next-hop relay agents to the DHCPv6 server
group, and specify the DHCPv6 server group for the DHCPv6 relay on an
interface. This method applies to the scenario in which the peer of the
DHCPv6 relay is connected to multiple DHCPv6 servers or next-hop relay
agents. In this way, the DHCPv6 relay can flexibly select and uniformly
manage the DHCPv6 servers or next-hop relay agents.
Multiple DHCPv6 relays can be connected between the DHCPv6 client and server.
If the device functions as a DHCPv6 relay and the peer are connected to the
DHCPv6 server, you must specify the IPv6 address for the DHCPv6 server when
enabling the DHCPv6 relay. If the peer is connected to the next-hop relay agent,
you must specify the IPv6 address for the next-hop relay agent and specify the
IPv6 address for the peer DHCPv6 server or next-hop relay agent on the next-hop
relay agent.

Procedure
● Configure an IPv6 address for a DHCPv6 server or next-hop relay agent on an
interface.
a. Run system-view
The system view is displayed.
b. Run dhcp enable
The DHCP service is enabled.
c. Run ipv6
The IPv6 packet forwarding function is enabled.
d. Run interface interface-type interface-number
The interface view is displayed.
e. (Optional) On an Ethernet interface, run undo portswitch
The interface is switched to Layer 3 mode.
By default, an Ethernet interface works in Layer 2 mode.
f. Run ipv6 enable
The IPv6 packet forwarding function is enabled.
g. Run ipv6 address { ipv6-address prefix-length | ipv6-address/prefix-
length }
The IPv6 address for the interface is configured.
h. Run dhcpv6 relay { destination ipv6-address | interface interface-type
interface-number }

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 371


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

The DHCPv6 relay function is enabled on the interface, and the IPv6
address for the DHCPv6 server or next-hop relay agent is configured.
By default, the DHCPv6 relay function is disabled on an interface.
The configured IPv6 address is a global unicast address or unique local
address. The device finds the route and sends relay packets to the
configured IPv6 address.
If the peer of the DHCPv6 relay is connected to multiple DHCPv6 servers
or next-hop relay agents, you must repeat this step. The device supports a
maximum of eight DHCPv6 servers or next-hop relay agents.
The device supports a maximum of 4094 interfaces with the DHCPv6
relay function enabled.
i. (Optional) Run dhcpv6 relay source-interface interface-type interface-
number
The IPv6 address of an interface is configured as the source IPv6 address
of packets.
By default, the IPv6 address of an interface is not configured as the
source IPv6 address of packets.
Currently, only the IPv6 address of a loopback interface can be configured
as the source IPv6 address of packets.
● Bind a DHCPv6 server group to an interface.
a. Run system-view
The system view is displayed.
b. Run dhcp enable
The DHCP service is enabled.
c. Run ipv6
The IPv6 packet forwarding function is enabled.
d. Run dhcpv6 server group group-name
The DHCPv6 server group is created.
By default, no DHCPv6 server group is created.
e. Run dhcpv6-server ipv6-address [ interface interface-type interface-
number ]
The member address of the DHCPv6 server or next-hop relay agent is
added to the DHCPv6 server group.
By default, no member of the DHCPv6 server or next-hop relay agent is
configured in the DHCPv6 server group.
If the peer of the DHCPv6 relay is connected to multiple DHCPv6 servers
or next-hop relay agents, you must repeat this step. The device supports a
maximum of 20 DHCPv6 servers or next-hop relay agents.
f. Run quit
Return to the system view.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 372


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

g. Run interface interface-type interface-number

The interface view is displayed.


h. (Optional) On an Ethernet interface, run undo portswitch

The interface is switched to Layer 3 mode.

By default, an Ethernet interface works in Layer 2 mode.


i. Run ipv6 enable

The IPv6 packet forwarding function is enabled.


j. Run ipv6 address { ipv6-address prefix-length | ipv6-address/prefix-
length }
The IPv6 address for the interface is configured.
k. Run dhcpv6 relay server-select group-name

The DHCPv6 server group is specified for the DHCPv6 relay.

By default, no DHCPv6 server group is specified.


l. (Optional) Run dhcpv6 relay source-interface interface-type interface-
number
The IPv6 address of an interface is configured as the source IPv6 address
of packets.

By default, the IPv6 address of an interface is not configured as the


source IPv6 address of packets.

Currently, only the IPv6 address of a loopback interface can be configured


as the source IPv6 address of packets.

----End

Follow-up Procedure
When the DHCPv6 relay agent functions as the gateway for clients, you need to
configure the M/O flag of RA messages on the DHCPv6 relay-enabled interface to
make the clients obtain IPv6 addresses or other network configuration parameters
using DHCPv6.

NOTE

After the M flag of RA messages is configured, the clients can obtain IPv6 addresses using
DHCPv6. After the O flag of RA messages is configured, the clients can obtain other network
configuration parameters using DHCPv6.

1. Run system-view
The system view is displayed.
2. Run interface interface-type interface-number
The interface view is displayed.
3. Run undo ipv6 nd ra halt
The RA message advertisement function is enabled on the device.
By default, the RA message advertisement function is disabled on a device.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 373


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

4. Run ipv6 nd autoconfig managed-address-flag


The M flag of stateful address autoconfiguration in an RA message is
configured.
By default, the M flag of stateful address autoconfiguration in an RA message
is not configured.
5. Run ipv6 nd autoconfig other-flag
The O flag of stateful autoconfiguration of other information in an RA
message is configured.
By default, the O flag of stateful autoconfiguration of other information in an
RA message is not configured.

10.8.3 (Optional) Inserting the Interface-ID or Remote-ID


Option Information into DHCPv6 Messages

Context
Some DHCPv6 servers can allocate IPv6 addresses and other network parameters
to clients according to the client location information. The DHCPv6 protocol
defines the Interface-ID option and Remote-ID option that can record the client
location information, including the inbound interface on the device that receives
DHCPv6 Request packets and DUID information of clients. If the device functions
as a DHCPv6 relay agent, the Interface-ID option or Remote-ID option can be
added in DHCPv6 packets.

If the device functions as a DHCPv6 snooping device or a lightweight DHCPv6


relay agent, the client location information can be added in DHCPv6 packets. For
detailed configuration, see Inserting the Option 18 or Option 37 Field in a DHCPv6
Message or Configuring the LDRA to Detect Client Locations in "DHCP Snooping
Configuration" in the S12700 V200R011C10 Configuration Guide - Security.

After DHCPv6 packets are configured to contain the Interface-ID option or


Remote-ID option, the device adds the Interface-ID option or Remote-ID option in
DHCPv6 Request packets sent by clients according to the configuration, constructs
Relay-Forward packets, and sends the packets to the DHCPv6 server. The DHCPv6
server allocates IPv6 addresses and other network parameters to clients according
to the options, and sends Relay-Reply packets to the DHCPv6 relay agent. After
receiving the Relay-Reply packets, the DHCPv6 relay agent removes the Interface-
ID option or Remote-ID option, and forwards the packets to clients or other relay
agents.

Procedure
Step 1 Run system-view

The system view is displayed.

Step 2 (Optional) Run the following commands to configure the format of the Interface-
ID option or Remote-ID option.
1. Run dhcpv6 interface-id format { default | user-defined text }

The Interface-ID option format in DHCPv6 packets is configured.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 374


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

By default, the Interface-ID option format in DHCPv6 packets is default, that


is, %04svlan.%04cvlan.%mac:%portname.
If the user-defined parameter is specified, you can define the option format
using the following defining methods:
– Keyword defining method: You can define the format according to
keywords supported by the self-defined format. For example, you can
define the format as %sysname %svlan when you need to record the
name of the device that users connect to and the outer VLAN that users
belong to. If the name of the device that users connect to is HUAWEI and
the outer VLAN that users belong to is 100, the user location information
recorded in the Interface-ID option is HUAWEI 100.
[HUAWEI] dhcpv6 interface-id format user-defined "%sysname
%svlan"
– Common character string defining method: The Interface-ID option can
be defined as a character string. For example, if all users connected to
the interface are in an office building named N8, you can define the
content of the Interface-ID option as N8.
[HUAWEI] dhcpv6 interface-id format user-defined "N8"
– Mixed defining method: The Interface-ID option format is defined based
on keywords and common character strings. For example, the Interface-
ID option format can be defined as %sysname N8.
[HUAWEI] dhcpv6 interface-id format user-defined "%sysname N8"
2. Run dhcpv6 remote-id format { default | user-defined text }
The Remote-ID option format in DHCPv6 packets is configured.
By default, the Remote-ID option format in DHCPv6 packets is default, that
is, %duid %portname:%04svlan.%04cvlan.
The configuration of the self-defined option format is the same as that of the
Interface-ID option.
By default, the device adds the Interface-ID option in DHCPv6 packets. If the
Remote-ID option needs to be added, run the following commands to enable
the function of adding the Remote-ID option in DHCPv6 packets.
Step 3 Run interface interface-type interface-number
The interface view is displayed.
Step 4 Run dhcpv6 remote-id insert enable or dhcpv6 remote-id rebuild enable
The function of adding the Remote-ID option in DHCPv6 packets is enabled.
By default, the function of adding the Remote-ID option in DHCPv6 packets is
disabled.
Step 5 Run dhcpv6 interface-id insert enable
The function of adding the Interface-ID option in DHCPv6 packets is enabled.
By default, the function of adding the Interface-ID option in DHCPv6 packets is
enabled.

----End

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 375


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

10.8.4 (Optional) Configuring the DHCPv6 Message Rate


Limit and Alarm Function of DHCPv6 Messages Discarded

Context
To prevent clients from sending a large number of messages to attack the device,
the device limits the rate of DHCPv6 messages.
After rate limit of DHCPv6 messages is enabled, the DHCPv6 messages are
discarded when the rate threshold is exceeded. After the alarm function of
DHCPv6 messages discarded is enabled, the device sends alarms when the number
of discarded DHCPv6 messages exceeds the threshold.

Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run dhcpv6 packet-rate packet-rate
Rate limit of DHCPv6 packets is enabled and the rate threshold is configured.
By default, rate limit of DHCPv6 messages is disabled on the switch.
Step 3 Run dhcpv6 packet-rate drop-alarm enable
The alarm function of DHCPv6 messages discarded is enabled on the device.
By default, the alarm function of DHCPv6 messages discarded is disabled.
Step 4 Run dhcpv6 packet-rate drop-alarm threshold threshold
An alarm threshold for the number of discarded DHCPv6 messages when the
DHCPv6 message rate exceeds the rate threshold is set.
By default, the alarm threshold is 100 when the alarm function of DHCPv6
messages discarded is enabled.

----End

10.8.5 Verifying the DHCPv6 Relay Agent Configuration


Procedure
● Run the display dhcpv6 relay [ interface interface-type interface-
number ]command to check the configuration of the interface enabled with
the DHCPv6 relay function.
● Run the display dhcpv6 server group [ group-name ] command to check the
configuration of the DHCPv6 server group.
● Run the display dhcpv6 relay statistics [ interface interface-type interface-
number ] command to check the packet statistics of the DHCPv6 relay agent
function.
----End

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 376


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

10.9 Configuring a DHCPv6 Client


Pre-configuration Tasks
When the DHCPv6 client function is configured on the device, the device
dynamically obtains IPv6 addresses and other network configuration parameters
from the DHCPv6 server.
Before configuring the DHCPv6 client function, complete the following tasks:
● Configure a DHCPv6 server.
● Configure the DHCPv6 relay agent as service requires.
● Configure the switch between the router and DHCPv6 relay agent or server.

10.9.1 Enabling the DHCPv6 Client Function

Context
When the DHCPv6 client function is configured on the switch, the switch
dynamically obtains IPv6 addresses and other configuration parameters from the
DHCPv6 server. This operation facilitates user configurations and management.

Procedure
Step 1 Configure IPv6 functions on interfaces.
1. Run system-view
The system view is displayed.
2. Run ipv6
The device is enabled to forward IPv6 unicast packets.
By default, the device is disabled from forwarding IPv6 unicast packets.
3. Run interface interface-type interface-number
The interface view is displayed.
4. (Optional) On an Ethernet interface, run undo portswitch
The interface is switched to Layer 3 mode.
By default, an Ethernet interface works in Layer 2 mode.
5. Run ipv6 enable
IPv6 is enabled on the interface.
By default, IPv6 is disabled on an interface.
6. Run ipv6 address auto link-local or ipv6 address ipv6-address link-local
The link-local address is configured automatically or manually on the
interface.
By default, no link-local address is configured for an interface.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 377


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

Step 2 Configure the DHCPv6 client to request an IPv6 address


1. Run system-view
The system view is displayed.
2. Run dhcpv6 duid { ll | llt | duid }
A DUID is configured for the device.
By default, the device generates a DUID based on the link-layer (LL) address.
3. Run interface interface-type interface-number
The interface view is displayed.
4. Configure the DHCPv6 client function.
A DHCPv6 client can obtain an IPv6 address in DHCPv6 stateful mode and
DHCPv6 stateless mode. For details, see IPv6 Address Allocation Methods in
DHCPv6 Overview.
– DHCPv6 stateful mode: Run ipv6 address auto dhcp [ hint ipv6-
address ] [ rapid-commit ] [ unicast-option ]
The DHCPv6 client is enabled to obtain an IPv6 address and other
network configuration parameters including the IPv6 addresses of the
DNS and SNTP servers using the stateful DHCPv6 address
autoconfiguration mode.
– DHCPv6 stateless mode: Run dhcpv6 client information-request
The DHCPv6 client is enabled to obtain network configuration
parameters (excluding IPv6 addresses) using the stateless DHCPv6
address autoconfiguration mode.
By default, stateless or stateful DHCPv6 address autoconfiguration is not
configured on an interface to assign IPv6 addresses and other network
configuration parameters.

NOTE

The service can use the two-message exchange method to assign IPv6 addresses and other
network configuration parameters to clients only when two-message exchange is enabled
on the DHCPv6 clients and server. Otherwise, the server assigns IPv6 addresses and other
network configuration parameters to the clients using the four-message exchange method.
To modify the DHCPv6 address autoconfiguration mode, you must disable the original
mode. For example, the DHCPv6 client is enabled to use the stateful DHCPv6 address
autoconfiguration mode to obtain an IPv6 address and other network configuration
parameters including the IPv6 addresses of the DNS and SNTP servers. To enable the
DHCPv6 client to use the stateless DHCPv6 address autoconfiguration mode to obtain
network configuration parameters (excluding IPv6 addresses), run the undo ipv6 address
auto dhcp command to disable stateful DHCPv6 address autoconfiguration and then run
the dhcpv6 client information-request command to enable stateless DHCPv6 address
autoconfiguration.
5. Run ipv6 address auto global default
The device is enabled to automatically generate global unicast IPv6 addresses
through stateless autoconfiguration or learn the default route destined for the
IPv6 gateway.
By default, a device is disabled from automatically generating global unicast
IPv6 addresses through stateless autoconfiguration or learning the default
route destined for the IPv6 gateway.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 378


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

NOTE

The DHCPv6 server does not allocate the IPv6 gateway address to any DHCPv6 client.
When the DHCPv6 stateful mode is configured, the DHCPv6 client learns the default route
destined for the IPv6 gateway using this command. When the DHCPv6 stateless mode is
configured, the DHCPv6 client learns the global unicast IPv6 address and the default route
destined for the IPv6 gateway using this command.
Ensure that the RA message advertisement function has been configured on the
interconnected interface of the remote device using the undo ipv6 nd ra halt command.
6. (Optional) Run dhcpv6 client renew
IPv6 addresses and prefixes allocated to DHCPv6 clients are manually
updated.

----End

Verifying the Configuration


● Run the display dhcpv6 client [ interface interface-type interface-number ]
command to check the DHCPv6 client configurations.

10.9.2 (Optional) Configuring the DHCPv6 Message Rate


Limit and Alarm Function of DHCPv6 Messages Discarded

Context
To prevent clients from sending a large number of messages to attack the device,
the device limits the rate of DHCPv6 messages.
After rate limit of DHCPv6 messages is enabled, the DHCPv6 messages are
discarded when the rate threshold is exceeded. After the alarm function of
DHCPv6 messages discarded is enabled, the device sends alarms when the number
of discarded DHCPv6 messages exceeds the threshold.

Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run dhcpv6 packet-rate packet-rate
Rate limit of DHCPv6 packets is enabled and the rate threshold is configured.
By default, rate limit of DHCPv6 messages is disabled on the switch.
Step 3 Run dhcpv6 packet-rate drop-alarm enable
The alarm function of DHCPv6 messages discarded is enabled on the device.
By default, the alarm function of DHCPv6 messages discarded is disabled.
Step 4 Run dhcpv6 packet-rate drop-alarm threshold threshold
An alarm threshold for the number of discarded DHCPv6 messages when the
DHCPv6 message rate exceeds the rate threshold is set.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 379


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

By default, the alarm threshold is 100 when the alarm function of DHCPv6
messages discarded is enabled.

----End

10.10 Configuring a DHCPv6 PD Client


Pre-configuration Tasks
When the DHCPv6 PD client function is configured on the device, the device
dynamically obtains IPv6 address prefix and other network configuration
parameters from the DHCPv6 PD server.
Before configuring the DHCPv6 PD client function, complete the following tasks:
● Configure a DHCPv6 PD server.
● Configure the DHCPv6 relay agent as service requires.
● Configure the switch between the router and DHCPv6 relay agent or PD
server.

10.10.1 Enabling the DHCPv6 PD Client Function

Context
When the uplink interface of the device is configured as the DHCPv6 PD client, the
client uses the DHCPv6 protocol to dynamically obtain an IPv6 address prefix from
the DHCPv6 PD server. The downlink interface is bound to the obtained IPv6
address prefix, so that the IPv6 address can be automatically generated for the
user in route advertising mode.

Procedure
Step 1 Configure the IPv6 function on the uplink interface.
1. Run system-view
The system view is displayed.
2. Run ipv6
The device is enabled to forward IPv6 unicast packets.
By default, the device is disabled from forwarding IPv6 unicast packets.
3. Run interface interface-type interface-number
The interface view is displayed.
4. (Optional) On an Ethernet interface, run undo portswitch
The interface is switched to Layer 3 mode.
By default, an Ethernet interface works in Layer 2 mode.
5. Run ipv6 enable
IPv6 is enabled on the interface.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 380


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

By default, IPv6 is disabled on an interface.


6. Configure a global unicast IPv6 address manually or automatically.
– Manually configuring a global unicast IPv6 address:
Run the ipv6 address { ipv6-address prefix-length |ipv6-address/prefix-
length } command to configure the global unicast IPv6 address for the
interface.
– Automatically generating a global unicast IPv6 address:
i. Run the ipv6 address auto link-local or ipv6 address ipv6-address
link-local command to automatically or manually configure the link-
local address on the interface.
By default, no link-local address is configured for an interface.
ii. Run the ipv6 address auto global [ default ] command to enable
the function of automatically generating global unicast IPv6
addresses through stateless autoconfiguration.
By default, the device is disabled from automatically generating
global unicast IPv6 addresses through stateless autoconfiguration.

Step 2 Configure the DHCPv6 PD client on the uplink interface.


1. Run system-view

The system view is displayed.


2. Run dhcpv6 duid { ll | llt | duid }

A DUID is configured for the device.

By default, the device generates a DUID based on the link-layer (LL) address.
3. Run interface interface-type interface-number

The interface view is displayed.


4. Run dhcpv6 client pd prefix-name [ hint ipv6-prefix/ipv6-prefix-length ]
[ rapid-commit ] [ unicast-option ] or dhcpv6 client dhcp [ hint ipv6-
address ] pd prefix-name [ hint ipv6-prefix/ipv6-prefix-length ] [ rapid-
commit ] [ unicast-option ] union-mode

The DHCPv6 PD client is enabled.

By default, the DHCPv6 PD client is disabled.

You can specify the rapid-commit parameter to set the DHCPv6 PD client to
request an IPv6 address prefix using the two-message exchange. The service
can use two-message exchange to assign IPv6 address prefix to client only
when two-message exchange is enabled on the DHCPv6 PD client and server.
Otherwise, the server assigns IPv6 address prefix to the client using the four-
message exchange method.

----End

Verifying the Configuration


Run the display dhcpv6 client prefix [ name prefix-name ] command to check
the IPv6 address prefix on the device that functions as the DHCPv6 PD client.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 381


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

Follow-up Procedure
Bind the downlink interface to the obtained IPv6 address prefix and enable the
downlink interface to send RA packets, so that the IPv6 address can be
automatically generated for the user in route advertising mode.
1. Run the system-view command to enter the system view.
2. Run the interface interface-type interface-number command to enter the
interface view.
3. (Optional) On an Ethernet interface, run undo portswitch
The interface is switched to Layer 3 mode.
By default, an Ethernet interface works in Layer 2 mode.
4. Run the ipv6 enable command to enable the IPv6 function on the interface.
By default, the IPv6 function is disabled on an interface.
5. Run the ipv6 address auto link-local or ipv6 address ipv6-address link-local
command to automatically or manually configure the link-local address on
the interface.
By default, no link-local address is configured for an interface.
6. Run the ipv6 address dhcpv6-prefix { ipv6-address prefix-length | ipv6-
address/prefix-length } command to bind the interface to the IPv6 address
prefix obtained by the DHCPv6 PD client.
By default, the interface is not bound to the IPv6 address prefix obtained by
the DHCPv6 PD client.
The value of prefix-length for the IPv6 address prefix bound to the interface
must be greater than the length of the prefix obtained by the DHCPv6 PD
client; otherwise, the interface cannot generate the global unicast IPv6
address based on the bound IPv6 address prefix and record the log DHCP/4/
PREF_LENCHK.
You can run the display dhcpv6 client prefix [ name prefix-name ]
command to check the length of the prefix obtained by the DHCPv6 PD client.
7. Run the undo ipv6 nd ra halt command to enable the interface to send RA
packets.
By default, the interface is disabled from sending RA packets.

10.10.2 (Optional) Configuring the DHCPv6 Message Rate


Limit and Alarm Function of DHCPv6 Messages Discarded

Context
To prevent clients from sending a large number of messages to attack the device,
the device limits the rate of DHCPv6 messages.

After rate limit of DHCPv6 messages is enabled, the DHCPv6 messages are
discarded when the rate threshold is exceeded. After the alarm function of
DHCPv6 messages discarded is enabled, the device sends alarms when the number
of discarded DHCPv6 messages exceeds the threshold.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 382


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run dhcpv6 packet-rate packet-rate
Rate limit of DHCPv6 packets is enabled and the rate threshold is configured.
By default, rate limit of DHCPv6 messages is disabled on the switch.
Step 3 Run dhcpv6 packet-rate drop-alarm enable
The alarm function of DHCPv6 messages discarded is enabled on the device.
By default, the alarm function of DHCPv6 messages discarded is disabled.
Step 4 Run dhcpv6 packet-rate drop-alarm threshold threshold
An alarm threshold for the number of discarded DHCPv6 messages when the
DHCPv6 message rate exceeds the rate threshold is set.
By default, the alarm threshold is 100 when the alarm function of DHCPv6
messages discarded is enabled.

----End

10.11 Maintaining DHCPv6

10.11.1 Monitoring DHCPv6 Operation


Procedure
● Run the display dhcpv6 statistics command to check statistics on DHCPv6
packets.
● Run the display dhcpv6 server [ database | [ statistics ] [ interface
interface-type interface-number ] ] command to check information about the
DHCPv6 server function.
● Run the display dhcpv6 relay [ interface interface-type interface-number ]
command to check the configuration of the interface where the DHCPv6 relay
function is configured.
● Run the display dhcpv6 relay statistics [ interface interface-type interface-
number ] command to check DHCPv6 packet statistics on the DHCPv6 relay.
● Run the display dhcpv6 client statistics [ interface interface-type interface-
number ] command to check packet statistics on the DHCPv6 client.
● Run the display dhcpv6 client prefix [ name prefix-name ] command to
check the IPv6 address prefix obtained by the DHCPv6 client.
----End

10.11.2 Clearing DHCPv6 Packet Statistics

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 383


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

Context

NOTICE

The DHCPv6 packet statistics cannot be restored after being cleared.

Procedure
● Run the reset dhcpv6 server statistics [ interface interface-type interface-
number ] command to clear packet statistics of the DHCPv6 server.
● Run the reset dhcpv6 relay statistics [ interface interface-type interface-
number ] command to clear packet statistics of the DHCPv6 relay agent.
● Run the reset dhcpv6 client statistics [ interface interface-type interface-
number ] command to clear packet statistics of the DHCPv6 clients.
● Run the reset dhcpv6 statistics command to clear statistics on DHCPv6
packets.
----End

10.11.3 Resetting the Status of the IPv6 Address Pool


Context
When the client addresses conflict due to repeated IPv6 address assignment or
IPv6 addresses need to be re-assigned to clients based on the network plan, you
can reset the status of the IPv6 address pool. In this way, the IPv6 addresses in the
address pool return to the idle state and the clients can re-apply for these IPv6
addresses.

Procedure
● Run the reset dhcpv6 pool pool-name [ allocated { address | prefix } |
binding [ duid ] | conflict address | ipv6-address [ to ipv6-address ] | ipv6-
prefix/prefix-length ] command to clear IPv6 address pool configurations.
----End

10.12 Configuration Examples for DHCPv6

10.12.1 Example for Configuring the DHCPv6 Server and


Client (DHCPv6 Stateful Mode)
Networking Requirements
As shown in Figure 10-15, SwitchA and SwitchB are located on the same link.
SwitchA is deployed as the DHCPv6 server and SwitchB is deployed as the DHCPv6
client to enable SwitchB to obtain an IPv6 address and DNS server address
through the DHCPv6 server.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 384


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

Figure 10-15 Networking diagram for configuring the DHCPv6 server and client
DNS Server
fc00:4::1
VLAN100
VLAN100 fc00:3::1/64
GE1/0/1 GE1/0/1
Internet

SwitchB SwitchA
DHCPv6 Client DHCPv6 Server

Configuration Roadmap
The configuration roadmap is as follows:
1. On SwitchA, configure the DHCPv6 server function so that the DHCPv6 server
can dynamically assign the IPv6 address and DNS server address to the
DHCPv6 client. Configure IPv6 addresses for interfaces, configure an IPv6
address pool, and enable the DHCPv6 server function on the interfaces.
2. On SwitchB, configure the DHCPv6 client function so that the DHCPv6 client
can dynamically obtain the IPv6 address and DNS server address through the
DHCPv6 server. Configure the IPv6 function and enable the DHCPv6 client
function on the interfaces.

NOTE

Ensure that the DHCPv6 and DNS servers are routable to each other before the configuration.

Procedure
Step 1 Configure the DHCPv6 server function on SwitchA.

# Configure an IPv6 address for the interface.


<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] ipv6
[SwitchA] vlan 100
[SwitchA-vlan100] quit
[SwitchA] interface gigabitethernet 1/0/1
[SwitchA-GigabitEthernet1/0/1] port link-type trunk
[SwitchA-GigabitEthernet1/0/1] port trunk allow-pass vlan 100
[SwitchA-GigabitEthernet1/0/1] quit
[SwitchA] interface vlanif 100
[SwitchA-Vlanif100] ipv6 enable
[SwitchA-Vlanif100] ipv6 address fc00:3::1/64
[SwitchA-Vlanif100] quit

# Configure an IPv6 address pool.


[SwitchA] dhcpv6 pool pool1
[SwitchA-dhcpv6-pool-pool1] address prefix fc00:3::/64
[SwitchA-dhcpv6-pool-pool1] excluded-address fc00:3::1
[SwitchA-dhcpv6-pool-pool1] dns-server fc00:4::1
[SwitchA-dhcpv6-pool-pool1] quit

# Enable the DHCPv6 server function on the interface.


[SwitchA] dhcp enable
[SwitchA] interface vlanif 100
[SwitchA-Vlanif100] dhcpv6 server pool1

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 385


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

# Enable the RA message advertisement function to make the DHCPv6 client learn
the default route destined for the IPv6 gateway through RA messages. Configure
the M and O flags of the advertised RA messages to make the DHCPv6 client
obtain an IPv6 address and other network parameters using DHCP.
[SwitchA-Vlanif100] undo ipv6 nd ra halt
[SwitchA-Vlanif100] ipv6 nd autoconfig managed-address-flag
[SwitchA-Vlanif100] ipv6 nd autoconfig other-flag
[SwitchA-Vlanif100] quit
[SwitchA] quit

Step 2 Configure the DHCPv6 client function on SwitchB.


# Configure the IPv6 function on the interface.
<HUAWEI> system-view
[HUAWEI] sysname SwitchB
[SwitchB] ipv6
[SwitchB] vlan 100
[SwitchB-vlan100] quit
[SwitchB] interface gigabitethernet 1/0/1
[SwitchB-GigabitEthernet1/0/1] port link-type trunk
[SwitchB-GigabitEthernet1/0/1] port trunk allow-pass vlan 100
[SwitchB-GigabitEthernet1/0/1] quit
[SwitchB] interface vlanif 100
[SwitchB-Vlanif100] ipv6 enable
[SwitchB-Vlanif100] ipv6 address auto link-local

# Enable the DHCPv6 client function on the interface.


[SwitchB-Vlanif100] ipv6 address auto dhcp

# Configure the DHCPv6 client to learn the default route destined for the IPv6
gateway through RA messages.
[SwitchB-Vlanif100] ipv6 address auto global default
[SwitchB-Vlanif100] quit
[SwitchB] quit

Step 3 Verify the configuration.


# On SwitchA, run the display dhcpv6 pool command to check the configuration
and address assignment of the IPv6 address pool pool1.
<SwitchA> display dhcpv6 pool pool1
DHCPv6 pool: pool1
Address prefix: FC00:3::/64
Lifetime valid 172800 seconds, preferred 86400 seconds
1 in use, 0 conflicts
excluded-address FC00:3::1
1 excluded addresses
Information refresh time: 86400
DNS server address: FC00:4::1
conflict-address expire-time: 172800
renew-time-percent : 50
rebind-time-percent : 80
Active normal clients: 1
<SwitchA> display dhcpv6 pool pool1 allocated address
Address Valid Expires Left
-------------------------------------------------------------------------------
FC00:3::2 172800 2014-03-29 05:47:19 159594
-------------------------------------------------------------------------------
Total : 1

# On SwitchA, run the display ipv6 interface vlanif 100 command to check the
IPv6 link-local address of VLANIF 100, so that you can further check whether the
default route destined for the IPv6 gateway is generated on the DHCPv6 client.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 386


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

<SwitchA> display ipv6 interface vlanif 100


Vlanif100 current state : UP
IPv6 protocol current state : UP
IPv6 is enabled, link-local address is
FE80::2EAB:FF:FE98:15BB
Global unicast address(es):
FC00:3::1, subnet is FC00:3::/64
Joined group address(es):
FF02::1:2
FF02::1:FF00:1
FF02::1:FF98:15BB
FF02::2
FF02::1
……

# On SwitchB, run the display dhcpv6 client command to check the DHCPv6
client configuration.
<SwitchB> display dhcpv6 client
Vlanif100 is in stateful DHCPv6 client mode.
Stateful DHCPv6 client is in BOUND state.
Preferred server DUID : 00030001000B099C1162
Reachable via address : FE80::20B:9FF:FE03:AC9B
IA NA IA ID 0x000004E1 T1 43200 T2 69120
Obtained : 2014-03-26 17:47:15
Renews : 2014-03-27 05:47:15
Rebinds : 2014-03-27 12:59:15
Address : FC00:3::2
Lifetime valid 172800 seconds, preferred 86400 seconds
Expires at 2014-03-28 17:47:15(172726 seconds left)
DNS server : FC00:4::1

# On SwitchB, run the display ipv6 routing-table command to check the default
route destined for the IPv6 gateway on the DHCPv6 client.
<SwitchB> display ipv6 routing-table
Routing Table : Public
Destinations : 4 Routes : 4

Destination : :: PrefixLength : 0
NextHop : FE80::2EAB:FF:FE98:15BB Preference : 64
Cost :0 Protocol : Unr
RelayNextHop : :: TunnelID : 0x0
Interface : Vlanif100 Flags :D

Destination : ::1 PrefixLength : 128


NextHop : ::1 Preference : 0
Cost :0 Protocol : Direct
RelayNextHop : :: TunnelID : 0x0
Interface : InLoopBack0 Flags :D

Destination : FC00:3::2 PrefixLength : 128


NextHop : ::1 Preference : 0
Cost :0 Protocol : Direct
RelayNextHop : :: TunnelID : 0x0
Interface : Vlanif100 Flags :D

Destination : FE80:: PrefixLength : 10


NextHop : :: Preference : 0
Cost :0 Protocol : Direct
RelayNextHop : :: TunnelID : 0x0
Interface : NULL0 Flags :D

----End

Configuration Files
● SwitchA configuration file

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 387


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

#
sysname SwitchA
#
ipv6
#
vlan batch 100
#
dhcp enable
#
dhcpv6 pool pool1
address prefix FC00:3::/64
excluded-address FC00:3::1
dns-server FC00:4::1
#
interface Vlanif100
ipv6 enable
ipv6 address FC00:3::1/64
undo ipv6 nd ra halt
ipv6 nd autoconfig managed-address-
flag
ipv6 nd autoconfig other-flag
dhcpv6 server pool1
#
interface GigabitEthernet1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
return

● SwitchB configuration file


#
sysname SwitchB
#
ipv6
#
vlan batch 100
#
interface Vlanif100
ipv6 enable
ipv6 address auto link-local
ipv6 address auto global default
ipv6 address auto dhcp
#
interface GigabitEthernet1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
return

10.12.2 Example for Configuring the DHCPv6 Server and


Client (DHCPv6 Stateless Mode)
Networking Requirements
As shown in Figure 10-16, SwitchA and SwitchB are located on the same link.
SwitchA is deployed as the DHCPv6 server and SwitchB is deployed as the DHCPv6
client to enable SwitchB to obtain an IPv6 address through route advertisement
and obtain the DNS server address through the DHCPv6 server.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 388


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

Figure 10-16 Networking diagram for configuring the DHCPv6 server and client
DNS Server
fc00:4::1

VLAN100 VLANIF100 Internet


GE1/0/1 fc00:3::1/64

GE1/0/1
SwitchB SwitchA
DHCPv6 Client DHCPv6 Server

Configuration Roadmap
The configuration roadmap is as follows:
1. Configure the DHCPv6 server function on SwitchA, so that IPv6 addresses can
be assigned to clients through route advertisement and DNS server addresses
can be assigned to clients through the DHCPv6 server.
2. Configure the DHCPv6 client function on SwitchB, so that the DHCPv6 client
can obtain an IPv6 address through route advertisement and obtain the DNS
server address through the DHCPv6 server.

NOTE

Ensure that the DHCPv6 and DNS servers are routable to each other before the configuration.

Procedure
Step 1 Configure the DHCPv6 server function on SwitchA.
# Configure an IPv6 address for the interface.
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] ipv6
[SwitchA] vlan 100
[SwitchA-vlan100] quit
[SwitchA] interface gigabitethernet 1/0/1
[SwitchA-GigabitEthernet1/0/1] port link-type access
[SwitchA-GigabitEthernet1/0/1] port default vlan 100
[SwitchA-GigabitEthernet1/0/1] quit
[SwitchA] interface vlanif 100
[SwitchA-Vlanif100] ipv6 enable
[SwitchA-Vlanif100] ipv6 address fc00:3::1/64
[SwitchA-Vlanif100] quit

# Configure an IPv6 address pool.


[SwitchA] dhcp enable
[SwitchA] dhcpv6 pool pool1
[SwitchA-dhcpv6-pool-pool1] dns-server fc00:4::1
[SwitchA-dhcpv6-pool-pool1] quit

# Configure the client to obtain an IPv6 address through route advertisement and
obtain other network parameters through the DHCPv6 server.
[SwitchA] interface vlanif 100
[SwitchA-Vlanif100] undo ipv6 nd ra halt
[SwitchA-Vlanif100] ipv6 nd autoconfig other-flag
[SwitchA-Vlanif100] dhcpv6 server pool1

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 389


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

[SwitchA-Vlanif100] quit
[SwitchA] quit

Step 2 Configure the DHCPv6 client function on SwitchB.


<HUAWEI> system-view
[HUAWEI] sysname SwitchB
[SwitchB] ipv6
[SwitchB] vlan 100
[SwitchB-vlan100] quit
[SwitchB] interface gigabitethernet 1/0/1
[SwitchB-GigabitEthernet1/0/1] port link-type access
[SwitchB-GigabitEthernet1/0/1] port default vlan 100
[SwitchB-GigabitEthernet1/0/1] quit
[SwitchB] interface vlanif 100
[SwitchB-Vlanif100] ipv6 enable
[SwitchB-Vlanif100] ipv6 address auto global default
[SwitchB-Vlanif100] dhcpv6 client information-request

Step 3 Verify the configuration.


# On SwitchA, run the display dhcpv6 pool command to check the configuration
of the IPv6 address pool pool1.
<SwitchA> display dhcpv6 pool pool1
DHCPv6 pool: pool1
Information refresh time: 86400
DNS server address: FC00:4::1
conflict-address expire-time: 172800
renew-time-percent : 50
rebind-time-percent : 80

# On SwitchA, run the display ipv6 interface vlanif 100 command to check the
IPv6 link-local address of VLANIF 100, so that you can further check whether the
default route destined for the IPv6 gateway is generated on the DHCPv6 client.
<SwitchA> display ipv6 interface vlanif 100
Vlanif100 current state : UP
IPv6 protocol current state : UP
IPv6 is enabled, link-local address is
FE80::2EAB:FF:FE98:15BB
Global unicast address(es):
FC00:3::1, subnet is FC00:3::/64
Joined group address(es):
FF02::1:2
FF02::1:FF00:1
FF02::1:FF98:15BB
FF02::2
FF02::1
……

# On SwitchB, run the display dhcpv6 client command to check the DHCPv6
client configuration.
<SwitchB> display dhcpv6 client interface vlanif 100
Vlanif100 is in stateless DHCPv6 client mode.
Stateless DHCPv6 client is in OPEN state.
Preferred server DUID :
000300012CAB009815B0
Reachable via address : FE80::2EAB:FF:FE98:15BB
Infomation refresh time is 86400 seconds
DNS server : FC00:4::1

# On SwitchB, run the display ipv6 interface Vlanif 100 command to check the
IPv6 configuration information about VLANIF 100.
<SwitchB> display ipv6 interface vlanif 100
Vlanif100 current state : UP
IPv6 protocol current state : UP

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 390


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

IPv6 is enabled, link-local address is FE80::865B:


12FF:FE36:595B
Global unicast address(es):
FC00:3::865B:12FF:FE36:595B,
subnet is FC00:3::/64 [SLAAC 2018-11-16 10:16:06
2592000S]
Joined group address(es):
FF02::1:FF36:595B
FF02::2
FF02::1 ……

# On SwitchB, run the display ipv6 routing-table command to check the


generated default route destined for the IPv6 gateway on the DHCPv6 client.
<SwitchB> display ipv6 routing-table
Routing Table : Public
Destinations : 5 Routes : 5

Destination : :: PrefixLength : 0
NextHop : FE80::2EAB:FF:FE98:15BB Preference : 64
Cost :0 Protocol : Unr
RelayNextHop : :: TunnelID : 0x0
Interface : Vlanif100 Flags :D

Destination : ::1 PrefixLength : 128


NextHop : ::1 Preference : 0
Cost :0 Protocol : Direct
RelayNextHop : :: TunnelID : 0x0
Interface : InLoopBack0 Flags :D

Destination : FC00:3:: PrefixLength : 64


NextHop : FC00:3::865B:12FF:FE36:595B Preference : 0
Cost :0 Protocol : Direct
RelayNextHop : :: TunnelID : 0x0
Interface : Vlanif100 Flags :D

Destination : FC00:3::865B:12FF:FE36:595B PrefixLength :


128
NextHop : ::1 Preference : 0
Cost :0 Protocol : Direct
RelayNextHop : :: TunnelID : 0x0
Interface : Vlanif100 Flags :D

Destination : FE80:: PrefixLength : 10


NextHop : :: Preference : 0
Cost :0 Protocol : Direct
RelayNextHop : :: TunnelID : 0x0
Interface : NULL0 Flags :D

----End

Configuration Files
● SwitchA configuration file
#
sysname SwitchA
#
ipv6
#
vlan batch 100
#
dhcp enable
#
dhcpv6 pool pool1
dns-server FC00:4::1
#
interface Vlanif100
ipv6 enable
ipv6 address FC00:3::1/64

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 391


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

undo ipv6 nd ra halt


ipv6 nd autoconfig other-flag
dhcpv6 server pool1
#
interface GigabitEthernet1/0/1
port link-type access
port default vlan 100
#
return

● SwitchB configuration file


#
sysname SwitchB
#
ipv6
#
vlan batch 100
#
interface Vlanif100
ipv6 enable
ipv6 address auto global default
dhcpv6 client information-request
#
interface GigabitEthernet1/0/1
port link-type access
port default vlan 100
#
return

10.12.3 Example for Configuring the DHCPv6 PD Server and


Client
Networking Requirements
As shown in Figure 10-17, SwitchA and SwitchB are located on the same link;
SwitchB functions as the gateway of hosts PC1 to PCn and is connected to these
hosts through interfaces GE2/0/1 to GE2/0/n. SwitchA is deployed as the DHCPv6
PD server and SwitchB is deployed as the DHCPv6 PD client. Hosts PC1 to PCn
automatically generate IPv6 addresses by advertising routes based on the IPv6
address prefix obtained by the DHCPv6 PD client. This implements hierarchical
deployment of host IPv6 addresses.

Figure 10-17 Networking diagram for configuring the DHCPv6 PD server and
client
SwitchB VLAN100 VLAN100 SwitchA
GE1/0/1 fc00:3::1/64
DHCPv6 PD Client
GE1/0/1
VLAN200 DHCPv6 PD Server
GE2/0/1 to GE2/0/n

……
PC1 PC2 PCn

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 392


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

Configuration Roadmap
The configuration roadmap is as follows:
1. Configure the DHCPv6 PD server function on SwitchA to dynamically assign
IPv6 address prefixes to the DHCPv6 PD client. Configure IPv6 addresses for
interfaces, configure an IPv6 address pool, and enable the DHCPv6 PD server
function on the interfaces.
2. Configure the DHCPv6 PD client function on SwitchB to dynamically obtain
IPv6 address prefixes from the DHCPv6 PD server. Configure the IPv6 function
and enable the DHCPv6 client function on the interfaces.
3. Bind the obtained IPv6 address prefix to the downlink interface of SwitchB so
that hosts PC1 to PCn can automatically generate IPv6 addresses by
advertising routes.
4. Configure hosts PC1 to PCn to automatically obtain IPv6 addresses.

NOTE

Hosts connected to a DHCPv6 PD client can reside on multiple network segments. For example,
the length of the prefix obtained by the DHCPv6 PD client in this example is 63. The hosts then
can be divided into two network segments ::0:0:0:0:1/64 and ::1:0:0:0:1/64. You can run the ipv6
address myprefix ::0:0:0:0:1/64 command on the Layer 3 interface connected to the hosts that
reside on ::0:0:0:0:1/64 and run the ipv6 address myprefix ::1:0:0:0:1/64 command on the Layer
3 interface connected to the hosts that reside on ::1:0:0:0:1/64.

Procedure
Step 1 Configure the DHCPv6 PD server function on SwitchA.
# Configure an IPv6 address for the interface.
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] ipv6
[SwitchA] vlan 100
[SwitchA-vlan100] quit
[SwitchA] interface gigabitethernet 1/0/1
[SwitchA-GigabitEthernet1/0/1] port link-type trunk
[SwitchA-GigabitEthernet1/0/1] port trunk allow-pass vlan 100
[SwitchA-GigabitEthernet1/0/1] quit
[SwitchA] interface vlanif 100
[SwitchA-Vlanif100] ipv6 enable
[SwitchA-Vlanif100] ipv6 address fc00:3::1/64
[SwitchA-Vlanif100] quit

# Configure an IPv6 PD address pool.


[SwitchA] dhcpv6 pool pool1
[SwitchA-dhcpv6-pool-pool1] prefix-delegation fc00:2::/60 63
[SwitchA-dhcpv6-pool-pool1] quit

# Enable the DHCPv6 PD server function on the interface.


[SwitchA] dhcp enable
[SwitchA] interface vlanif 100
[SwitchA-Vlanif100] dhcpv6 server pool1
[SwitchA-Vlanif100] undo ipv6 nd ra halt
[SwitchA-Vlanif100] quit

# Configure an IPv6 static route destined for the network segment FC00:2:: where
the hosts reside and set the next-hop IPv6 address to the global IPv6 unicast
address FC00:3::865B:12FF:FE36:595B of the interconnected interface.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 393


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

[SwitchA] ipv6 route-static FC00:2:: 64 vlanif100 FC00:3::865B:12FF:FE36:595B

Step 2 Configure the DHCPv6 PD client function on SwitchB.


# Configure the IPv6 function on the interface.
<HUAWEI> system-view
[HUAWEI] sysname SwitchB
[SwitchB] ipv6
[SwitchB] vlan 100
[SwitchB-vlan100] quit
[SwitchB] interface gigabitethernet 1/0/1
[SwitchB-GigabitEthernet1/0/1] port link-type trunk
[SwitchB-GigabitEthernet1/0/1] port trunk allow-pass vlan 100
[SwitchB-GigabitEthernet1/0/1] quit
[SwitchB] interface vlanif 100
[SwitchB-Vlanif100] ipv6 enable
[SwitchB-Vlanif100] ipv6 address auto link-local
[SwitchB-Vlanif100] ipv6 address auto global

# Enable the DHCPv6 PD client function on the interface.


[SwitchB-Vlanif100] dhcpv6 client pd myprefix
[SwitchB-Vlanif100] quit

Step 3 Bind the obtained IPv6 address prefixes on SwitchB. Take the configurations on
GE2/0/1 as an example. The configurations on other interfaces are similar to the
configurations on GE2/0/1, and are not mentioned here.
[SwitchB] vlan 200
[SwitchB-vlan200] quit
[SwitchB] interface gigabitethernet 2/0/1
[SwitchB-GigabitEthernet2/0/1] port link-type access
[SwitchB-GigabitEthernet2/0/1] port default vlan 200
[SwitchB-GigabitEthernet2/0/1] quit
[SwitchB] interface vlanif 200
[SwitchB-Vlanif200] ipv6 enable
[SwitchB-Vlanif200] ipv6 address auto link-local
[SwitchB-Vlanif200] ipv6 address myprefix ::1/64
[SwitchB-Vlanif200] undo ipv6 nd ra halt
[SwitchB-Vlanif200] quit

Step 4 Configure PC1 to automatically obtain an IPv6 address (using Windows 7 as an


example). The configurations on other hosts are the same as the configurations
on PC1.
1. Right-click Network on the desktop and choose Properties. The Network
and Sharing Center window then is displayed.
2. Click Local Area Connection. The Local Area Connection Status window
then is displayed.
3. Click Properties. The Local Area Connection Properties window then is
displayed.
4. Select Internet Protocol Version 6 (TCP/IPv6) and click Properties. In the
Internet Protocol Version 6 (TCP/IPv6) Properties window that is displayed,
select Obtain an IPv6 address automatically and click OK.
Step 5 Verify the configuration.
# On SwitchA, run the display dhcpv6 pool command to check the configuration
and IPv6 address prefix assignment of the IPv6 PD address pool pool1.
[SwitchA] display dhcpv6 pool pool1
DHCPv6 pool: pool1
Prefix delegation: FC00:2::/60 63
Lifetime valid 172800 seconds, preferred 86400 seconds

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 394


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

1 in use
Information refresh time: 86400
conflict-address expire-time: 172800
renew-time-percent : 50
rebind-time-percent : 80
Active pd clients: 1
[SwitchA] display dhcpv6 pool pool1 allocated prefix
Prefix/length Valid Expires Left
-------------------------------------------------------------------------------
FC00:2::/63 172800 2014-03-24 11:45:24 172462
-------------------------------------------------------------------------------
Total : 1

# On SwitchA, run the display ipv6 routing-table command to check IPv6 route
information and verify that a static route destined for the host network segment is
available.
[SwitchA] display ipv6 routing-table
Routing Table : Public
Destinations : 5 Routes : 5

Destination : ::1 PrefixLength : 128


NextHop : ::1 Preference : 0
Cost :0 Protocol : Direct
RelayNextHop : :: TunnelID : 0x0
Interface : InLoopBack0 Flags :D

Destination : FC00:2:: PrefixLength : 64


NextHop : FC00:3::865B:12FF:FE36:595B Preference :
60
Cost :0 Protocol : Static
RelayNextHop : :: TunnelID : 0x0
Interface : Vlanif100 Flags :D

Destination : FC00:3:: PrefixLength : 64


NextHop : FC00:3::1 Preference : 0
Cost :0 Protocol : Direct
RelayNextHop : :: TunnelID : 0x0
Interface : Vlanif100 Flags :D

Destination : FC00:3::1 PrefixLength : 128


NextHop : ::1 Preference : 0
Cost :0 Protocol : Direct
RelayNextHop : :: TunnelID : 0x0
Interface : Vlanif100 Flags :D

Destination : FE80:: PrefixLength : 10


NextHop : :: Preference : 0
Cost :0 Protocol : Direct
RelayNextHop : :: TunnelID : 0x0
Interface : NULL0 Flags :D
# On SwitchB, run the display dhcpv6 client command to check the DHCPv6 PD
client configuration and run the display ipv6 interface command to check the
IPv6 address information about the host-side interface VLANIF 200.
[SwitchB] display dhcpv6 client
Vlanif100 is in DHCPv6-PD client mode.
DHCPv6-PD client is in BOUND state.
Preferred server DUID : 00030001000B0923198D
Reachable via address : FE80::20B:9FF:FEED:14D4
IA PD IA ID 0x00000751 T1 43200 T2 69120
Prefix name : myprefix
Obtained : 2014-04-24 09:36:38
Renews : 2014-04-24 21:36:38
Rebinds : 2014-04-25 04:48:38
Prefix : FC00:2::/63
Lifetime valid 172800 seconds, preferred 86400 seconds
Expires at 2067-09-26 09:36:37(172286 seconds left)

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 395


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

[SwitchB] display ipv6 interface vlanif 200


Vlanif200 current state : UP
IPv6 protocol current state : UP
IPv6 is enabled, link-local address is FE80::200:FF:FE00:212
Global unicast address(es):
FC00:2::1, subnet is FC00:2::/64
Joined group address(es):
FF02::1:FF00:1
FF02::1:FF00:212
FF02::2
FF02::1
MTU is 1500 bytes
ND DAD is enabled, number of DAD attempts: 1
ND reachable time is 30000 milliseconds
ND retransmit interval is 1000 milliseconds
ND stale time is 1200 seconds
ND advertised reachable time is 0 milliseconds
ND advertised retransmit interval is 0 milliseconds
ND router advertisement max interval 600 seconds, min interval 200 seconds
ND router advertisements live for 1800 seconds
ND router advertisements hop-limit 64
ND default router preference medium
Hosts use stateless autoconfig for addresses

# On SwitchB, run the display ipv6 interface command to check the IPv6 address
information about the server-side interface VLANIF 100.
[SwitchB] display ipv6 interface vlanif 100
Vlanif100 current state : UP
IPv6 protocol current state : UP
IPv6 is enabled, link-local address is FE80::865B:
12FF:FE36:595B
Global unicast address(es):
FC00:3::865B:12FF:FE36:595B,
subnet is FC00:3::/64 [SLAAC 2018-11-15 10:33:50
2592000S]
Joined group address(es):
FF02::1:FF36:595B
FF02::2
FF02::1
MTU is 1500 bytes
ND DAD is enabled, number of DAD attempts: 1
ND reachable time is 30000 milliseconds
ND retransmit interval is 1000 milliseconds
ND stale time is 1200 seconds

# On SwitchB, run the display ipv6 routing-table command to check IPv6 route
information and verify that a direct route between the server network segment
and the host network segment is available.
[SwitchB] display ipv6 routing-table
Routing Table : Public
Destinations : 6 Routes : 6

Destination : ::1 PrefixLength : 128


NextHop : ::1 Preference : 0
Cost :0 Protocol : Direct
RelayNextHop : :: TunnelID : 0x0
Interface : InLoopBack0 Flags :D

Destination : FC00:2:: PrefixLength : 64


NextHop : FC00:2::1 Preference : 0
Cost :0 Protocol : Direct
RelayNextHop : :: TunnelID : 0x0
Interface : Vlanif200 Flags :D

Destination : FC00:2::1 PrefixLength : 128


NextHop : ::1 Preference : 0
Cost :0 Protocol : Direct

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 396


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

RelayNextHop : :: TunnelID : 0x0


Interface : Vlanif200 Flags :D

Destination : FC00:3:: PrefixLength : 64


NextHop : FC00:3::865B:12FF:FE36:595B Preference : 0
Cost :0 Protocol : Direct
RelayNextHop : :: TunnelID : 0x0
Interface : Vlanif100 Flags :D

Destination : FC00:3::865B:12FF:FE36:595B PrefixLength :


128
NextHop : ::1 Preference : 0
Cost :0 Protocol : Direct
RelayNextHop : :: TunnelID : 0x0
Interface : Vlanif100 Flags :D

Destination : FE80:: PrefixLength : 10


NextHop : :: Preference : 0
Cost :0 Protocol : Direct
RelayNextHop : :: TunnelID : 0x0
Interface : NULL0 Flags :D

# Check the IPv6 address configuration on PCs. In this example, the IPv6 address
fc00:2::d5b2:274:370b:4c6e obtained by PC1 is displayed in the Network
Connection Details window of PC1.

----End

Configuration Files
● SwitchA configuration file
#
sysname SwitchA
#
ipv6
#
vlan batch 100
#
dhcp enable
#
dhcpv6 pool pool1
prefix-delegation FC00:2::/60 63
#
interface Vlanif100
ipv6 enable
ipv6 address FC00:3::1/64
undo ipv6 nd ra halt
dhcpv6 server pool1
#
interface GigabitEthernet1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
ipv6 route-static FC00:2:: 64 Vlanif100 FC00:3::865B:
12FF:FE36:595B
#
return

● SwitchB configuration file


#
sysname SwitchB
#
ipv6
#
vlan batch 100 200
#
interface Vlanif100

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 397


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

ipv6 enable
ipv6 address auto link-local
ipv6 address auto global
dhcpv6 client pd myprefix
#
interface Vlanif200
ipv6 enable
ipv6 address myprefix ::1/64
ipv6 address auto link-local
undo ipv6 nd ra halt
#
interface GigabitEthernet1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface GigabitEthernet2/0/1
port link-type access
port default vlan 200
#
return

10.12.4 Example for Configuring a DHCPv6 Relay Agent


Networking Requirements
As shown in Figure 10-18, the DHCPv6 server needs to dynamically assign IPv6
addresses and DNS server addresses to the clients on network segments
fc00:1::/64 and fc00:2::/64, and the DHCPv6 server and clients are on different
links. The addresses fc00:1::1/64 and fc00:2::1/64 on SwitchA are used as the
gateway addresses of the clients on the network segments fc00:1::/64 and
fc00:2::/64.

Figure 10-18 Networking diagram for configuring a DHCPv6 relay agent


DNS Server
fc00:4::1
GE1/0/1 GE1/0/2 GE1/0/2
VLANIF 10 VLANIF 20 VLANIF 20
DHCPv6 Client fc00:1::1/64 fc00:3::1/64 fc00:3::3/64 Internet

GE1/0/3 SwitchA SwitchB


VLANIF 30 DHCPv6 Relay DHCPv6 Server
fc00:2::1/64

DHCPv6 Client

Configuration Roadmap
Configure the DHCPv6 relay function on SwitchA to forward DHCPv6 packets
between the DHCPv6 server and clients, so that the clients can dynamically obtain
IPv6 addresses and DNS server addresses.

NOTE

Ensure that the DHCPv6 and DNS servers are routable to each other before the configuration.

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 398


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

Procedure
Step 1 Configure SwitchA as a DHCPv6 relay agent.
# Enable the DHCP service.
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] dhcp enable

# Add GE1/0/1 to VLAN 10, GE1/0/2 to VLAN 20, and GE1/0/3 to VLAN 30.
[SwitchA] vlan batch 10 20 30
[SwitchA] interface gigabitethernet 1/0/1
[SwitchA-GigabitEthernet1/0/1] port link-type access
[SwitchA-GigabitEthernet1/0/1] port default vlan 10
[SwitchA-GigabitEthernet1/0/1] quit
[SwitchA] interface gigabitethernet 1/0/2
[SwitchA-GigabitEthernet1/0/2] port link-type trunk
[SwitchA-GigabitEthernet1/0/2] port trunk allow-pass vlan 20
[SwitchA-GigabitEthernet1/0/2] quit
[SwitchA] interface gigabitethernet 1/0/3
[SwitchA-GigabitEthernet1/0/3] port link-type access
[SwitchA-GigabitEthernet1/0/3] port default vlan 30
[SwitchA-GigabitEthernet1/0/3] quit

# Configure IPv6 addresses of VLANIF interfaces.


[SwitchA] ipv6
[SwitchA] interface vlanif 10
[SwitchA-Vlanif10] ipv6 enable
[SwitchA-Vlanif10] ipv6 address fc00:1::1 64
[SwitchA-Vlanif10] quit
[SwitchA] interface vlanif 20
[SwitchA-Vlanif20] ipv6 enable
[SwitchA-Vlanif20] ipv6 address fc00:3::1 64
[SwitchA-Vlanif20] quit
[SwitchA] interface vlanif 30
[SwitchA-Vlanif30] ipv6 enable
[SwitchA-Vlanif30] ipv6 address fc00:2::1 64
[SwitchA-Vlanif30] quit

# Enable the DHCPv6 relay function.


[SwitchA] interface vlanif 10
[SwitchA-Vlanif10] dhcpv6 relay destination fc00:3::3
[SwitchA-Vlanif10] quit
[SwitchA] interface vlanif 30
[SwitchA-Vlanif30] dhcpv6 relay destination fc00:3::3
[SwitchA-Vlanif30] quit

# Configure SwitchA to function as a gateway to send the M and O flags of RA


messages to clients so that the clients can obtain IPv6 addresses through DHCPv6.
[SwitchA] interface vlanif 10
[SwitchA-Vlanif10] undo ipv6 nd ra halt
[SwitchA-Vlanif10] ipv6 nd autoconfig managed-address-flag
[SwitchA-Vlanif10] ipv6 nd autoconfig other-flag
[SwitchA-Vlanif10] quit
[SwitchA] interface vlanif 30
[SwitchA-Vlanif30] undo ipv6 nd ra halt
[SwitchA-Vlanif30] ipv6 nd autoconfig managed-address-flag
[SwitchA-Vlanif30] ipv6 nd autoconfig other-flag
[SwitchA-Vlanif30] quit

Step 2 Configure SwitchB as the DHCPv6 server.


<HUAWEI> system-view
[HUAWEI] sysname SwitchB

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 399


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

[SwitchB] dhcp enable


[SwitchB] ipv6
[SwitchB] vlan 20
[SwitchB-vlan20] quit
[SwitchB] interface gigabitethernet 1/0/2
[SwitchB-GigabitEthernet1/0/2] port link-type trunk
[SwitchB-GigabitEthernet1/0/2] port trunk allow-pass vlan 20
[SwitchB-GigabitEthernet1/0/2] quit
[SwitchB] interface vlanif 20
[SwitchB-Vlanif20] ipv6 enable
[SwitchB-Vlanif20] ipv6 address fc00:3::3 64
[SwitchB-Vlanif20] quit
[SwitchB] dhcpv6 pool pool1
[SwitchB-dhcpv6-pool-pool1] address prefix fc00:1::/64
[SwitchB-dhcpv6-pool-pool1] excluded-address fc00:1::1
[SwitchB-dhcpv6-pool-pool1] dns-server fc00:4::1
[SwitchB-dhcpv6-pool-pool1] quit
[SwitchB] dhcpv6 pool pool2
[SwitchB-dhcpv6-pool-pool2] address prefix fc00:2::/64
[SwitchB-dhcpv6-pool-pool2] excluded-address fc00:2::1
[SwitchB-dhcpv6-pool-pool2] dns-server fc00:4::1
[SwitchB-dhcpv6-pool-pool2] quit
[SwitchB] ipv6 route-static :: 0 fc00:3::1

Step 3 Configure the DHCPv6 client (Windows 7 is used as an example of the operating
system on the PC).
1. Right-click Network on the desktop and choose Properties. The Network
and Sharing Center window then is displayed.
2. Click Local Area Connection. The Local Area Connection Status window
then is displayed.
3. Click Properties. The Local Area Connection Properties window then is
displayed.
4. Select Internet Protocol Version 6 (TCP/IPv6) and click Properties. In the
Internet Protocol Version 6 (TCP/IPv6) Properties window that is displayed,
select Obtain an IPv6 address automatically and Obtain DNS server
address automatically, and click OK.
Step 4 Verify the configuration.
# Run the display dhcpv6 relay command on SwitchA to check the DHCPv6 relay
configuration.
[SwitchA] display dhcpv6 relay
--------------------------------------------------------------------------------
Interface Mode Destination
--------------------------------------------------------------------------------
Vlanif10 Relay FC00:3::3
Vlanif30 Relay FC00:3::3
--------------------------------------------------------------------------------
Print count : 2 Total count : 2

# Run the display dhcpv6 pool command on SwitchB to check configuration


information about the DHCPv6 address pool.
[SwitchB] display dhcpv6 pool
DHCPv6 pool: pool1
Address prefix: FC00:1::/64
Lifetime valid 172800 seconds, preferred 86400 seconds
4 in use, 0 conflicts
excluded-address FC00:1::1
1 excluded addresses
Information refresh time: 86400
DNS server address: FC00:4::1
conflict-address expire-time: 172800
renew-time-percent : 50

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 400


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

rebind-time-percent : 80
Active normal clients: 4

DHCPv6 pool: pool2


Address prefix: FC00:2::/64
Lifetime valid 172800 seconds, preferred 86400 seconds
2 in use, 0 conflicts
excluded-address FC00:2::1
1 excluded addresses
Information refresh time: 86400
DNS server address: FC00:4::1
conflict-address expire-time: 172800
renew-time-percent : 50
rebind-time-percent : 80
Active normal clients: 2

# Run the display dhcpv6 pool pool1 allocated address and display dhcpv6
pool pool2 allocated address commands on SwitchB to check the assignment of
IPv6 addresses in the DHCPv6 address pool.
[SwitchB] display dhcpv6 pool pool1 allocated address
Address Valid Expires Left
-------------------------------------------------------------------------------
FC00:1::2 172800 2013-09-06 03:09:02 166610
FC00:1::3 172800 2013-09-06 03:09:02 166610
FC00:1::4 172800 2013-09-06 03:09:02 166610
FC00:1::5 172800 2013-09-06 03:09:02 166610
-------------------------------------------------------------------------------
Total : 4
[SwitchB] display dhcpv6 pool pool2 allocated address
Address Valid Expires Left
-------------------------------------------------------------------------------
FC00:2::2 172800 2013-09-06 03:09:02 166610
FC00:2::3 172800 2013-09-06 03:09:02 166610
-------------------------------------------------------------------------------
Total : 2

----End

Configuration Files
● SwitchA configuration file
#
sysname SwitchA
#
ipv6
#
vlan batch 10 20 30
#
dhcp enable
#
interface Vlanif10
ipv6 enable
ipv6 address FC00:1::1/64
undo ipv6 nd ra halt
ipv6 nd autoconfig managed-address-flag
ipv6 nd autoconfig other-flag
dhcpv6 relay destination FC00:3::3
#
interface Vlanif20
ipv6 enable
ipv6 address FC00:3::1/64
#
interface Vlanif30
ipv6 enable
ipv6 address FC00:2::1/64
undo ipv6 nd ra halt
ipv6 nd autoconfig managed-address-flag
ipv6 nd autoconfig other-flag

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 401


S12700 Series Agile Switches
Configuration Guide - IP Service 10 DHCPv6 Configuration

dhcpv6 relay destination FC00:3::3


#
interface GigabitEthernet1/0/1
port link-type access
port default vlan 10
#
interface GigabitEthernet1/0/2
port link-type trunk
port trunk allow-pass vlan 20
#
interface GigabitEthernet1/0/3
port link-type access
port default vlan 30
#
return

● SwitchB configuration file


#
sysname SwitchB
#
ipv6
#
vlan batch 20
#
dhcp enable
#
dhcpv6 pool pool1
address prefix FC00:1::/64
excluded-address FC00:1::1
dns-server FC00:4::1
#
dhcpv6 pool pool2
address prefix FC00:2::/64
excluded-address FC00:2::1
dns-server FC00:4::1
#
interface Vlanif20
ipv6 enable
ipv6 address FC00:3::3/64
#
interface GigabitEthernet1/0/2
port link-type trunk
port trunk allow-pass vlan 20
#
ipv6 route-static :: 0 FC00:3::1
#
return

Issue 11 (2020-11-15) Copyright © Huawei Technologies Co., Ltd. 402

You might also like