There are various reasons for wanting to resynchronize a failover pair of DHCP servers. These include:
Hardware failure - one server is offline for a long time while it is replaced
Configuration error (changes or migrations) causing issues such as both servers believing that they are the primary for one or more address ranges
Migration
If the requirement is (for whatever reason) to manually trigger a re-synchronization, then assuming that the primary server is correct, on the secondary (or vice versa):
Stop dhcpd.
Delete the leases file.
Create an empty leases file, such as the example in the dhcpd.leases(5) manual:
# touch /var/state/dhcp/dhcpd.leases
.If the peer had been placed in partner-down state using OMAPI or through lease file editing, return the peer to normal state.
Restart dhcpd.
This will cause the secondary to refresh the leases file entirely from the primary. (This is sometimes called "faulting the database.")
dhcpd.conf
but are maintained solely in the leases file (usually created there via direct edit or OMAPI, or possibly by the dhcpd.conf
infinite-is-reserved option). Our best recommendation in such a case is to edit the leases file manually, or for a large server, use awk, perl or another scripting tool of choice to save and then restore the reserved leases before restarting the server whose lease database is to be 'faulted'.