DHCPv6, also named statefull DHCPv6, is very similar to DHCPv4. It allows full control of address attribution, and full hosts configuration ( IPv6 address, prefix length, DNS servers, DNS prefix, NTP servers, ... ). Remember that DHCPv6 won't hand out default gateway information to hosts ( see previous part ).
We'll setup DHCPv6 using a network router, as well as a Windows Server OS. We'll see the DHCPv6 options an entreprise-grade network router can provide that a consumer product lacks. We will finally see the multiact addresses DHCPv6 uses.
But first, let's have a look at the way DHCPv6 functions, and lay a little theory
IPv6 provides two ways for hosts autoconfiguration : DHCPv6 and SLAAC.
We saw how default gateways and routes are advertised by Routers, using RAs ( Router Announcements ). There is another part of a RA that we need to take a look at :
The managed address configuration flag and the other configuration flag, if both set, have the router explicit to hosts :
Do a DHCPv6 request, for full DHCPv6 configuration ( IPv6 address, prefix length, DNS servers, DNS prefix, NTP servers, ... )
So if the DHCPv6 server is too the default gateway, the process is :
1. The router advertise RAs expliciting :
. Router is default gateway
. Hosts should request full DHCPv6 configuration ( managed and other flags set )
2. The host sends a DHCPv6 request to all DHCPv6 servers on-link
3. The router handles the DHCPv6 request
We can check the status of a Windows OS host interface ( [Idx] ) using :
netsh int ipv6 show int [Idx]
Please note that for hosts, these flags reflect the state they're in due to received RAs. You can't set these flags on a host, only on a router ( or a routing computer. see part 1 of Dynamic networking ) .
Finally, there is an optionnal field in DHCPv6 messages, the preference value :
If a host receives replies from two different DHCPv6 servers, it will choose the highest preference one.
If both replies have equal preference value, it will choose the most information-featured one.
The host CAN choose the less preference reply if it features more informations, it depends on the host settings.
A preference value of 0 results in the lack of the preference option field in the DHCPv6 message.
DHCPv6, DUID, IAID and Network Interfaces
Whereas with DHCPv4, clients were identified by the server with their MAC address,
with DHCPv6 they're identified with their DUID : Dhcp Unique IDentifier.
Each DHCP client has a unique DUID, that is not to change, even if one of the LLA ( Link-Local Address ) of the client changes.
One computer has several IA ( Identity Association ) : one per NIC ( plus eventually one per IA type : NA, TA, ... )
The computer IAs are identified with their IAIDs ( IA ID ) : this ID number has to be unique for a given computer, and is not to change for a given interface.
EX : A computer with two interfaces requesting permanent DHCPv6 addresses on both has :
. 1 DUID
. 2 IAID ( one per interface )
As soon as a DHCPv6 lease has been done by the DHCPv6, it will register the DUID and IAADs for this lease.
The DUID is created at the OS installation, or DHCPv6 client package installation.
It is Link-Local Address derived ( there are three different formats : LLA, LLA+time, Unique Vendor Specific ), and maximum 128 Bytes long. Only one LLA is used ( that of a chipset integrated NIC preferencially ).
The IAID is created when a new network card is installed. It is 4 Bytes long.
To see the DUID and IAID's of a Windows OS : ipconfig /all
To see the DUID and IAID's of a Raspbian OS with wide-dhcpv6 package :
DHCPv6 with a consumer-grade network router
Let's see how to use DHCPv6 with our neat, 40€/$ Dlink DIR 626L ( Router 1 here ) :
It's all very obvious indeed, with the only exception I outlined earlier that this setting is in the ' Manual IPv6 Internet Connection Setup ' submenu, not in the local connectivity submenu :
well, we just have to :
check ' enable automatic IPv6 address assignment '
choose the Statefull ( DHCPv6 ) ' option in the submenu
assign an address range
set up the lease time
pretty simple and easy
note that the network router hands up DNS servers IPs based on its own registered DNS Servers ( on the same ' Manual IPv6 Internet Connection Setup ' submenu ). All is sent using DHCPv6 messages.
The Lan IPv6 Address is limited to a /64, and DHCPv6 Address range uses it as the network prefix. You can choose the remaining 64 bits to define the host id range.
Note too that the IP address are leased in a succesive linear way, there is no randomized choice out of the address pool.
There are no other option to set, or choose from
DHCPv6 with a Windows Server OS
Using Windows Server 2008 R2 as an exemple, let's see how to set it into a DHCPv6 Server and default gateway, using this network map :
For IPv6 router/default gateway, please see the previous post.
Let's see how to add DHCPv6 :
First, I recommand to clean up any previous DHCP setup on the server. Just delete the content of these folders :
Then, add the DHCP server role using the Server Manager
Only select the Lan NIC here
Create the IPv4 Scope, using default setings ( No WINS, ... )
Choose ' Disable DHCPv6 Stateless '
Now, let's add an IPv6 scope :
Server Manager ) DHCP ) IPv6 ) Right click ) New Scope
all we have to setup is :
scope name and description
scope prefix ( /64 )
preference level ( default ( 0 ) is all right as there are no other DHCPv6 server here )
we can use some exclusions, to narrow the leased scope. As an exemple, if we only want to lease hosts id :
4:0000 to 4:FFFF
we add two exclusions :
0:1 to 3:FFFF
5:1 to FFFF:FFFF:FFFF:FFFF
Last, we setup DNS and DNS prefix for our DHCPv6 Server to announce :
IPv6 ) Server Options ) Right click ) Configure Options
option 23 [ enter the IPv6 DNS IPs here ]
option 24 [ enter the DNS prefix here ]
Well, that's all that needs to be done. You can note that the IPv6 addresses leases are choosen randomizely from the address pool.
DHCPv6 with a network router as default gateway, and a Windows Server DHCPv6 server
Here is the network map :
Well, nothing is different from the previous exemples we saw, except a little detail here :
Our D-Link, to be able to advertise default gateway RAs, must be set on lan autoconfiguration :
We have to choose Statefull ( DHCPv6 ) so the right flags ( managed + other ) are set on the advertised RAs, so the host performs a DHCPv6 request.
and when choosing DHCPv6 setting on the network router, we have to be sure the Windows Server DHCPv6 will be preffered over the network router's one.
We could set the Windows Server DHCPv6 preference value higher, so that it will be preferred. The D-Link DIR 626-L preference value is fixed to 0.
But it isn't needed, as the Windows Server DHCPv6 server provides more informations to DHCPv6 requests ( Domain prefix, FQDN, vendor specific infos ), and thus gets preferred.
This is a perfect exemple of the IPv6 paradigm shift, and the new problems it creates ( and solves ).
DHCPv6 with a pro-grade network router
Compared to a consumer-grade network-router, a typical 200+ €/$ pro-grade router may provide you these added features and options, DHCPv6-wize :
. Router's preference value
. DNS prefix
. Lan prefix length
. DNSv6 proxy
. Multiple DHCPv6 address pools
. randomization of address pool leases
DHCPv6 Multicast addresses
Here are the main addresses DHCPv6 makes use of. They are IPv6 Multicast addresses :
Router's RAs use ff02::1 for ICMPv6 RAs
Hosts use ff02::1:2 for DHCPv6 requests
Further, you may encounter request sent to ff05::1:3
here are their meanings :
ff02::1 all nodes link-local
ff02::1:2 all DHCP servers and relay agents link-local
ff05::1:3 all DHCP servers on the local network site