[Dnsmasq-discuss] Possible lease matching/reuse bug

Geert Stappers stappers at stappers.nl
Tue Sep 8 12:24:20 BST 2020


On Tue, Sep 08, 2020 at 11:31:27AM +0100, Jerome Vuarand wrote:
> 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.

Manual page snippet from http://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html

 --dhcp-host=[<hwaddr>][,id:<client_id>|*][,set:<tag>][tag:<tag>][,<ipaddr>][,<hostname>][,<lease_time>][,ignore]
   text ... allocated the same hostname, IP address ... more text ...


It says provide server side with information how to identify client side
so it can do the wanted assignment



Groeten
Geert Stappers
-- 
Silence is hard to parse



More information about the Dnsmasq-discuss mailing list