[Dnsmasq-discuss] dhcp-host problem/questrions

Gene Czarcinski gene at czarc.net
Wed Dec 19 16:21:49 GMT 2012


On 12/19/2012 08:20 AM, Simon Kelley wrote:
> On 19/12/12 11:06, Gene Czarcinski wrote:
>> I need dsmasq's dhcp service to provide "nailed" (that is, fixed) IPv4
>> and IPv6 addresses to a NIC on a specific system.  My reasons for
>> needing this are to have a single point where this is specified amd to
>> keep the general general usefullness while having a fixed address that
>> can be used fro routing.
>>
>> For IPv4, I have been using something like:
>> dhcp-host=00:11:22:33:44:55,aloha,192.168.22.2,12h
>>
>> and for IPv6, something like:
>> dhcp-host=alpha,[fd00:10:11:12::2:2],12h
>>
>> THe dnsmasq man page implies that the following is possible but I have
>> not tried it:
>> dhcp-host=00:11:22:33:44:55,alpha,192.168.22.2,12h,[fd00:10:11:12::2:2],12h
>>
>> or maybe it should be specified as (I am not clear about this and have
>> not tried it):
>> dhcp-host=00:11:22:33:44:55,alpha,192.168.22.2,[fd00:10:11:12::2:2],12h
>>
>> OK for IPv4 with the MAC-address specification, this seems to work very
>> reliably and I have not had a problem.  However for IPv6 where the only
>> thing used is the host's name, I have had a undesirable incident (cause
>> unknown) where the IPv6 got a valid IPv6 address assigned by DHCPv6 but
>> it wass not the "nailed" address while the IPv4 address continue to have
>> effect.
>>
>> I believe that once alpha got the wrong IPv6 address, it continued to as
>> k for it and dnsmasq continued to provide it rather than the "nailed"
>> address.
>>
>> Is there a way to for dnsmasq to hand out the "nailed" IPv6 address no
>> matter what alpha is asking for?  If not a guarantee  the at least
>> improve the chance that the right thing is done.
>>
>> That last example above, is that a good way?  Or, do  I need to use the
>> dhcpv6.client-id?
> You can't use the MAC address with DHCPv6, since the MAC address is not
> provided to the DHCP server. (there is some standards activity that
> might change this in some circumstances, but not at present)
Yes, I knew that but I hoped that specifying both ipv4 and ipv6 might 
provide better linage.
>
> Using the hostname is just as good, as long as the DHCPv6 client always
> send the hostname. If not then the only alternative is the client-id.
Yes, I believe I just figured out when things got screwed up.  For 
testing, I installed F18-beta and, naturally, it does not come with the 
NetworkManager that makes dynamic DNS work.  That is when things much 
have changed.
>
> There is a big difference between DHCPv4 and DHCPv6 that might affect
> this. A DHCPv4 client can only have one DHCP lease and therefore one
> DHCP address. If the client has a lease for address other then the
> nailed address, dnsmasq, will refuse to renew the lease, forcing the
> client to get a new address and move to the nailed address.
>
> DHCPv6 is designed to provide a client with many addresses: just because
> a client has a lease on a non-nailed address, doesn't stop if from
> requesting the nailed address too, so the "refuse to renew lease"
> behaviour detailed above for DHCPv4 is _not_ implemented  for DHCPv6.
> This may be relevant in this case.
>
> This is a manifestation of a bigger difference between IPv4 and IPv6.
> DHCPv6 addresses are much more ephemeral, and a host will likely have
> many of them at any time (from router advertisements, privacy
> extensions, DHCPv6, ULA.......) Schemes which relay on fixed mappings
> between hosts and IP addresses don't tend to work as well from IPv6.
> It's not just IPv4 with bigger addresses. (sadly).
>
For my purposes, I just might have to use the dhcpv6.client-id.

For my mods to libvirt, I am using the hostname because I figured that 
the client-id might be difficult for the user.  I may have to reconsider 
that.

Give what you say above about DHCPv6, what needs to be specified by 
dhclient so that it can get nailed-address if one is available?  If it 
just asks for all of the addresses, how will it know the correct one to use?

Gene



More information about the Dnsmasq-discuss mailing list