Windows Server DHCP Failover & Load Balancing

DHCP Failover KB ID 0001488

Problem

Applicable to: Server 2012/2016/2019/2022

Even though we have had this functionality for a while, I’m still seeing people deploy DHCP scopes (split 80/20) across two servers?

You can deploy multiple DHCP servers to serve the SAME DHCP scopes, in either load balanced, or hot standby deployment.

Solution: DHCP Failover

I’m assuming you already have one DHCP server setup and, with a working DHCP scope. On the new server, install the DHCP server role;

Install-WindowsFeature DHCP -IncludeManagementTools

Install DHCP via PowerShell

You normally have to go to Server Manager and run the configuration wizard, but as were are already in PowerShell lets do that here 🙂 (That’s three commands if the last one wraps!)

netsh dhcp add securitygroups

Add-DhcpServerInDC -DnsName pnl-mgmt.pnl.com -IPAddress 192.168.100.3

Set-ItemProperty –Path registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ServerManager\Roles\12 –Name ConfigurationState –Value 2

Configure DHCP via PowerShellConfigure DHCP via PowerShell

On the original, (already working,) DHCP server, right click the scope you want to replicate > Configure Failover. Note: If you have multiple scopes you can right click at the IPv4 or IPv6 level, and run the same wizard to replicate multiple scopes at once).

Setup DHCP Failover

Next.

Windows DHCP Failover

Browse to, and select the target (new DHCP server) > Next.

DHCP Failover Partner Server

Select Load Balancing or Hot Standby (as required) > Enter a shared secret password > Next.

DHCP Failover Shared Secret

Review the Settings and click Finish.

DHCP Failover Settings

Hopefully you should see the following.

DHCP Failover Complete

Configure DHCP Failover via PowerShell

To do the same from PowerShell.

PowerShell DHCP Load Balancing

Note: Where DC-01 is the source DHCP server and PNL-MGMT is the new one.

Add-DhcpServerv4Failover –ComputerName “DC-01” –PartnerServer “PNL-MGMT” –Name “DHCP_DC01_PNLMGMT_LoadBalance” –LoadBalancePercent 50 -MaxClientLeadTime 1:00:00 -StateSwitchInterval 00:45:00 -ScopeId 192.168.200.0 -SharedSecret “Password123

Configure DHCP Failover PowerShell

PowerShell DHCP Hot Standby

Note: Where DC-01 is the source DHCP server and PNL-MGMT is the new one.

Add-DhcpServerv4Failover -ComputerName “DC-01” –PartnerServer “PNL-MGMT” -Name “DHCP_DC01_PNLMGMT_Hot_standby” -ServerRole Active -ReservePercent 10 -MaxClientLeadTime 1:00:00 -StateSwitchInterval 00:45:00 -ScopeId 192.168.200.0 -SharedSecret “Password123

Related Articles, References, Credits, or External Links

NA

Author: PeteLong

Share This Post On

9 Comments

  1. Hello Adi. Can MS DHCP active active load-balancing be done on DHCP servers across different datacenters. ie each DHCP server are on different subnet? If not are you aware of any third-party DHCP solution that would allow this?

    Post a Reply
    • Javeed,

      This can be done out of the box. I have setup two geographically disparate servers with different subnet without issue

      Post a Reply
  2. Hi. you have “Set-ItemProperty –Path” written twice

    Post a Reply
  3. Hello, another typo: “Select Log Balancing” -> Select Load Balancing

    Thanks for your guides, again.

    Post a Reply
    • José – Thank you! Updated.

      Post a Reply
  4. If one dhcp server is 2012 R2 and I want to add a 2022 server to eventually replace 2012 R2, can I run both with load balancing?

    Post a Reply
    • TBH – I’ve never tried it – I would be going to the test bench to test it first if I were you.

      P

      Post a Reply

Submit a Comment

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