Link to home
Start Free TrialLog in
Avatar of bartramg1
bartramg1

asked on

How to delete all scopes from a DHCP server or synchronize servers in diferent subnets

I am running a network with redundant datacenters. I created a scheduled task to export all dhcp scopes from the primary datacenter to the secondary sites using netsh dhcp server commands. This works great for the initial synchronization, but once the other servers have the bulk of the scopes, further imports fail because the scopes already exist. Is there a way to delete all scopes from a dhcp server with a command line so that the import will succeed? Alternatively, is there a way to force the netsh dhcp server \\xxxx import to overwrite existing scopes?

As a last option, does anyone have a better suggestion for keeping multiple dhcp servers in multiple sites in sync?
Avatar of CasUK
CasUK

The best way to keep multiple DHCP servers in sync is not to.

Microsoft's guidelines for administrators who manage multiple DHCP servers is to section the DHCP scope for each server so that they address different parts of a single range.

Read this article, http://www.windowsdevcenter.com/pub/a/windows/2004/04/13/DHCP_Server.html

It's a guide for using the 20/80 rule to maintain DHCP server availability - but the principle is the same for using DHCP servers dotted around different locations.

If you're using Active Directory, DNS does keep in sync, which is the important thing to get right - which it will synchronise across domain controllers if it is integrated into AD.
Avatar of bartramg1

ASKER

Unfortunately in our environment, this is not an option. Each node has to maintain it's IP address no matter which DHCP server is issuing it. So the 80\20 plan won't work for our network, because the node would get a different address from the second DHCP server.

And, no, static addresses and doing away with DHCP is not an option either.
As you need to maintain IP addresses for each node, could you use reserved IP addresses instead?

(I hate static IPs :)
Yes. In fact reserved IP addresses is part of our plan. That's where the 80\20 solution doesn't work in our network is we need to have the reservation for each node to use its own reserved DHCP address regardless of which DHCP server assigns it.

The end purpose behind this is so that we can operate 3 DHCP servers without having to maintain all 3 individually. We can create scopes or reservations on the primary server, and have those additions replicate on a nightly basis to the secondary servers.

I know some of you are probably shaking your heads at how this network can be maintained in this manner. However given our unique requirements for node IP addresses (Which are dictated outside our company, and well above my pay grade) My hope is to devise a replication solution to lessen our administration work rather than increase it.
btw, one of the possible solutions is to maintain mysql database with leases and 3 different dhcp servers working with database instead of lease file.
but this means moving from windows to linux
ASKER CERTIFIED SOLUTION
Avatar of CasUK
CasUK

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Will this work without copying DHCP information from the registry? If so, it sounds like a winner.
Yes - it copies the database of all the assignments, reservations etc.

I've used it in the past to just move DHCP databases, but I think that it will work in your case.

Good luck!