
Configuring DHCP server failover
Prior to Server 2012, there were limited methods of ensuring DHCP was redundant and always available to service requests. One of the most common methods was to split DHCP scopes between multiple servers, with each server providing a subset of the scope. If one system was unavailable, the other system was still able to provide a subset of addresses. However, this caused problems because if a DHCP server was unavailable, there may not be enough addresses available to service all of your clients. Other redundancy options involved clustering or other expensive technologies that were difficult to manage.
In Server 2012 DHCP server failover is a built-in feature. This feature allows servers to share a common DHCP database to provide leases and provide redundancy. To use DHCP failover, the DHCP feature just needs to be installed and configured across servers. This recipe will walk through the configuration of DHCP failover.
Getting ready
This recipe assumes a server, networking, and domain configuration similar to what is created in the Installing domain controllers recipe. A minimum of two servers will be needed to configure as DHCP servers. Additionally, it assumes one of the domain controllers already has DHCP installed and configured.
How to do it...
Carry out the following steps to configure DHCP server failover:
- Install DHCP on the second server either locally or remotely:
Install-WindowsFeature dhcp -IncludeAllSubFeature -ComputerName corpdc2
- Authorize DHCP on the second server:
Add-DhcpServerInDC -DnsName corpdc2.corp.contoso.com
- Configure DHCP failover:
Add-DhcpServerv4Failover -ComputerName corpdc1 -PartnerServer corpdc2 -Name Corpnet-Failover -ScopeId 10.10.10.0 -SharedSecret 'Pa$$w0rd!!'
How it works...
The first and second steps are responsible for installing and authorizing DHCP on CorpDC2
. This is the same process used in the previous recipe to install DHCP on the first domain controller. Once installed, we use Add-DhcpServerInDC
to authorize the server to act as a DHCP server.
The third step calls Add-DHCPServerv4Failover
to configure DHCP failover across CorpDC1
and CorpDC2
. This command identifies the scope 10.10.10.0
for failover and configures a shared key for authenticating communication between the servers.
At this point the failover configuration is complete and both DHCP servers will begin providing addresses. If you open the DHCP administration console, you will see that both domain controllers have DHCP installed and servicing clients. Additionally, you will see that both servers have the same client lease information, making the solution truly redundant:
