[Dnsmasq-discuss] dhcpv6 problem with static allocations and "no addresses available"

Carlos Carvalho carlos at fisica.ufpr.br
Wed Oct 21 23:18:42 BST 2015


Simon Kelley (simon at thekelleys.org.uk) wrote on Wed, Oct 21, 2015 at 07:51:32PM BRST:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> 
> 
> On 20/10/15 22:33, Carlos Carvalho wrote:
> > I'm stumbling on an important problem that looks like a bug in
> > dnsmasq. Clients declared statically in a zone are being denied
> > their address with the message "no addresses available":
> > 
> > Oct 20 09:56:10 dnsmasq-dhcp[18342]: 6947286 available DHCPv6
> > subnet: 2801:82:80ff:7f05::/64 Oct 20 09:56:10 dnsmasq-dhcp[18342]:
> > 6947286 vendor class: 40712 Oct 20 09:56:10 dnsmasq-dhcp[18342]:
> > 6947286 client MAC address: 10:bf:48:71:65:99 Oct 20 09:56:10
> > dnsmasq-dhcp[18342]: 6947286 DHCPSOLICIT(meteo)
> > 00:01:00:01:1d:a8:3f:4a:10:bf:48:71:65:99 Oct 20 09:56:10
> > dnsmasq-dhcp[18342]: 6947286 DHCPADVERTISE(meteo)
> > 00:01:00:01:1d:a8:3f:4a:10:bf:48:71:65:99 no addresses available 
> > Oct 20 09:56:10 dnsmasq-dhcp[18342]: 6947286 tags: known, dhcpv6,
> > meteo Oct 20 09:56:10 dnsmasq-dhcp[18342]: 6947286 sent size: 14
> > option:  1 client-id  00:01:00:01:1d:a8:3f:4a:10:bf:48:71:65:99 Oct
> > 20 09:56:10 dnsmasq-dhcp[18342]: 6947286 sent size: 10 option:  2
> > server-id  00:03:00:01:00:24:8c:0c:37:90 Oct 20 09:56:10
> > dnsmasq-dhcp[18342]: 6947286 sent size: 24 option: 13 status  2 no
> > addresses available
> > 
> > Note that the client is recognized because the known tag is set.
> > The dhcp config is the following:
> > 
> > interface=meteo dhcp-range=::,constructor:meteo,static,infinite 
> > enable-ra dhcp-range=192.168.5.1,static
> > 
> > dhcp-host=cobb,192.168.5.11,[2801:82:80ff:7f05:12bf:48ff:fe71:6599],10
> :bf:48:71:65:99,id:00:01:00:01:1d:a8:3f:4a:10:bf:48:71:65:99
> >
> > 
> [other dhcp-host declarations]
> > 
> > dhcp-host=elbrus,192.168.5.75,[2801:82:80ff:7f05:12bf:48ff:fe79:aa07],
> 10:bf:48:79:aa:07,id:*
> >
> >  At first I tried to use only id:* for all machines but started
> > getting refusals like the above. I noticed that the DUID was
> > changing, so I fixed it in the client. Still got sporadic refusals
> > (it doesn't happen everytime?!). Then I put the full id in the
> > config as shown above for host cobb. Even then dnsmasq is refusing
> > it. How can this be? Also, the refusal is for IPv6 only.
> 
> Maybe there are leases for old UIDS and the static address still the
> database?

No, I start dnsmasq without any lease. Just noticed that I didn't include a few
lines of the config, sorry. Here it is, complete:

interface=meteo
dhcp-range=::,constructor:meteo,static,infinite 
enable-ra
dhcp-range=192.168.5.1,static

dhcp-host=cobb,192.168.5.11,[2801:82:80ff:7f05:12bf:48ff:fe71:6599],10:bf:48:71:65:99,id:00:01:00:01:1d:a8:3f:4a:10:bf:48:71:65:99

[other dhcp-host declarations]

dhcp-host=elbrus,192.168.5.75,[2801:82:80ff:7f05:12bf:48ff:fe79:aa07],10:bf:48:79:aa:07,id:*

# extra config lines missed in first email
log-dhcp
dhcp-authoritative
dhcp-lease-max=250
dhcp-ignore=#known
dhcp-ignore-names
no-ping
leasefile-ro
domain=my.domain
dhcp-option=option:ip-forward-enable

Note that only known machines are accepted. The lease-max is 250 but there are
only 7 dhcp-host declarations (2 of them are listed above). Since only
statically declared machines are accepted I use leasefile-ro, so there are no
disk files and when the process starts there are no leases.

> > There's no collision with other declarations omitted above, I
> > checked with grep.
> > 
> > This is important because these hosts are diskless and without the
> > IP they cannot access the root server and thus don't boot.
> > 
> > On a related issue, is it possible to always use only the hardware
> > address for dhcpv6 and not the full DUID? In my case it may happen
> > when diffent programs are used for requests, such as UEFI firmware
> > and linux in diskless stations. Since the machine doesn't have
> > permanent storage it's difficult to keep the DUID constant.
> 
> 
> Yes, in general. The DHCPv6 spec makes it hard, but dnsmasq will allow
> you to use just the MAC address to identify DHCP hosts even for
> DHCPv6. If you are using a DHCPv6 relay, then the relay has to add an
> option which specifies the MAC address. If  network is directly
> connected to the DHCP server, then it should Just Work with recent
> dnsmasq releases.

Good. There are no relays so when we solve the current issue I can go back to
using id:*. I'm running 2.74-rc2.



More information about the Dnsmasq-discuss mailing list