Windows Server DHCP Failover: Choosing Hot Standby or Load Balance

Windows Server DHCP failover: choosing load balance or hot standby, MCLT and partner down, PowerShell setup, branch scenarios, relay and forgotten replication.
Technical summary
Technology
Windows Server DHCP, DHCP failover, MCLT, DHCP relay, PowerShell DhcpServer module
Topic
Running the DHCP service redundantly on two servers
Level
Intermediate
Prerequisites
  • Windows Server DHCP role administration
  • Basic VLAN and DHCP relay knowledge
  • Both servers authorized in AD
In this article8 sections

When the DHCP server stops, nobody notices in the first hour; clients keep working until their lease expires. Then newly connecting devices can’t get an address, clients that can’t renew their lease drop off one by one, and tickets pile up within hours. Windows Server DHCP failover removes this single point of failure by having two servers share lease information. Below we explain the two modes, MCLT and state transitions, setup with PowerShell, mode choice for branches and the replication step most often skipped in operation.

DHCP redundancy options

There are three ways to make DHCP redundant in a Windows environment:

Method Lease information sharing Infrastructure needed Note
Split-scope None Two independent servers The pool is split, typical ratio 80/20
DHCP failover Yes Two servers, TCP 647 Introduced with Windows Server 2012; the current Microsoft document requires both partners to run at least Windows Server 2016. IPv4 only
DHCP on a Failover Cluster Shared disk Cluster and shared storage Single database, more complex

Split-scope is simple, but when one of the servers stops, the other can hand out only the addresses in its own share. Since it doesn’t know the leases the other server issued, it can’t renew them; a client whose lease expires has to get a new address. Cluster-based DHCP, on the other hand, leaves shared storage as a single point of failure, and building a cluster just for DHCP is a disproportionate load in most environments. Failover keeps the lease database on two servers simultaneously without requiring additional server and system infrastructure. In most environments this is the default choice.

Failover modes: load balance and hot standby

In load balance mode, both servers actively serve clients. An algorithm based on a hash of the client identifier (MAC address) determines which server responds to which client (RFC 3074). The default split is 50 percent and can be changed if desired. Both servers receive requests on the same network; in the normal state each responds only to the clients it is responsible for.

In hot standby mode, one server is active and the other is on standby. The standby server normally doesn’t respond to clients; part of the pool (5 percent by default) is set aside for it, and when communication with the active server is lost, it gives new clients addresses from this reserve pool.

Feature Load balance Hot standby
Responds in the normal state Both servers Only the active server
Pool sharing By ratio (default 50/50) Reserve percentage (default 5)
Suitable scenario Both servers at the same site Standby at head office, active at the branch
WAN dependency If the partner is remote, some clients are served over the WAN None if the active server is local

MCLT and state transitions

Maximum Client Lead Time (MCLT) is the upper limit on how far a server can extend a lease beyond what its partner knows; the default is 1 hour. This limit prevents the same address from being given to two clients when the two servers can’t hear from each other. It has a side effect that surprises people in the field: a server in failover gives a new client its first lease with the MCLT duration. On the renewal after the partner has been updated, the scope’s full lease time applies. So the answer to “why does the lease time show one hour” is usually not a bug but MCLT.

The basic states of the relationship:

  • Normal: The servers are in communication and notify each other of lease updates.
  • Communication Interrupted: The partner can’t be reached. The server can renew existing leases; it gives new clients only addresses in its own share (from the reserve pool for the standby server in hot standby). It can’t tell whether the partner has really stopped or only the connection has dropped.
  • Partner Down: The partner is assumed to be really out of service. After moving to this state, the server takes control of the whole pool once the MCLT period has passed.
  • Recover / Recover Wait / Recover Done: When the partner comes back, the lease databases are resynchronized and the relationship returns to Normal.

The move from Communication Interrupted to Partner Down requires administrator intervention by default. If the state switchover interval (-AutoStateTransition and -StateSwitchInterval in PowerShell) is enabled, the switch happens automatically after the set time. Automatic switching has a risk: in a network partition (the link between the two servers breaks while both are running), both servers can move to Partner Down. Choose the interval longer than the typical duration of network outages. If both servers become the boss, addresses conflict.

Setup steps and PowerShell

Prerequisites: the DHCP role must be installed and authorized in AD on both servers, TCP 647 must be open between them, and their clocks must match. According to Microsoft documentation, if the clock difference between the two servers exceeds one minute, the failover configuration fails; verify that both are synchronized from the domain time hierarchy. Scopes should exist only on the primary server; they are copied to the partner when the relationship is created. Adapt the server names, scopes and durations in the example below to your environment.

# Load balance: two servers at the same site
Add-DhcpServerv4Failover -ComputerName dhcp01.contoso.local -Name "DHCP01-DHCP02" `
  -PartnerServer dhcp02.contoso.local -ScopeId 10.10.10.0, 10.10.20.0 `
  -LoadBalancePercent 50 -MaxClientLeadTime 01:00:00 `
  -AutoStateTransition $true -StateSwitchInterval 02:00:00 `
  -SharedSecret "A-long-and-random-shared-secret"

