Duplicate Static IPs - Bug?

I'm not sure if this qualifies as a bug, or just plain user stupidity on my part and if I should report it as a bug...
If I create 2 static DHCP leases with the same IP4 address (but different MACs) it appears to crash or disable DHCP. Even if one of those devices is not active. Upon entering and saving/applying the duplicate (thru Luci), DHCP no longer responds or hands out leases, static or dynamic. Furthermore, I could find no entry in the logs to indicate a problem, much less what it was.
I feel that upon trying to save/apply the duplicate, it should validate the entry and the stupid user (me) should get a warning. And/or write a message to the log.
Should I report this or do I just need to be more careful? :smiley:

dnsmasq can do this, but it requires both MAC addresses in the same line, not as separate entries. The same limitation applies to Pi-hole (which uses dnsmasq behind the scenes).

See the dnsmasq man page at https://dnsmasq.org/docs/dnsmasq-man.html for further details.

There are many ways to break configs with syntactically correct but logically incorrect settings.
If you specify the same static IP on 2 different interfaces, that won't work either.
Soft-bricking the device by mistake with firewall rules is also possible.
So, being careful is the right way. :wink:

1 Like

I used to be a developer, retired now. We used to have a saying: "You can't make it idiot proof because the idiots are so ingenious!" So, yeah, you can't watch for every possible dumb user error. And I felt pretty dumb when I finally figured out what I'd done.
In this case tho, it quietly killed DHCP without so much as an whimper (error) (that I could find in the logs) so it seemed to me to be a semi-serious problem for an easy-to-make mistake. My 2 cents.

4 Likes

You probably missed this:

# logread -e dnsmasq
Tue Mar  2 09:51:52 2021 daemon.info dnsmasq[4769]: exiting on receipt of SIGTERM
Tue Mar  2 09:51:55 2021 daemon.crit dnsmasq[4993]: duplicate dhcp-host IP address 192.168.1.22 at line 26 of /var/etc/dnsmasq.conf.cfg01411c
Tue Mar  2 09:51:55 2021 daemon.crit dnsmasq[4993]: FAILED to start up

You probably missed this:
No, didn't miss that, NOT in my logs!