Latest posts by Michael Pietroforte (see all)
- Results of the 4sysops member and author competition in 2018 - Tue, Jan 8 2019
- Why Microsoft is using Windows customers as guinea pigs - Reply to Tim Warner - Tue, Dec 18 2018
- PowerShell remoting with SSH public key authentication - Thu, May 3 2018
When I first installed a DHCPv6 server on Window Server 2008 R2, my clients (Vista and Windows 7) were unable to receive IP addresses. Thus, I started googling to find out what went wrong. I found quite a few official and unofficial resources with promising advice. In the end, it turned out that most of those resources were either outdated or simply provided wrong information. In my last post about DHCPv6 server installation, I mentioned the wrong advice regarding client settings.
The difference between stateless and stateful IPv6 autoconfiguration ^
However, the most prominent confusion about setting up DHCPv6 on Windows Server 2008 R2 is the difference between stateless and stateful autoconfiguration. I briefly discussed the difference already in my article about the IPv6 features. With stateless autoconfiguration of IPv6 addresses, a host uses the IPv6 prefix (the subnet address) advertised by a router on the link (subnet) to generate an IPv6 address.
Clients can use the MAC address of their network interface to determine the interface identifier. The interface identifier is the last 64 bits of an IPv6 address. If you are interested in how this interface identifier generation works in stateless autoconfiguration, I recommend this explanation.
Stateful autoconfiguration is simply IP address assignment through a DHCPv6 server.
Stateless mode and stateful mode of a Windows 2008 R2 DHCP server ^
Much of the confusion on the web stems from the fact that when you install the DHCP role on a Window 2008 or R2 server, you have to choose whether you "Enable DHCPv6 stateless mode for this server" or "Disable DHCPv6 stateless mode for this server" (see screenshots). Since disabling stateless mode seems to imply that you enable stateful mode, many recommend that you re-install your DHCP server and make sure that your DHCP server is in stateful mode because only then will it issue IPv6 addresses to DHCPv6 clients.
This claim is wrong. As to my tests, this setting makes no difference with regard to automatic IPv6 address assignment through a Windows DHCPv6 server. The only difference between those two options is that if you choose to enable stateless mode, the installation wizard will ask for a Parent Domain and an IPv6 DNS Server. The reason for this is that, with stateless autoconfiguration, clients can only receive the IPv6 prefix from a router to derive the IPv6 address but no additional network settings as the DNS server.
However, a router can tell clients to obtain this configuration from a DHCPv6 server by setting the so-called M Flag to 0 and the O Flag to 1. In this scenario, the corresponding DHCP server runs in stateless mode because it won't assign IPv6 addresses to clients. But since you have no IPv6 scopes in stateless mode on the DHCP server where you could assign those options, you have to configure them during the DHCP server installation and assign them to the server. More information about the M Flag and O Flag can be found in this article.
How to change a DHCPv6 server from stateless to stateful mode ^
I also often saw the question of how to change the mode of a Windows DHCPv6 server from stateless to stateful mode. Since there is no explicit setting where you could change a Windows DHCP server from stateful to stateless mode in the DHCP management console, it is often recommended to re-install the DHCP server. However, from what I have just said above, it is clear that this advice doesn't make sense.
All you have to do is to change the DHCP server from stateless to stateful mode is to add and activate an IPv6 scope and you get a stateful DHCPv6 server that is able to assign IPv6 addresses to clients.
And if you want to move a DHCP server from stateful to stateless mode, you simply have to deactivate or delete all IPv6 scopes from the server.
The parameters Parent Domain and IPv6 DNS Server, which the installation wizard asked for during the DHCP server role installation if you chose "enable stateless mode," can be added manually to the Server Options node in the DHCP management console. The stateless DHPC server can then configure clients with these settings while the IPv6 prefix has to be provided by a router.