By using Failover on the DHCP Server, we share the load between the two servers with load balancing and provide fault tolerance. Thus, even if one of the two DHCP servers is not online, the clients continue to be served by the second server.
The DHCP Failover can be configured with two basic modes.
- Load Balance Mode, where both DHCP servers are active simultaneously, and the load is shared between them.
- Hot Standby Mode, where one DHCP server is active (as primary) and the other is passive (as secondary) so that when the primary is unavailable, the secondary is automatically enabled.
These two modes can be applied at the DHCP Scope level, for each scope separately, or at the Server level for all Scopes.
Configure DHCP Failover in Windows Server 2016
To implement this scenario, we will assume that we have two DHCP servers, DC01 and DC02, which are also DCs and DNS servers. These extra roles are not required, though.
We assume that the DHCP role has been installed on the two servers and the appropriate Scopes have been configured on one DHCP server.
DHCP Failover – Load Balance Mode
Open the DHCP console, right-click IPv4, and then click Configure Failover.
In the window that will appear, you will see the list of available Scopes you can set for failover. Select all is turned on by default, you can turn it off and select only those you want to configure. Click Next to continue.
Click the Add Server button to select the second DHCP server from the list of authorized DHCP servers or type the hostname or IP address in the corresponding field and click Next to continue.
In the next step, you’ll need to go through some settings.
- In the Relationship Name field, type a name for the specific “relationship” of the two servers.
- In the Mode field, select Load Balance.
- In the Load Balance Settings field, select the load percent of each server to share.
- In the State Switchover Interval field, you can leave it blank. This setting is used for Hot Standby mode.
- In the Enable Message Authentication field, you can enable it if desired, and then enter a password in the Shared Secret field. This password is used to authenticate messages sent between the two servers participating in DHCP Failover.
Click Next to continue.
Finally, click Finish to complete the Failover setup.
Immediately after, the corresponding progress window will appear, and if everything went well, you will see the Configure failover successful message.
DHCP Failover – Hot Standby Mode
The steps to configure Hot Standby mode are the same as those described above, but we’ll only stop at the last step that is a bit different.
- In the Relationship Name field, type a name for the specific “relationship” of the two servers.
- In the Mode field, select Hot Standby.
- In the Hot Standby Settings field, select the percentage of addresses that the standby server will reserve.
- In the State Switchover Interval field, select the time that will be required until the status of the DHCP Server change from passive to active.
- In the Enable Message Authentication field, you can enable it if desired, and then enter a password in the Shared Secret field. This code authenticates messages sent between the two servers participating in DHCP Failover.
Click Next to continue.
Immediately after, the corresponding progress window will appear and as everything went well you will see the Configure failover successful message.
View and edit DHCP Failover settings
So, after you have set up your DHCP Failover on your server, you may need to view how it was configured again and possibly edit some of its settings. This is done through the DHCP Properties window.
Right-click on IPv4 and then click Properties. In the window that opens, go to the Failover tab. Here, you can see the status of failover settings and edit and delete them.
Correspondingly, through the settings window of each DHCP Scope, you can view the failover settings for each Scope separately.
Force Scope and Relationship replication
If you’ve made changes to a server and want to force the replication from one partner server to another, then this is how it’s done.
To replicate Scope settings, right-click a Scope and then click Replicate Scope.
Correspondingly, to replicate the settings of all Scopes, right-click on IPv4 and then click Replicate Failover Scopes.
Finally, to replicate settings of all Scopes in a particular relationship, right-click on a Scope and then click Replicate Relationship.
In any case, the corresponding confirmation message will be displayed.
Remove (deconfigure) DHCP Failover
Removing DHCP Failover settings between two partner servers is very easy and fast, again at both server and Scope level.
To remove a DHCP Failover Scope, right-click on the Scope and then Deconfigure Failover.
You will need to confirm your action and then the corresponding message will be displayed.
Scopes and Relationships will be removed from the partner server when removing the DHCP Failover.
DHCP Failover via PowerShell
Of course, all of the above actions can be done through PowerShell. However, since DHCP Failover settings do not change often, it might have been quicker and easier to do it using the DHCP console instead of PowerShell’s advanced parameters. So, I will not focus more on this point, apart from mentioning the basic cmdlets.
- Add-DhcpServerv4Failover
- Add-DhcpServerv4FailoverScope
- Get-DhcpServerv4Failover
- Remove-DhcpServerv4Failover
- Remove-DhcpServerv4FailoverScope
- Set-DhcpServerv4Failover
- Invoke-DhcpServerv4FailoverReplication
If you are interested, you can find more information about the parameters you will need in Microsoft documentation.
This perfectly explains everything. Great job! I was confused on why the scopes didn’t replicate over.
is it possible to replicate the scopes automatically when a change is made to a one dhcp server? in the dhcp load balancing mode, are the scopes automatically replicated?
Thanks!!
Hi,
Thx for this topic.
On 2012R2 server, we have a limiation of 31 failover relations.
Is it the case on 2016 ?
Thx
To be honest I’m not quite sure about this. I can’t find any official reference from Microsoft that this limitation has changed in WS2016, so I assume that the limit is the same one with 2012R2 server.
Hi,
Any chance you could share one write up on Data Deduplication. Thanks for the others. Helps alot.
Thank you for the great article.
One question I have, however; does the secondary DHCP server need to be authorized during this process? I didnt see it mentioned here, nor was it mentioned in any other articles I have seen…
Yes, having a DHCP server authorized means that it can issue IP addresses to clients.
Hi everyone. Is it possible to be alerted if Configure failover is not configured. Either by not allowing the configuration to finish or send an email if this setting is not made.
Hi guys so if I deconfigure and the scopes are removed from the failover server do those IP’s now failover to the primary?