[Dnsmasq-discuss] Sequential IP doesn't look for unused IPs
Albert ARIBAUD
albert.aribaud at free.fr
Sat Dec 24 23:11:49 GMT 2016
Bonjour,
Le Sat, 24 Dec 2016 16:15:23 -0500
Alec Robertson <alecrobertson13 at gmail.com> a écrit:
> My apologies for the unclear explanation.
>
> For background I am using OpenWRT/LEDE r2544-a032940, on a TP-LINK
> Archer C7.
>
> For a test, if you set the leasetime to be very short, say 2 minutes
> and connect multiple devices, they will at first be given IPs in
> sequential order starting from the lowest allowed IP address, say
> 192.168.0.20. So, the next device will be 192.168.0.21, the next
> 192.168.0.22 and so on…
>
> If the device at 192.168.0.20 gets disconnected for over 2 minutes,
> its lease expires. If the device reconnects to the network, it will
> be given the IP address say 192.168.0.24, despite 192.168.0.20 being
> available. The next new device added to the network will be given
> 192.168.0.25.
>
> So, 192.168.0.20 will never be assigned again, unless the network is
> entirely reset, i.e. dnsmasq is completely reset back to defaults.
>
> Does that make a bit more sense?
It is certainly much more unambiguous, and appears to be consistent with
my very first analysis of your problem.
You seem to be thinking that (with --dhcp-sequential-ip, which I assume
is specified in the case you describe) dnsmasq should have reused the
IP address 192.168.0.20 as soon as possible after it was released.
Now let's see the dnsmasq manpage description of --dhcp-sequential-ip:
Dnsmasq is designed to choose IP addresses for DHCP clients
using a hash of the client's MAC address. This normally allows a
client's address to remain stable long-term, even if the client
sometimes allows its DHCP lease to expire. In this default mode
IP addresses are distributed pseudo-randomly over the entire
available address range. There are sometimes circumstances (typ-
ically server deployment) where it is more convenient to have IP
addresses allocated sequentially, starting from the lowest
available address, and setting this flag enables this mode. Note
that in the sequential mode, clients which allow a lease to
expire are much more likely to move IP address; for this reason
it should not be generally used.
Clearly, the documentation tates that a client which releases an IP
address is likely to move IP address -- IOW, if IP address 192.168.0.20
is released, then it is likely that it *won't* be allocated again soon.
This description is contrary to what you seem to be expecting.
I do therefore stand by my initial comment : I suspect you are making
an inexact assumption as to how --dhcp-sequential-ip works.
Amicalement,
--
Albert.
More information about the Dnsmasq-discuss
mailing list