At $former_employer, I modified the OpenBSD dhcpd to understand Option 82 and do address assignment directly on that. As a matter of policy, "if you're coming in on connection X, you have the address assigned to X and if you use a switch to connect multiple computers, that's your own problem", and then just direct assignment based on that.
If you start seriously messing around with Option 82 assignment, it's probably worth doing this. Wasn't too hard, but wasn't trivial either.
This is probably not the best way to solve this problem but it worked. Here's what I did.
1) I added the following restriction to my Debian-based DHCP server and removed all of the fixed-address entries. This forces any clients in those IP ranges to move somewhere into the .41 - .199 range, otherwise when I turn on the Windows Server clients will receive leases with IPs in the .11 - .40 range that are already present on the network. I then let things sit long enough for any leases in that IP range to expire and have a new one issued.
subnet 192.168.61.0 netmask 255.255.255.0 {
option routers 192.168.61.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.61.255;
pool {
range 192.168.61.0 192.168.61.40;
deny all clients;
}
pool {
range 192.168.61.41 192.168.61.199;
}
}
I could not figure out a way to make the Windows Server DHCP implementation act as "authoritative"; the behavior I wanted is when clients with leases from the old Debian-based DHCP server sent their DHCPINFORM packets to the new Windows Server, I wanted those clients to receive a DHCPNAK and the go through the whole process again to get a lease, thus "re-populating" the addressing space from .11 and up.... regardless, continuing on.
2) I cheated by expanding the Exclusion range on the new Windows DHCP server to include 192.168.61.100 - 192.168.61.199. This will force any clients who were assigned an IP in that range by the Debian-based DHCP serve to have their DHCPINFORM denied and then issued a new lease at the "bottom" of the addressing space (.11 and greater).
3) At this point I simply turned the Debian DHCP server off, and the Windows Server on and let the expiry time sort things out. Because of the "deny all clients" line in my dhcpd.conf, there were no clients with "old leases" in the .11 - .40 addressing space that could cause an IP conflict, and because of the Exclusion of .100 - .199 ranges all DHCPINFORM requests were denied (at least I imagine that's what happened... I didn't bother looking at the transaction using a packet sniffer... I probably should of) and the addressing space was re-populated starting from the lower bound of .11.
Best Answer
As MadHatter mentioned in a comment, the leases file is periodically re-created to avoid this problem. While the period isn't mentioned in the documentation, discussions on the dhcp-users mailinglist indicates that it should be done once an hour, and I've checked the source code and found that this is correct.
Unfortunately this isn't a configurable option. In order to change it, you'd need to compile the dhcp server from source. In the file
server/db.c
you'd need to change the lineto the number of seconds you'd prefer.