For the first time, WS 2012 R2 offers a true DHCP failover and load balance solution that works. After recently migrating to Windows Server 2012 R2 DHCP, I went a step further to configure failover to a partner server with the following steps:
1) Log in to the primary Windows Server 2012 R2 DHCP server and verify that the DHCP server scopes and options are setup correctly and running.
2) Log in to the target DHCP partner server. Configure a static IP address on this server. Install the DHCP service and authorize the server after the role installation. Note that no scopes or options are configured at this time :
Install-WindowsFeature -Name dhcp -Restart -IncludeAllSubFeature -IncludeManagementTools -Verbose
3) Authorize the partner DHCP Server:
Add-DhcpServerInDC -DnsName infra03.labnet.net -Verbose
4) Run the following powershell cmdlet to configure Dhcp failover in Hot-Standby mode (Active-Passive):
Add-DhcpServerv4Failover -ComputerName dhcp00 -Name Dhcp00-Infra03-Failover -PartnerServer infra03 -ScopeId 10.0.0.0,10.0.5.0,10.0.6.0,10.0.22.0 -ServerRole Active -Verbose
5) Run the
Get-DhcpServerv4Failover cmdlet to display the current properties for the Failover Configuration and it’s current state:
In one case, while testing, I encountered an “Error 20010 failed to get option definition for option id 249 on dhcp server dhcp00.labnet.net. : the specified option does not exist. (20010).”
In this scenario, I used the DHCP snapin. In the DHCP snap-in on the primary server, right-click the IPv4 container and choose “Set Predefined Options”, then scroll through values in the “Option Name” drop down box with the keyboard arrows or mouse wheel until you see the “Delete” button light up (that’ll be a custom value). Hit Edit and copy the values down, then in the same place on the partner server, hit Add and enter the custom values.
I am yet to find a way to locate custom DHCP options using powershell.