On Mon, 2009-07-13 at 15:00 +0100, Simon Kelley wrote:
> 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.

Many thanks for such a prompt reply.

> 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.)

Ok, I understand the limitation - but are you sure that this explains
the behaviour in this case? I have never used the second NIC on tony,
not since the machine was built ~6 years ago. So the problem is arising
even when only one interface is ever used. If I've understood the above
correctly, this shouldn't happen, surely?

(I think it does explain the different behaviour on xaphod, because I
think I have swapped the NICs in use there.)

>  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.

Ok. Where will that leave my /etc/hosts and /etc/ethers files - will
they be needed at all? (The latter will still be used by etherwake, but
will either be used at all by dnsmasq?)

One final question, which I'm not sure is related: how can I ensure that
dnsmasq returns the FQDN when hostname -f is called on the server? At
the moment it only returns the hostname (baba) without the domain name.
Where do I set the domain name for dnsmasq to pick it up?

Thanks again,

CC




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to