[Dnsmasq-discuss] Using IPv6 DHCP

Simon Kelley simon at thekelleys.org.uk
Tue Sep 25 13:53:29 BST 2012


On 25/09/12 13:38, Sean Boran wrote:
> Hi,
>
> Ah. Its works, magic. 'Doh', as they say over the water).
> So, I should use the option ra-names?

No point. ra-names enables a rather clever hack, but it's only useful 
for client systems which use DHCPv4 for IPv4 address allocation, and 
SLAAC (ie Router advertisements) for IPv6 allocation. A typical example 
being most Android devices.

What happens is that when a client does DHCPv4, that gives dnsmasq the 
name of the client, its MAC address and the network segment it lives on. 
Dnsmasq looks for a dhcp-range declaration on the same segment with an 
IPv6 subnet and ra-names. If found that allows dnsmasq it infer what 
SLAAC address the client has picked for itself by combining the subnet 
address with the MAC address, suitably mangled. Dnsmasq  pings that 
address, and if it get a reply, it assumes it guessed right, and adds 
the clients name and the SLAAC address into the DNS. This allows IPv6 
naming for clients which don't use DHCPv6, but do use DHCPv4.

>
> I now see logs like:
> Sep 25 13:57:39 sisdns6 dnsmasq-dhcp[2282]: 14525054 DHCPSOLICIT(eth0)
> 00:01:00:01:00:50:10:5a:de:08
> Sep 25 13:57:39 sisdns6 dnsmasq-dhcp[2282]: 14525054
> DHCPADVERTISE(eth0) 2001:918:ffcb:199::16 00:01:00:01:00:50
>   :10:5a:de:08
> And the test client has correctly received 2001:918:ffcb:199::16.
>
>
> However, if I may piggyback a question, how do I get this into DNS?
>
> host 2001:918:ffcb:199::16 localhost
> Using domain server:
> Name: localhost
> Address: 127.0.0.1#53
> Aliases:
> Host 6.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.9.1.0.b.c.f.f.8.1.9.0.1.0.0.2.ip6.arpa
> not found: 3(NXDOMAIN)
>
> Hmm. Looking at /var/lib/misc/dnsmasq.leases there is a star for the hostname.
> So maybe the problem is ubuntu not sending a hostname.
> Is there any additional option to allow dnsmasq to be more inventive
> in finding out the hostname to map?

dhcp-host can be used to provide the name from the dnsmasq end: This 
works great for DHCPv4, where it allows the client's name and 
MAC-address to be associated. The definers of DHCPv6, in their wisdom, 
didn't make allowance for the DHCP server to use the MAC address: it's 
function is replaced by the client-id, and you can associate a name with 
a client-id fine. Unfortunately, client-ids are typically neither as 
easy to discover, or as stable, as MAC addresses.

If you want to configure dhclient on Ubuntu, the magic looks like

send fqdn.fqdn "spike.thekelleys.org.uk";

> Of make dnsmask log what details it has received in the request?

It does log the name: there's an example in your log from the windows 
machine:

Sep 25 09:31:56 sisdns6 dnsmasq-dhcp[8850]: 13135453 client provides
name: myhost.mydomain.net

Cheers,

Simon.

