[Dnsmasq-discuss] Using IPv6 DHCP

Gene Czarcinski gene at czarc.net
Tue Oct 2 04:36:42 BST 2012


On 10/01/2012 04:43 PM, Simon Kelley wrote:
> On 01/10/12 21:13, Sean Boran wrote:
>> "I have not tested dnsmasq to see if it could provide the RA, dhcp, 
>> and dns
>> services for IPv6 but I am interested that it would."
>>
>> It can do RA, but I disabled it, as I did on my router. For me it was
>> necessary on my Ubuntu client to prevent it having a SLAAC address.
>>
>> I'd not noticed the route issue though, and
>> dhcp-option=option6:router
>> can't be used with an Ipv6 address. oops.
>>
>> Enabling RA in dnsmasq, with dhcp , and setting the network manager 
>> to auto
>> in Ubuntu 12.04 causes SLAAC addresses (2) to be assigned and the 
>> default
>> route to work.
>>
>> Hmm. I'd like to assign specific, not slaac addresses, but of course a
>> default route too.
>>
>
> You're right that there's no DHCPv6 option for default route: that has 
> to come from RA. It is possible to do RA broadcasts and tell the 
> client to use them for getting a default route, but not a SLAAC 
> address, so that the address stuff happens by DHCPv6. That mode is 
> what dnsmasq does on a subnet where there is an IPv6 dhcp-range, and 
> enable-ra is set.

OK, RA for default route and dhcp-6 for IPv6 address and dns update ... 
this does work.

This was developed and tested running Fedora 17 although it should/will 
work for other systems.  The system runs NetworkManager.  A patch I 
developed is currently in the process of being integrated.  This patch 
enhances NetworkManager so that dynamic DNS is supported.  This has been 
tested with both radvd/dnsmasq and radvd/named/dhcpd/dhcpd6 providing 
the services.

Just dhcpd6 does not work because it does not provide any routing info.  
NetworkManager uses their "auto" configuration to use dhcp6 (via 
dhclient6) to provide the IPv6 address and update the dns and to use RA 
(from radvd) to provide the default route.

Here is the critical info:
https://fedoraproject.org/wiki/Tools/NetworkManager/IPv6

Scroll down to "DHCPv6 address and DNS configuration".
>
> /etc/radvd.conf:
>
> interface eth0 {
>      AdvSendAdvert on;
>      AdvManagedFlag on;
>      prefix 2001:db8:1:2::/64 {
>          AdvAutonomous off;
>      };
> };
>
> /etc/dhcp/dhcpd6.conf:
>
> subnet6 2001:db8:1:2::/64 {
>      option dhcp6.name-servers 2001:db8:1:2::ab;
>      option dhcp6.domain-search "example.net";
>      range6 2001:db8:1:2::1:0000 2001:db8:1:2::1:ffff;
> }
>
> This is a typical DHCPv6 configuration. Note that routing information 
> are stil delivered through Router Advertisements. NetworkManager may 
> fail in this scenario.
>
>
I was initially surprised: it works just like you would like it to.

Now, this works with radvd and dnsmasq.  The question is whether dnsmasq 
could do the same thing for RA while continuing to do the dhcpd/dhcpd6 
and dynamic dns stuff so that it was unnecessary to run radvd.  This 
works on an IPv6-only network.

Gene





More information about the Dnsmasq-discuss mailing list