7

I am testing the implementation of IPv6 in Ubuntu. My Ubuntu linux client correctly gets RA from server and configures an address in the advertised prefix. Next it gets another address via DHCP which has a /128 mask.

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether f8:a9:63:0c:3c:cb brd ff:ff:ff:ff:ff:ff
    inet6 2001:xxxx:1f15:yyyy::9/128 scope global 
       valid_lft forever preferred_lft forever
    inet6 2001:xxxx:1f15:yyyy:faa9:63ff:fe0c:3ccb/64 scope global dynamic 
       valid_lft 82162sec preferred_lft 10162sec
    inet6 fe80::faa9:63ff:fe0c:3ccb/64 scope link 
       valid_lft forever preferred_lft forever

I am intrigued by the /128 mask for this address, which implies a point-to-point link. Why is the mask /128 and not, say /64?

Is this the normal behavior of DHCPv6 or some thing to do with the configuration of my DHCP server?

alexander.polomodov
  • 1,060
  • 3
  • 10
  • 14
Raj
  • 173
  • 1
  • 3

1 Answers1

6

Yes, this is the normal behaviour. DHCPv6 servers give out addresses (with the IA_NA option) but don't tell the client anything about the subnet. The client therefore just configures the separate address on the interface. Any routes to the subnet are provided by RA. If the RA would announce the prefix without the auto-configure option then the client wouldn't configure an address automatically, but it would add the route for the local subnet.

This separation of responsibilities is intentional. DHCPv6 servers have the authority to assign addresses (amongst other things) but don't have the authority to speak about the network status. Often DHCPv6 servers are not even on the local subnet and communicate with the client via relays. The devices that the client does talk directly to are the routers. Therefore in IPv6 the routers tell clients about the status of the network (prefix, default gateway, routes etc) using RA. Extra configuration options and optionally address assignments are done form the DHCP server.

That way the client can respond quickly to changes in the network, while still receiving more long-lived information from DHCPv6.

Sander Steffann
  • 7,572
  • 18
  • 29
  • The statement _Any routes to the subnet are provided by RA_ is not clear. AFIK RA has prefixes from which the client can generate an IP. DHCPv6 gives out a single IP (ie no subnet invloved). There is no connection between the IP assigned by DHCPv6 and prefix advertised by RA. Please correct if I am wrong here. – Raj Jun 28 '18 at 05:28
  • 1
    You're slightly wrong :) RA plays a more important role than you describe. It provides the default gateway, a router can announce more specific routes it can handle, and which prefixes are used. For each of those prefixes it tells the receiver whether they are on-link (whether a route should be created for the prefix directly to the interface) and whether clients can use it for creating their own addresses. You can therefore announce an on-link prefix without autoconf with RA and let DHCPv6 give out address within that prefix. – Sander Steffann Jun 29 '18 at 19:08