On 01.06.2016 20:57, Thomas Andersen wrote: > When assigning IP for a client, will dhcp lease always overrule host > reservation? It's complicated. In general, adding reservations for an address that is used by someone else it a bad idea. Kea will sort that out, but it needs some time for that (up to 2x renew-timer).
If you added reservation for an address that is currently leased by someone else, Kea will sort that out eventually. Existing user of the address will not be able to renew it. laptop2 will get a different address until the reserved address is in use by laptop1. This is explained in http://git.kea.isc.org/~tester/kea/guide/kea-guide.html#reservation4-conflict. > My scenario is as follows: > > My laptop (laptop1) had a host reservation for a specific IP. > > I then get a new laptop (laptop2) and therefor change my host > reservation to match the mac address for laptop2. > > For some reason I don’t get the intended IP assigned for laptop2. I > found out that there was an active lease for that IP by laptop1 who > had it assigned by host reservation prior. > > Is this working as intended? Yes. > I expected, that because of the change in the host reservation, KEA > would ignore the current leases and assign the IP to laptop2 despite > of the lease for laptop1. That wouldn't work. Just because you changed reservation, the laptop1 will not magically stop using the address. laptop1 still thinks he's entitled to use the address he got for its lease lifetime. Had Kea assigned it to laptop2 as you suggested, laptop2 would discover duplicate addresses, would report to Kea that the address is declined and the reservation wouldn't work anyway. So what Kea will do: 1. try to assign reserved address to laptop2, but discover it's used by laptop1. will temporarily assign a different address to laptop2. 2. when laptop1 tries to renew, it is NAKed. 3. The laptop1 will restart and get a different address. At this point the address that was "occupied" by laptop1 becomes free. 4. Once laptop2 renews, it is also NAKed. 5. laptop2 restarts. Kea now sees that it has a reservation and that the address is free, so assigns it to laptop2. This is not the fastest recovery procedure, but the safest one. It's also fully autonomous, so does not require any manual intervention. Personally I think about this as Kea cleaning up the mess sysadmin did :) Hope that helps, Tomek _______________________________________________ Kea-users mailing list [email protected] https://lists.isc.org/mailman/listinfo/kea-users
