Chris Carr wrote:
Hi Simon,
Sorry for the delay in getting around to testing this further. I attach
the daemon.log file with log-dhcp switched on. I tested three machines
yesterday, each of which has two entries in /etc/ethers (because they
have two NICs - but only one is ever used at a time):
junior works fine - comes up on .1.17 each time it boots (using its
wireless NIC - I haven't tried the wired one)
tony should come up on .1.10 but gets given .1.104 instead (see 23:32 in
the log)
xaphod should come up on .1.21 but gets given .1.110 instead (see 23:34
in the log)
The problems are different - tony sent a DHCPDISCOVER, but xaphod sent a
DHCPREQUEST. In case it's relevant, tony uses eth0 and xaphod uses eth1.
Each has two wired NICs and no wireless.
Grateful for any further tests to run,
Many thanks,
Chris
Ok, I understand this now: there are two problems.
The fundamental problem is with your strategy of allocating two MAC
addresses to one IP addresses. For most of dnsmasq's life this has been
illegal and your configuration should have provoked an error message or
at least a warning. The lack of a warning is a bug (you'll get one if
you put the host configuration in /etc/dnsmasq.conf, but not when it's
in /etc/ethers)
The reason that this (was) disallowed is that it's unreliable: Assuming
that you nail MAC1 and MAC2 to the same IP address, once MAC1 has a
lease on that address, it's not possible for dnsmasq to then lease the
same address to MAC2 because it has promised the address to MAC1 for the
duration of the lease. So rebooting the machine onto the other network
won't work, unless you wait long enough for the lease to expire. In
general there's no way for dnsmasq to tell that two MAC addresses
represent the same machine. (This case might be an exception since the
common name is a clue, defining the semantics is difficult.)
From dnsmasq version 2.46 this limitation was relaxed, it's now
possible to tell dnsmasq that two MAC addresses belong to the same host
and that there's an implicit promise that the two interfaces will never
be up at the same time. With this promise, dnsmasq behaviour changes so
that when it sees MAC2, it cuts short the lease to MAC1 and gives the
address to the second interface.
To make this work, use dhcp-host in /etc/dnsmasq.conf, and put both MAC
addresses on the same line, so eg
dhcp-host=00:0c:6e:6f:60:67,00:26:54:0e:e1:8c,tony,192.168.1.10
You will need to upgrade to the dnsmasq package in testing.
I'll fix the lack of error messages for the next release.
Cheers,
Simon.
--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org