6

I have setup and configured two DHCP servers on my private network in load balancing mode as outlined in the following technet article: http://technet.microsoft.com/en-us/library/dn338979.aspx

Both VM's are running Windows Server 2012 R2. Since the both DHCP servers are configured in load balancing mode, each VM on the network will get an IP from either of the 2 DHCP servers depending on the load of each.

The problem i'm having is that when i goto configure a reservation on DHCP server #1, the reservation entry doesn't automatically get pushed and updated to the secondary server. I'm trying to set a reservation for one of my VM's on DHCP server #1, but since its getting the IP from DHCP server #2, it doesn't get the proper IP i set in the reservation on DHCP server #1, so DHCP server #2 just gives it a random IP from the pool configured in the scope, and not what i set in the reservation.

My question is:

Is there a way to manually force DHCP reservation changes / updates on DHCP server #1 to DHCP Server #2 so that both servers are in sync with each other? Because right now when i create the reservation on DHCP Server #1, it doesn't automatically get pushed to DHCP server #2.

Any help or advice would be greatly appreciated, thanks!

KabanaSoft
  • 181
  • 1
  • 1
  • 3
  • I suppose this is all good, but consider making DNS resolution and registration reliable instead of relying on DHCP to deliver a specific IP to a specific device. – SpacemanSpiff Jan 28 '14 at 06:12

4 Answers4

2

Thank you for the answer, but I think i found the option i was looking for after digging around a bit.

In the DHCP manager, if you right click on the Scope, there is an option to 'Replicate Scope'. When i chose this option on DHCP Server #1, it appeared to replicate all the current scope settings over to DHCP Server #2, including the reservations i added.

So i think this may be the correct way to do this (please correct me if i'm wrong here), as it seemed to do what i was looking for.

I also found this powershell script that may be useful as well, but haven't tried it out, but might help others who look into this:

http://gallery.technet.microsoft.com/scriptcenter/Auto-syncing-of-configurati-6eb54fb0

KabanaSoft
  • 181
  • 1
  • 1
  • 3
0

Simple solution, no scripting required:

  • If you haven't already, enable the event log: Microsoft-Windows-DHCP Server Events/Operational
  • Read up on event 106 and 107 from source DHCP-Server
    • Hint: These events are logged when reservations are created and removed
  • Create a scheduled task that is triggered on either event
    • Action: powershell.exe -command "Invoke-DhcpServerv4FailoverReplication -force"
  • Add another trigger based on a schedule. Why? Because if someone makes a reservation while the replication is already running it wont run again. My experience is that reservations are only created occasionally and usually one at a time so this works for me. If you are doing a project involving lots of reservations plan on kicking off replication manually or waiting for the schedule.
  • Running failover requires admin rights over DHCP services in AD which by default is only available to Domain Admins. I suggest you get the above working with a domain admin account and then immediately delegate that access to a least privileged service account for production per https://secureidentity.se/delegate-dhcp-admins-in-the-domain/
0

Windows Server 2012R2/2016/2019 supports invoking of the replication via a simple PowerShell cmdlet.

NOTE This is replication, not syncing. So whatever server you replicate the scopes from will fully overwrite the other servers scopes on the target server.

PS C:\> Invoke-DhcpServerv4FailoverReplication -ComputerName dc2 -Confirm:$false -Force

So you can add this to your scheduler and everything will replicate automatically. Thanks to the guys from ugg.li for testing this.

bjoster
  • 4,423
  • 5
  • 22
  • 32
-1

I found this post for replicating between partners http://britv8.com/dhcp-2012-r2-static-reservations-replication-not-working/ It covers 2012 and 2012 R2 replication. You really need to consider one of the partners the primary server and do your changes there, then replicate