How to Configuring and Installing High Availability of DHCP using Windows Server 2012
DHCP is often the one thing a IT Pro just runs as next, next, I agree,
But there is this big question Did you Know ?
DHCP failover in Windows Server 2012 enables administrators to deploy a highly resilient DHCP service to support a large enterprise without the challenges of the options discussed earlier. The main goals of the feature are the following:
- Provide DHCP service availability at all times on the enterprise network.
- If a DHCP server is no longer reachable, the DHCP client is able to extend the lease on its current IP address by contacting another DHCP server on the enterprise network.
The DHCP server failover feature provides the ability to have two DHCP servers provide IP addresses and option configuration to the same subnet or scope, providing for continuous availability of DHCP service to clients. The two DHCP servers replicate lease information between them, allowing one server to assume responsibility for servicing of clients for the entire subnet when the other server is unavailable. It is also possible to configure failover in a load-balancing configuration with client requests distributed between the two servers in a failover relationship.
DHCP failover in Windows Server 2012 provides support for a maximum of two DHCP servers, and the failover relationship is limited to IPv4 scopes and subnets. Network nodes using Internet Protocol version 6 (IPv6) typically determine their own IPv6 address using stateless IP auto configuration. In this mode, the DHCP server delivers only the DHCP option configuration, and the server does not maintain any lease state information. A high availability deployment for stateless DHCPv6 is possible by simply setting up two servers with identical option configuration. Even in a stateful DHCPv6 deployment, the scopes do not run under high address utilization, which makes split scope a viable solution for high availability.
So how do we start go to the add roles and add DHCP
For the command line users, DHCP PowerShell provides the following PowerShell cmdlets for setting up and monitoring failover:
- Add–DhcpServerv4Failover – Creates a new IPv4 failover relationship to a DHCP server
- Add–DhcpServerv4FailoverScope – Adds the specified scope(s) to an existing failover relationship
- Get–DhcpServerv4Failover – Gets the failover relationships configured on the server
- Remove–DhcpServerv4Failover – Deletes the specified failover relationship(s)
- Remove–DhcpServerv4FailoverScope – Removes the specified scopes from the failover relationship
- Set–DhcpServerv4Failover – Modifies the properties of an existing failover relationship
- Invoke-DhcpServerv4FailoverReplication – Replicates scope configuration between failover partner servers
In powershell the installation of the two options is easy
powershell Add-WindowsFeature RSAT-DHCP
powershell Add-WindowsFeature DHCP
or both options at the same time.
powershell Add-WindowsFeature dhcp,rsat-dhcp
Remember I use two servers in this demo and on both you should install the roles !
The first two things I would do is change the database backup path to your location or just leave it to the designed location.
The Second part is change the binding of the DHCP server if you have multiple IP’s on the machine you should use only the IP address that the DHCP should use.
Configuring the Failover
the following example, two DHCP servers simultaneously provide IP addressing to clients on a single subnet.
If this step fails you need to install the dhcp role on the partner server
You can select the mode that you want to use load balance or hot standby
and you can adjust the scope as you desire
The wizzard does the configuration and you are done. the config is done on both servers.
in the failover properties you can see what partner there is and made some adjustments
press edit all the options are here in one screen to adjust the dhcp server
You can easy change from load balance mode to hot standby
Most forgotten item !
in the advanced pane you can change this.
If you change the configuration it needs to replicate the config
Now we are all set ready to configure the scope and yes you need to authorize the server and activate the scope
The scopes on both servers
Go to the replication relationship and you can see the configuration.
But is is just two dhcp servers and how does the cluster fit in ?
still there are two servers to manage and it can be in two data centers but what if you already have a fine datacenter and you can use clustering.
Clustered DHCP servers
In this case I will not show you how to create a cluster. you can see this in my other blog posts.
Start up the failover manager and add roles and select the dhcp server and the wizard installs the dhcp role n the cluster.
you will need a dhcp server name and IP and a disk that holds the DHCP database.
Easy setup and easy to manage. there are multiple configurations for this and can be just the way you want this
Happy giving IP’s