Installing Clustered DHCP Server on Windows Server 2008 R2

If you want to add redundancy to the DHCP server service in Windows Server 2008 R2, you have a few options.  Such as installing two servers, where you split the scope among them, 50/50, 80/20 etc. Another option is to have a hot standby, where you (manually) import the DHCP database, if your primary DHCP server fails. But the best option on Windows Server 2008 R2, is probably a clustered DHCP server.

That way you will have a cluster consisting of two or more nodes, where the DHCP database will reside on shared storage. So if one of the nodes fails, the DHCP database will automatically be moved to another node, in a process called failover.

In this post we will look at installing a clustered DHCP server on a cluster consisting of two nodes. I’m assuming that the cluster and available shared storage is already in place. If you want to know how to setup a failover cluster in a test lab, you can check the step-by-step guide for that.

Before we begin on the step-by-step portion of this guide, I would just like to clarify three simple matters

  • Configuration of DHCPv6 Stateless Mode
  • Size of the shared disk for the clustered DHCP server.
  • Which IP address will be the IP helper-address

DHCPv6 Stateless or Stateful Mode

Enable DHCPv6 stateless mode for this server

  • This will make the DHCP server stateless.
  • Clients will obtain only configuration options (DNS, Router’s IP address etc.) from the DHCPv6 Server.
  • Clients will self-configure IPv6 addresses by exchanging router solicitation and router advertisement messages with a neighbouring IPv6 router.
  • Keep in mind, this behaviour can be configured differently, by setting configuration flags on either the routers or the dhcp clients (computers). But thats really not the subject of this blog post, so lets just keep the discussion simple. 🙂

Disable DHCPv6 stateless mode for this server.

  • This will make the DHCP server stateful.
  • Clients will obtain both DHCP options and ip addresses from the DHCPv6 Server.
  • Therefore an ipv6 scope must be configured on the server.

So if you are not utilizing IPv6 on your network, which mode should you choose? You should disable DHCPv6 stateless mode, and then not configure any IPv6 scopes on the DHCP server. This will result in clients not receiving IPv6 addresses from neither a neighbouring router (since you are not utilizing IPv6 on your network) nor the DHCP server. But rather they will only assign themselves Link-Local IPv6 addresses, these type of addresses are equivalent to APIPA addresses on IPv4.

Size of the shared disk

The DHCP database in itself is not very large. Obviously nor are the automatic backups that are created of the database, by the DHCP server. So it all boils down to how large log files you’d like to keep. Personally I feel that 30GB is a good round number for the DHCP service. Then you can keep large log files if you like.

IP-helper address

Lets just keep it simple, the IP-helper address will be the address you specify in step 2.5 In other words the address that will be assigned to the clustered DHCP service. The individual IP addresses of the nodes in the cluster, will not be specified as IP-helper addresses.

With that out of the way, lets start installing a clustered DHCP server

1. Install the DHCP Server role on both nodes

1.1 In Server Manager click Add Roles
1.2 Click Next
dhcp2

1.3 Choose DHCP Server, and then click Next
dhcp3

1.4 Click Next
dhcp4

1.5 Choose the network interface, from which the DHCP server will service the clients. As you can see I have three NICs, one is for heartbeat communication among the cluster nodes (192.168.2.20), one is for iSCSI connection to the shared storage (192.168.1.20), while the last one is the only one connected to the production environment, so that is the one I have chosen here.
dhcp5

1.6 Fill in the DNS options for your DHCP server. This is option 006 and option 015 of the Server Options of a DHCP server.
dhcp6

1.7 Click Next, as you are probably not utilizing Wins anymore
dhcp7

1.8 Do not add any scopes for now. You can obviously add or import scopes later, when the clustered DHCP server service has been created.
dhcp8

1.9 Unless your DHCP servers are going to service DHCPv6 clients, choose disable DHCPv6 stateless mode for this server, and then do not add any IPv6 scopes later on.
dhcp9

1.10 Authorize the DHCP server
dhcp10

1.11 Click Install, and then click Close. Repeat the same procedure on the second node of the cluster.

2. Install the DHCP service on the failover cluster

2.1 Click Start – Administrative Tools – Failover Cluster Manager
2.2 Expand your cluster – right-click Services and applications – choose Configure a Service or Application
dhcp14

2.3 Click Next
dhcp15

2.4 Choose DCHP Server, click Next
dhcp16

2.5 Give you clustered DHCP server a name and an IP address, then click next. This will obviously be an IP address from the same range as the one you chose in step 1.5 The IP address you provide here, will be the ONLY IP-helper address, in my case IP-helper address will be 192.168.0.70
dhcp17

2.6 Choose available storage, and click next
dhcp18

2.7 Click Next
dhcp19

2.8 Click Finish, and you are done
dhcp20

2.9 Click on the clustered DHCP server service you just created, right-click DHCP Server beneath DHCP Service, and choose properties
dhcp21

2.10 Here you can view the different paths for files and folders associated with the DHCP server
dhcp22

3. How the DHCP service works on a clustered DHCP server

In enterprise environments, you for the most part have a baseline GPO for all member servers, where different services are disabled for various roles, as all member servers will not be running those roles. Then you have a specific GPO for each role, where that role’s service’s startup mode is configured.

For the DHCP server, the startup mode is configured as automatic. So the DHCP server service is started each time the DHCP server boots up. But in a clustered DHCP server, you don’t need to define the DHCP server service’s startup mode as automatic, as the cluster will set it to manual regardless, and take command of  the DHCP server service on the active node.

This is how the DHCP server service works on a clustered DHCP server

Node1 (active)    – The cluster sets startup type of the DHCP server service on the node to manual, and starts the service
Node2 (passive) – No changes are made

Failover from Node1 to Node2

Node 1 (passive) – The cluster stops the DHCP server service on the node, and makes no changes to startup type of the service
Node 2 (active)    – The cluster sets startup type of the DHCP server service on the node to manual, and starts the service

Failover from Node2 to Node1

Node 1 (active)    – The cluster sets startup type of the DHCP server service on the node to manual, and starts the service
Node 2 (passive) – The cluster stops the DHCP server service on the node, and makes no changes to startup type of the service

Every time a node becomes active, the cluster will set the startup type of the DHCP server service on that node to manual, and then start the service. On the passive node, the DHCP server service is stopped, but no changes are made to the startup type of the service.

Therefore its best to configure the startup type of the DHCP service as manual in the GPO that will be applied to your DHCP servers. If you configure it as automatic, you will receive the following error on the passive node, each time group policy refresh runs, since the passive node is unable to connect to the shared storage, where the DHCP database resides.

dhcp23

Additional Resources:
Technet: DHCP Step-by-Step Guide: Demonstrate DHCP Failover
Technet: Understanding DHCPv6 address configuration
4sysops.com: Difference between Stateless and Stateful mode

Leave a Comment

Your email address will not be published. Required fields are marked *

Captcha * Time limit is exhausted. Please reload the CAPTCHA.