[Dnsmasq-discuss] Possible lease matching/reuse bug

Jerome Vuarand jerome.vuarand at gmail.com
Tue Sep 8 11:31:27 BST 2020


On Tue, 8 Sep 2020 at 09:36, john doe <johndoe65534 at mail.com> wrote:
>On 9/8/2020 9:19 AM, Jerome Vuarand wrote:
>> I believe I'm triggering a bug where a static dhcp-host config does't
>> seem to match the existing lease the second time that client connects.
>>
>> I'm running dnsmasq from a Raspberry Pi acting as a WiFi access point.
>> I have a mixture of IoT devices connecting to it. I'd like most
>> clients to get a dynamic IP address, but some to get a static one
>> based on their name, so I use a combination of dhcp-range and
>> dhcp-host. I have the following config:
>>
>> interface=ap0
>> dhcp-range=192.168.4.100,192.168.4.250,255.255.255.0,24h
>> domain=example.com
>> dhcp-script=/home/pi/my_web_ui/dnsmasq_script
>> dhcp-leasefile=/var/run/dnsmasq.leases
>> dhcp-host=target
>>
>> And I have an entry in /etc/hosts that associate target to
>> 192.168.4.2, the dnsmasq server itself is 192.168.4.1.
>>
>
> Are you seeing the same thing if you do:
>
> 'dhcp-host=target,192.168.4.2'

The problem happens too, yes.

> The above assumes that the hosts file does not contain the Ip in question.

I tested both cases, and all 4 combinations are problematic. Obviously
with no hosts entry and no ip in dhcp-host dnsmaq has no way to know
what IP I want to assign, but all three other combinations have the
intermittent problem.



More information about the Dnsmasq-discuss mailing list