Re: DHCPv6 addresses being assigned with /128 prefixes
Roy Marples
Fri Sep 29 11:17:26 2017
On 29/09/2017 11:39, Graham Breed wrote:
> On 28/09/17 19:03, harald.albrecht wrote:
>
>> Well, IPv6 addresses don't have prefix lengths outside the Linux kernel universe. Linux uses the prefix length attached to its addresses to autogenerate route table entries ... probably in an attempt to do IPv4 in IPv6. After all, IPv6 is just IPv4 with longer addresses ... what could probably go wrong ;) So with dhcpcd you should never see an address/128. Or am I mixing up the route table entries with the address table entries here, that is, you refer to the routing table entries?
>
> You know, I'm wondering if I've been getting this wrong. I assumed that
> the IP addresses as shown by the "ip address" Linux command should show
> /64 if I know the subnet is /64. But it doesn't seem to matter because
> the routing table knows that the address is in the /64 subnet and does
> the right thing.
Fun fact, all IPv6 addresses are a /128.
If you see anything else such as a /64, this means that the 1st 64 bits
are set by upstream and the last 64 bits are set by the client.
>
> A simple test confirms this: I make two DHCPV6-configured clients and I
> can get an SSH connection from one to the other with no problem. The
> only apparent issue is the output of "ip address".
>
>> From my experience with dhcpcd it correctly creates the required route table entries. And the IPv6 address table just contains /128 addresses, but not any prefix information. But I'm also dazzled why your setup doesn't work. Disclaimer: I use dhcpcd for PD and SLAAC only, never had a need to deploy IA-NAs.
>
> My experience of dhcpcd so far has been that it wasn't working with
> DHCPv6 because we didn't have the router advertisements correct. My
> experience with DHCPv6 was, therefore, with the older versions of
> dhclient that used a /64 in violation of the RFC. So my expectations
> were that a /64 should come back (as it does with SLAAC). But maybe my
> expectations are wrong and this is the way it's supposed to be.
>
> It does make some sense, in that the routing table might be changed
> after the DHCPv6 address is assigned. Choosing a prefix based on the
> routing table at the point the address was assigned doesn't guarantee
> that the prefix will be valid for the whole life of the address. I
> think I set the lifetime of the router advertisement to be longer than
> the lifetime of the DHCPv6 lease, but maybe I missed something, or maybe
> dhcpcd doesn't care.
dhcpcd doesn't care.
Say that the RA lifetime is 60 seconds and the DHCPv6 lease is 30 seconds.
dhcpcd could receive the DHCPv6 lease 1 second before the RA expires.
The DHCPv6 lease is still valid because the address is just one part of
the lease. Other properties such as DNS, FQDN, etc are stil valid and
work fine (as in their details are correct and proper) without the RA
being present.
Roy
Archive administrator: postmaster@marples.name