Professional Documents
Culture Documents
10 DHCPv6 Configuration
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
DHCPv6 solves this problem. DHCPv6 is a stateful protocol for configuring IPv6
addresses automatically.
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.
DHCPv6 Architecture
Figure 10-1 shows the DHCPv6 architecture.
IPv6
Network
DHCPv6 Client DHCPv6 Relay
DHCPv6 Server
– 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.
msg-type 1 byte Indicates the packet type. The value ranges from 1 to 13.
For details, see the DHCPv6 Packet Type.
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.
(1) Solicit
(2) Advertise
(3) Request
(4) Reply
(2) Reply
Information-request:
includes an Option Request option
Reply:
includes the requested options
IPv6 HostA
Switch A Switch B
IPv6 HostB
(2) Relay-forward
(3) Relay-reply
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.
(1) Renew
T1
(2) Reply
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.
(1) Renew
T1
(2) Rebind
T2
(3) Reply
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.
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.
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
server address and domain name. Hosts automatically configure IPv6 addresses
based on RA messages. This overcomes the limitations of IPv6 stateless address
autoconfiguration.
IPv6 HostC
SwitchB SwitchA
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.
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.
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.
IPv6 HostA
Switch A Switch B
IPv6 HostB
IPv6 HostC
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.
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
NOTE
To know details about software mappings, see Hardware Query Tool.
Feature Limitations
Wireless users do not support DHCPv6.
Context
Parameter Default Setting
● 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.
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
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.
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%.
The aging time is set for conflicted addresses in the IPv6 address pool.
----End
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
An IPv6 address pool is created and the address pool view is displayed.
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.
By default, DNS, SIP, NIS, NISP, and SNTP server addresses are not configured for
the IPv6 address pool.
----End
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
An IPv6 address pool is created and the address pool view is displayed.
Vendor-defined options are configured for the IPv6 address pool and the vendor-
defined mode view is displayed.
vendor-id indicates the vendor identifier ID, which is assigned by the IANA. The
identifier ID of Huawei is 2011.
----End
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
You can specify write-delay to modify the DHCPv6 data saving interval. By
default, the device saves DHCPv6 data every 86400 seconds.
----End
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.
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.
▪ 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.
----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:
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.
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.
----End
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
Configuration Logic
The configuration tasks are performed in sequence.
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
By default, the device generates a DUID based on the link-layer (LL) address.
----End
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
An IPv6 PD address pool is created and the address pool view is displayed.
By default, no IPv6 address prefix agent is bound to the IPv6 address pool.
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.
An IPv6 address prefix agent is statically bound to the DHCPv6 PD client in the
address pool view.
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
Procedure
Step 1 Run system-view
An IPv6 address pool is created and the address pool view is displayed.
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.
By default, DNS, SIP, NIS, NISP, and SNTP server addresses are not configured for
the IPv6 address pool.
----End
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
An IPv6 address pool is created and the address pool view is displayed.
Vendor-defined options are configured for the IPv6 address pool and the vendor-
defined mode view is displayed.
vendor-id indicates the vendor identifier ID, which is assigned by the IANA. The
identifier ID of Huawei is 2011.
----End
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
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
● 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
▪ 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.
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
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
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
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
By default, the device generates a DUID based on the link-layer (LL) address.
----End
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 }
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.
----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.
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.
Procedure
Step 1 Run system-view
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 }
----End
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
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.
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.
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
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
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.
By default, the device generates a DUID based on the link-layer (LL) address.
3. Run interface interface-type interface-number
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
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.
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
Context
NOTICE
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
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
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.
# 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
# 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
# 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.
# 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
----End
Configuration Files
● SwitchA configuration file
#
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
Figure 10-16 Networking diagram for configuring the DHCPv6 server and client
DNS Server
fc00:4::1
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 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
[SwitchA-Vlanif100] quit
[SwitchA] quit
# 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
Destination : :: PrefixLength : 0
NextHop : FE80::2EAB:FF:FE98:15BB Preference : 64
Cost :0 Protocol : Unr
RelayNextHop : :: TunnelID : 0x0
Interface : Vlanif100 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
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
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 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.
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
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
# 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
# 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
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
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.
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
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
rebind-time-percent : 80
Active normal clients: 4
# 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