I have a linux server which acts as a dhcp server. Dhcp lasse range is 10.15.0.50 - 10.15.255.250. The first ip it leased is 10.15.80.10 Is there any specific reason for this? It keeps leasing ips lik 10.81 .82 and so on.
1 Answer
My understanding is that addresses are no longer assigned (or "offered") sequentially, but are rather from a hashed selection of the range. This means that a DHCP client could be offered any of the available addresses, and the next client could be offered any other. If they seem to be sequential after the first, that may be coincidence, or some artifact of the hashing used, but in any case as long as all the addresses offered are in the expected range I wouldn't worry about it.
https://linux.die.net/man/5/dhcpd.conf says:
The DHCP server generates the list of available IP addresses from a hash table. This means that the addresses are not sorted in any particular order, and so it is not possible to predict the order in which the DHCP server will allocate IP addresses. Users of previous versions of the ISC DHCP server may have become accustomed to the DHCP server allocating IP addresses in ascending order, but this is no longer possible, and there is no way to configure this behavior with version 3 of the ISC DHCP server.
ip addr
.