[Dnsmasq-discuss] using DHCP with virtual interfaces

Tom Metro tmetro+dnsmasq at gmail.com
Thu Apr 2 21:13:14 BST 2009


Simon Kelley wrote:
> Tom Metro wrote:
>> Sending discover...
>> Sending select for 192.168.0.203...
>> Received DHCP NAK
>> Received a NAK: address reserved
>> [...etc...]
>>
>> which works fine to obtain an address for the primary interface on the 
>> Ubuntu server. My expectation was that when Dnsmasq was presented with 
>> an alternate hostname it would not match the above rule, and instead 
>> issue a new IP address from the dynamic pool.
> 
> I'm pretty sure that this is an instance of 
> https://bugs.launchpad.net/ubuntu/+source/dnsmasq/+bug/327703

Looks like it. Seems oddly coincidental that I rand across this long(?) 
standing bug only a month after someone else spotted it and reported it.


> It would be great if you could test
> http://www.thekelleys.org.uk/dnsmasq/test-releases/dnsmasq-2.48test9.tar.gz
> and check that this fixes things.

That fixed it. Thanks!

On the first try, udhcpc reported:

Sending discover...
Sending discover...
Sending select for 192.168.0.235...
Lease of 192.168.0.235 obtained, lease time -1

And I wondered why there were two discovers. Looking at the Dnsmasq logs 
showed:

dnsmasq-dhcp[3337]: not using configured address 192.168.0.204 because 
it is leased to 00:0d:...:89:a2

appearing just before each of the DHCPDISCOVER packets were logged. this 
warning was a direct result of the dhcp-host line I added for the 
alternate host name in an attempt to get it to work. I had mistakenly 
picked an IP address already in use. Though I'm not sure why this would 
have triggers a double discover/offer exchange. The offer sent appears 
to have been identical (according to the logs), and was eventually 
accepted by udhcpc.

I removed the unnecessary dhcp-host line, restarted Dnsmasq, and tried 
again. This time it worked on the first try:

Sending discover...
Sending select for 192.168.0.235...
Lease of 192.168.0.235 obtained, lease time -1

So looks like that fixed it. (And on a side note, udhcpc correctly 
configured the virtual interface, so it is a viable workaround for 
Ubuntu's buggy ifconfig.)

  -Tom

-- 
Tom Metro
Venture Logic, Newton, MA, USA
"Enterprise solutions through open source."
Professional Profile: http://tmetro.venturelogic.com/



More information about the Dnsmasq-discuss mailing list