Windows Server 2012 DHCP Failover With or Without Custom DHCP Attributes

Windows Server 2012 DHCP Failover feature is really something we should have a long time ago. Before this feature, when we wanted to achieve DHCP service redundancy, we had to have at least two DHCP servers and we had to split each of our scopes into two. For example, if we had a 192.168.0.0/24 scope, we set up one DHCP server to hand out addresses from 192.168.0.1 to 192.168.0.129 and another DHCP server handing out addresses from 192.168.0.129 to 192.168.0.254. This is just an example. And it is an easy one. If had network such as /27 or /21, a math could be a little bit more complicated.

Thankfully, this is over. Now we can have one DHCP server setup correctly for a particular scope, let’s say 192.168.0.0/24, handing out all addresses from 192.168.0.1 to 192.168.0.254, and add another DHCP server that can hand out addresses if primary server fails, or handing out addresses along with the primary server. We can achieve this with only few mouse clicks!

So, here is our scenario…

Toplogy

We have two domain controllers running Windows 2012R2 Server Core with DHCP server role installed. Both DHCP servers are authorized to the domain. Only the DC-CORE-1 is setup with a test scope:

DHCP Initial Setup

And we can verify that our client received the IP parameters from DC-CORE-1:

ipconfig one

Before we create our failover, let’s add some custom DHCP options to our first server. These options are common in many enterprises and will help us later to see how they can cause us problems.

These custom options we will create:

  •  150 TFTP Servers
  • 161 Wyse FTPServers
  • 162 Wyse FTP Starting Path

First option lists TFTP servers for IP phones, for example, and last two are used for VDI environment, or Virtual Desktop Infrastructure. These are just examples. We can have other options as well, such as option that LWAP access points use for finding a wireless LAN controller. Bottom line is we have these options and they can cause problems, as we shall see.

Let’s create option 150…

In the DHCP Manager, expand DC-CORE-1.popravak.local, right click IPv4 and click “Set Predefined Options…“:

DHCP Set Predefined Options

Then we click Add and create our TFTP custom option:

DHCP Option 150

Then we add our TFTP servers:

DHCP Option 150 Array

This is just example of creating a custom option. Other options are created in a similar fashion…

Now let’s try setting up our DHCP Failover Cluster.

Right click the scope and click “Configure Failover…“:

DHCP Configure Failover 1

Then complete the wizard…

We select scope or scopeS.

DHCP Configure Failover 2

Then chose our partner server.

DHCP Configure Failover 3

Give a name to this relationship, select if we want active/passive or active/active mode and percentage of IP address distribution. We also give a shared secret to be used for authentication purposes.

DHCP Configure Failover 4

Finally, we complete the wizard.

DHCP Configure Failover 5

We can see that the failover setup was successful.

DHCP Configure Failover Success

 

Fine. But before we test the failover, let’s add custom attributes into play. For this we will create another scope for IP phones. This scope will use 192.168.0.0/24 address space and each IP phone requires one ore more TFTP server’s IP addresses. So we add previously created option 150.

DHCP Configure Failover Custom Option

Now let’s replicate this pool with our partner server.

DHCP Configure Failover Custom Option 2

DHCP Configure Failover Custom Option 3

DHCP Configure Failover Custom Option 4

 

Whoops!

DHCP Configure Failover Failure

We can see that now the failover of our pool that uses custom options failed with the error message:

Configure failover failed. Error: 20010. The specified option does not exist.

This will happen with any scope that has one or more custom DHCP attributes. This is what causes our replication to fail:

DHCP Configure Failover Failure Cause

Because we have to have these attributes, what are we going to do? Well, we have to create the same custom attributes on our partner server and then try to replicate our scope. We don’t need to create scopes on partner server, because they will replicate, but just create the attributes that will be used in particular scope we are trying to replicate. The 150 attribute in this case. So we go through the “Set Predefined Options…” on the partner server. Once we do that, we can try to replicate our IP phones scope.

Now we have a success!

DHCP Configure Failover Success

We don’t have the same parameters within the custom attributes we create in our partner scope. For example, IP addresses of TFTP servers don’t have to match those on the primary server. Perhaps types don’t have to match either. Only Code has to match.  A setup such as this may or may not make sense, but that’s another story.

Now, let’s shutdown the DHCP service on primary server.

DHCP Server1 Stop

DHCP Server1 Failed

This will simulate the DC-CORE-1 server failure. From the DHCP standpoint of course. Now we renew our IP address. And we can see that we received our IP address from the partner server.

DHCP Lease From Partner Server

Very nice feature 🙂

 

Advertisements
This entry was posted in DHCP, Microsoft, Server 2012, Windows and tagged , , . Bookmark the permalink.

4 Responses to Windows Server 2012 DHCP Failover With or Without Custom DHCP Attributes

  1. Jason L. says:

    Good post! Unfortunately this did not work for me. I tried recreating all of the options (132-150) and still gives that error “20010 specified option does not exist”. Also tried importing them via powershell from the source DHCP server (just server config options). It is very frustrating that there is no log available to tell me what option it is choking on… anyone?

  2. worshipped says:

    When I initially commented I clicked the “Notify me when new comments are added” checkbox and
    now each time a comment is added I get several e-mails with
    the same comment. Is there any way you can remove people from that service?
    Thanks!

  3. Sebastian Burci says:

    For” Configure failover failed. Error: 20010. The specified option does not exist.”

    It is the wrong option scope you use.
    Sebastian Burci

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s