[Dnsmasq-discuss] Defending IP address
Johan Vromans
jvromans at squirrel.nl
Sat May 6 18:52:38 UTC 2023
On Sat, 6 May 2023 19:03:21 +0200, Geert Stappers wrote:
> Let's assume there is
>
> } xx:xx:xx:xx:xx:aa,192.168.1.10,dnsmasq.squirrel.nl,24h
True. System name is srv1 but that does not matter.
> > # Addresses for dynamic hosts.
> > dhcp-range=192.168.1.33,192.168.1.50,6h
>
> Now we known that .10 is *outside* the DHCP range.
As I mentioned earlier...
> My stab on how it breaks:
> * a new DHCP client asks for 192.168.1.10
It does not ask -- that would be a DHCPREQUEST, e.g.
DHCPREQUEST(eth0) 192.168.1.10 xx:xx:xx:xx:xx:xx
If merely says 'I have' (claims).
> * dnsmasq unaware that 192.168.1.10 is intended for its self
If it were a DHCPREQUEST, dnsmasq would DENY since the address is tied to
a different mac.
But it's not. It is totally unrelated to dnsmasq. It is dhcpcd that reacts
to the 'claim'.
> There is an unknown ascpect on this interesting problem:
> Why are the IoT devices asking for 192.168.1.10?
The suspect IoT devices run ESPHome on BK7231 chips. Support for these
chips is under development. They still crash frequently. My guess is that
the device stores the IP number of the DHCP/DNS server somewhere in flash
and when recovering from a crash by mistake take this to be their own
address.
Preliminary conclusion is that 1. dnsmasq is not involved, and that 2.
dhcpcd may be behaving according to the rules. In short:
* The system starts, dhcpcd starts, and brings up the interface with the
static address 192.168.1.10 as configured in /etc/dhcpcd.conf . (I don't
think it does DHCP since it has a static address.)
* Some time later, someone else tells dhcpcd "Hey! *I* am 192.168.1.10"
* If within 10 seconds there is a second "Hey! *I* am 192.168.1.10" dhcpcd
assumes it is not correctly configured and drops the interface.
For my setup the correct solution is, as Geoff mentioned, to disable
dhcpcd and set the static address in /etc/network/interfaces instead.
As for the probably misbehaving IoT devices, I have filed and issue at the
developer site.
-- Johan
More information about the Dnsmasq-discuss
mailing list