[Dnsmasq-discuss] IPv6 constructor option - confused!

Simon Kelley simon at thekelleys.org.uk
Thu May 2 09:36:33 BST 2013


On 01/05/13 16:26, Kevin Darbyshire-Bryant wrote:
> Hi Simon,
>
> I find myself confused by the use of the constructor option for building
> DHCPv6 address ranges.
>
> edited dnsmasq.conf file:
>
> enable-ra
> dhcp-range=tag:br0,::1, ::FFFF, constructor:br0, ra-names, 12h
>
> Now on my Tomato based router this picks up then (tunnelled) ipv6 LAN
> address on the BR0 interface, which happens to be ISP_PREFIX::1  It
> builds a range ISP_PREFIX::1 ->  ISP_PREFIX::FFFF and all is well.
>
> However, others do not have a nice neat '::1' they have (presumably
> because it's been delegated to them by their ISP) something like
> ISP_PREFIX::DEAD:BEEF:F00D.   Now there are two problems as I see it
> with this:
>
> 1) I now need to specify my starting IP address range as DEAD:BEEF:F00D
> otherwise dnsmasq doesn't find the prefix and doesn't serve an IPv6
> addresses at all.  In which case why am I even bothering to tell it the
> interface in the constructor?
>
> 2) The range parameter (:FFFF) implies I can define a range from
> DEAD:BEEF:F00D to DEAD:BEEF:FFFF only with nothing lower than F00D.
>
> I'm sure I'm being stupid here, please educate me.... again :-)
>

I think the root confusion is between a DHCP address lease, and a prefix 
delegation. DHCP leases as we all know them are for an IP address, so 
could indeed be ISP_PREFIX::DEAD:BEEF:F00D. But constructed ranges are 
intended for use with prefix delegation. Here, the ISP leases you not an 
address but a whole prefix: ISP_PREFIX::/64

The prefix size doesn't have to be a /64, but it usually is, and that's 
the only size dnsmasq supports so let's simplify and assume it is.

A prefix delegation of ISP_PREFIX::/64 gives you the use of the whole 
range, ISP_PREFIX::0 to ISP_PREFIX::ffff:ffff:ffff:ffff. You want to use 
this range on a network, so you need to configure the interface in the 
router with an address on the range, but all the addresses are 
available: it's a local choice which one(s) to use, nothing to do with 
the ISP which delegated the prefix.

What chooses the address is the DHCP client which gets the prefix 
delegation, it has to do something with the delegation once it has it, 
in the same way that a DHCP client has to configure an interface once it 
has an address lease. In the case of a prefix delegation, the client has 
to configure an address on  the _internal_ interface, (ie not the one to 
the ISP, where the lease came from) with an address of its choice in the 
delegated range, and maybe set up routing to get packets in the prefix 
to the correct interface.


Cheers,

Simon.



More information about the Dnsmasq-discuss mailing list