>
>
> Thanks,
>
> Sean
>
>
>
>
>
>
> On 25 September 2012 13:45, Simon Kelley<simon at thekelleys.org.uk>  wrote:
>>   Doh!
>>
>> I didn't read your config carefully enough. You're declaring the dhcp-range
>> as "ra-stateless", which tells dnsmasq to advertise that subnet via
>> router-advertisements, and set the bits which tell the clients to use DHCPv6
>> for configuration, but not address allocation.
>>
>> Clients are expected to send DHCP information-requests for DNS servers, NTP
>> servers, etc, etc, but won't get IP addresses allocated via DHCPv6. Hence
>> dnsmasq is refusing to allocate and address.
>>
>> Remove ra-stateless from your config and it will all work.
>>
>>
>> (On the v6-only question, if you don't supply a DHCPv4 address range, then
>> dnsmasq won't reply to DHCPv4 requests.
>>
>> Cheers,
>>
>> Simon.
>>
>>
>> On 25/09/12 10:41, Sean Boran wrote:
>>>
>>> Hi,
>>>
>>> On 25 September 2012 10:27, Simon Kelley<simon at thekelleys.org.uk>  wrote:
>>>>
>>>> On 25/09/12 09:10, Sean Boran wrote:
>>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>> I'm doing sdome DHCPv6 tests and have a few questions :-)
>>>>>
>>>>> First is it is possible to disable v4 respond, and only respond to v6
>>>>> requests? When testing I dont want to disturb a v4 dhcp already
>>>>> running.  (e.g. should I set listen-address to my IPv6 address?)
>>>>
>>>>
>>>>
>>>> If you're happy to use the very latest code, then grab 2.64test5 and add
>>>> dhcp-ignore=!DHCPv6
>>>>
>>>> to your configuration.
>>>
>>>
>>> I also disable "enable-ra", since ra should not be needed, when using
>>> dhcp?
>>>
>>>
>>> Sep 25 11:33:55 sisdns6 dnsmasq[9577]: started, version 2.64test5
>>> cachesize 150
>>> Sep 25 11:33:55 sisdns6 dnsmasq[9577]: compile time options: IPv6
>>> GNU-getopt no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack
>>> Sep 25 11:33:55 sisdns6 dnsmasq-dhcp[9577]: DHCPv6 stateless on
>>> 2001:918:ffcb:199::10
>>> Sep 25 11:33:55 sisdns6 dnsmasq-dhcp[9577]: SLAAC on
>>> 2001:918:ffcb:199:: prefix valid 1d
>>>
>>>
>>>>>
>>>>> Secondly, I'm having issues assigning v6 addresses.
>>>>>
>>>>> compiled dnsmasq-2.63, config:
>>>>> --
>>>>> domain=mydomain.net
>>>>> dhcp-range=2001:918:ffcb:199::10, 2001:918:ffcb:199::20, ra-stateless,
>>>>> 24h
>>
>>                                                               ^^^^^^^^^^^
>>
>>>>> dhcp-sequential-ip
>>>>> enable-ra
>>>>> dhcp-option=option6:dns-server,[::]
>>>>> log-dhcp
>>>>> --
>>>>>
>>>>
>>>> Does the relevant interface have an address on the 2001:918:ffcb:199::
>>>> subnet, and prefix length 64?
>>>
>>>
>>> Yes.
>>>
>>>    ifconfig
>>> eth0      Link encap:Ethernet  HWaddr 00:50:56:83:3a:d4
>>>             inet addr:10.90.199.11  Bcast:10.90.199.255  Mask:255.255.255.0
>>>             inet6 addr: 2001:918:ffcb:199:fc54:9480:e886:e639/64
>>> Scope:Global
>>>             inet6 addr: 2001:918:ffcb:199:250:56ff:fe83:3ad4/64
>>> Scope:Global
>>>             inet6 addr: fe80::250:56ff:fe83:3ad4/64 Scope:Link
>>>
>>>
>>>>
>>>> Please could you try without the dhcp-sequential-ip option. That's
>>>> unlikely
>>>> to have been well tested for DHCPv6, and smells suspicious to me.
>>>>
>>>> Cheers,
>>>>
>>>> Simon.
>>>
>>>
>>> Thanks done that, but no change really.
>>>
>>> Sep 25 11:38:46 sisdns6 dnsmasq-dhcp[937]: 7022133 available DHCP
>>> range: 2001:918:ffcb:199::10 -- 2001:918:ffcb:199::20
>>> Sep 25 11:38:46 sisdns6 dnsmasq-dhcp[937]: 7022133 DHCPSOLICIT(eth0)
>>> 00:01:00:01:00:50:10:5a:de:08
>>> Sep 25 11:38:46 sisdns6 dnsmasq-dhcp[937]: 7022133 requested options:
>>> 24:domain-search, 39:FQDN, 23:dns-server,
>>> Sep 25 11:38:46 sisdns6 dnsmasq-dhcp[937]: 7022133 requested options:
>>> 31:sntp-server
>>> Sep 25 11:38:46 sisdns6 dnsmasq-dhcp[937]: 7022133 tags: DHCPv6, eth0
>>> Sep 25 11:38:46 sisdns6 dnsmasq-dhcp[937]: 7022133 sent size: 10
>>> option:  1 client-id  00:01:00:01:00:50:10:5a:de:08
>>> Sep 25 11:38:46 sisdns6 dnsmasq-dhcp[937]: 7022133 sent size: 14
>>> option:  2 server-id  00:01:00:01:17:f2:f6:90:00:50:56:83:3a:d4
>>> Sep 25 11:38:46 sisdns6 dnsmasq-dhcp[937]: 7022133 sent size: 40
>>> option:  3 ia-na  IAID=1451433281 T1=0 T2=0
>>> Sep 25 11:38:46 sisdns6 dnsmasq-dhcp[937]: 7022133 nest size: 24
>>> option: 13 status  2 No addresses available
>>> Sep 25 11:38:46 sisdns6 dnsmasq-dhcp[937]: 7022133 sent size: 16
>>> option: 23 dns-server  2001:918:ffcb:199:fc54:9480:e886:e639
>>>
>>> Regards,
>>>
>>> Sean
>>>
>>
>




More information about the Dnsmasq-discuss mailing list