# Hot standby: branch server active, head office server standby
Add-DhcpServerv4Failover -ComputerName dhcp-izmir.contoso.local -Name "IZMIR-HQ" `
  -PartnerServer dhcp01.contoso.local -ScopeId 10.30.10.0 `
  -ServerRole Active -ReservePercent 5 -MaxClientLeadTime 01:00:00 `
  -SharedSecret "Another-shared-secret"

# Add a new scope to an existing relationship
Add-DhcpServerv4FailoverScope -ComputerName dhcp01.contoso.local -Name "DHCP01-DHCP02" -ScopeId 10.10.30.0

# Status check
Get-DhcpServerv4Failover -ComputerName dhcp01.contoso.local |
  Select-Object Name, PartnerServer, Mode, State, LoadBalancePercent, ReservePercent, MaxClientLeadTime

All parameters are in the Add-DhcpServerv4Failover documentation. The shared secret is used to authenticate failover messages; choose a separate, strong value for each relationship and keep it in the password vault. After setup, define the DNS dynamic update credentials on both servers with the same account; otherwise one server can’t update a record created by the other. Details are in the Active Directory DNS configuration article.

Choosing the mode in branch scenarios

The deciding question is a single one: when the WAN link drops, which server will the branch clients get their addresses from?

Scenario Recommended setup Reason
Single site, two servers Load balance Load is shared, both servers equal
Local server at the branch Hot standby; branch active, head office standby Service continues locally during a WAN outage
No server at the branch Two servers at head office, load balance Both servers reached via relay
Many branches A separate hot standby relationship for each branch, a single head office standby The head office server can be standby in several relationships

If there is no server at the branch, DHCP is unreachable anyway when the WAN drops. In that case, redundancy can only be provided with a small reserve pool on the branch network device or with leases long enough to tolerate short outages. This is an architectural decision, made according to outage tolerance.

In every case, the relay definition on the client VLANs must include both servers. This is a common failover failure: the failover relationship appears Normal, but the switch relays to only one of them. In Cisco IOS there are two ip helper-address lines on the VLAN interface:

interface Vlan10
 ip address 10.10.10.1 255.255.255.0
 ip helper-address 10.10.0.21
 ip helper-address 10.10.0.22

In networks using DHCP snooping, also check that the path to both servers is marked trusted. For details on the network side, see the DHCP relay and DHCP snooping configuration article.

Replicating scope changes

Failover continuously synchronizes lease information, but doesn’t automatically synchronize configuration changes. Adding a reservation, changing an option value or defining an exclusion range on one server isn’t reflected on the partner. The most common error in operation: a reservation exists on only one server, the client gets a different address from the other server, and a printer or camera “disappears” one morning.

# Replicate the whole relationship
Invoke-DhcpServerv4FailoverReplication -ComputerName dhcp01.contoso.local -Name "DHCP01-DHCP02" -Force

# Replicate only a specific scope
Invoke-DhcpServerv4FailoverReplication -ComputerName dhcp01.contoso.local -ScopeId 10.10.20.0 -Force

The replication command overwrites the partner with the configuration on the server where it is run. Always make changes on the same server. Scope-level options, reservations, exclusions and scope policies are replicated; server-level options, MAC filters and server-level settings are configured separately on each server.

Monitoring and troubleshooting

A failover relationship can silently stay in Communication Interrupted, and you run on a single server for days without anyone noticing. There is no redundancy during those days. Monitoring should cover:

  • Raise an alert if the relationship state isn’t Normal (the State field in the Get-DhcpServerv4Failover output).
  • Monitor scope utilization on both servers: Get-DhcpServerv4ScopeStatistics -ComputerName dhcp01.contoso.local. While one partner is out of service, the running server can hand out only its own share until it moves to Partner Down; leave enough free addresses in highly utilized scopes.
  • Collect warnings from the DHCP Server source in the event log: Get-WinEvent -ProviderName "Microsoft-Windows-DHCP-Server" -MaxEvents 50.
  • For lease history, the audit logs (DhcpSrvLog-*.log) under %windir%\System32\dhcp can be used.

If a server will be shut down for a long planned period (hardware replacement, reinstallation), manually putting the running server into Partner Down lets the whole pool be used: Set-DhcpServerv4Failover -ComputerName dhcp01.contoso.local -Name "DHCP01-DHCP02" -PartnerDown. If a server is to be removed permanently, first delete the relationship with Remove-DhcpServerv4Failover; the scopes stay on the server where you run the command.

If DHCP runs on a DC, a DC replacement is a natural opportunity to move to failover; the process is in the domain controller replacement and FSMO transfer article. Teams that want to monitor relationship state and scope utilization regularly can put these checks within the scope of technical support and scheduled maintenance; for general infrastructure operations, see the server and cloud management page.

Frequently asked questions

Does DHCP failover also cover IPv6 scopes?

No. Windows Server DHCP failover supports only IPv4 scopes. For DHCPv6, redundancy is usually provided by distributing different ranges from the same prefix on two servers, or with a stateless configuration.

When one server goes down, does the other immediately use the whole address pool?

No. The server first moves to the Communication Interrupted state and hands out only addresses from its own share. After moving to the Partner Down state, it starts using the whole pool once the MCLT period has passed.

Can the two servers in a failover be on different Windows Server versions?

Failover can be set up between Windows Server 2012 and later versions. Still, keeping both partners on the same version and update level reduces behavioral differences and the troubleshooting load.

When I add a reservation, does it move to the other server automatically?

No. Reservation, option and exclusion changes aren’t replicated automatically. You need to replicate the relationship or the scope on the server where you made the change.

Support

Contact us for support or a discovery session on this topic.

Contact form
[email protected]

Eretek System Support

Server installation, configuration, incident response and scheduled maintenance. Active Directory, virtualization and backup are managed with the same discipline.

Knowledge Center

Other articles