[Dnsmasq-discuss] dnsmasq should support duplicate ip addresses in /etc/ethers or warn about them

Simon Kelley simon at thekelleys.org.uk
Sun Jul 5 20:38:39 BST 2009


Felix Schwarz wrote:
> How does dnsmasq behave if there are multiple lines in /etc/ethers which
> reference the same ip address (with different mac addresses)?
> 
> It looks to me as if dnsmasq would just use the last one. I would like to see
> that both items would be valid (e.g. laptop with wlan+lan always gets the same
> ip without any client-side configuration a la client-id). If you don't like
> this, please add a warning while parsing /etc/ethers so that the administrator
> will be aware of this problem....

The lack of a warning is an oversight. I've fixed that.

You have to be careful with this. If dnsmasq leases an IP address to a
MAC address (say the wlan address of the laptop) for (say) 10 hours, and
then the lan MAC address comes along then dnsmasq can't give the IP
address to the lan MAC, because it already promised it to the wlan MAC
for the next 10 hours. From two lines in /etc/ethers it has no way to
know that they are the same machine.

There is a way to tell dnsmasq to terminate a lease early and give the
same IP to another MAC, you have to do

dhcp-host=<wlan MAC>,<lan MAC>,<IP address>

By putting both MACs on one line, you're telling dnsmasq that only one
will be active at a time and that it's OK to dump a lease for one MAC to
give it to the other one. This works with any number of MAC addresses,
not just two.

Cheers,

Simon.





More information about the Dnsmasq-discuss mailing list