Does OS X have a builtin DHCPv6 client?

Solution 1:

Currently OS X does not have a DHCPv6 client built in. Note that in OS X the IPv4 configuration gives you a choice of manual, DHCP, DHCP with manual DNS, BOOTP, or off. The IPv6 choices are manual, automatic, link-local, and off. The "Automatic" is not DHCP, it's autoconfig from a router.

With IPv6, there are multiple ways to get an address. OS X doesn't use DHCPv6, it uses Autoconfiguration (routers provide the information). Windows Vista & Windows 7 both use DHCPv6. But typically routers doing autoconfiguration and DHCPv6 servers don't talk to each other, so collisions and confusion are possible.

This is one of the ugly parts of IPv6 that isn't widely communicated. See http://arstechnica.com/business/2010/09/there-is-no-plan-b-why-the-ipv4-to-ipv6-transition-will-be-ugly/2/ for more info on this.

Solution 2:

Actually yes it does have a DHCPv6 client. I have verified in 10.8.4 but the email thread referenced above talks about it working with Lion too.

To get it to work, you need to set the IPv6 configuration to "automatic" and then on your router, you also need to configure the routing announcements to indicate that hosts should use DHCP to obtain an address. I believe that's what they're referring to in those emails where they say they've got it working with Lion.

Relevant extract from that email (since links may die eventually):

Quick testing shows that when "Automatic" is used for the IPv6 setting, OS X will correctly look at the A, M, and O flags of an IPv6 RA and make use of DHCPv6 when instructed to.

As an example, on a Cisco ASA 5505 running software version 9.1, you'd need something like this:

interface Vlan1
 nameif inside
 security-level 100
 ipv6 address 2001:db8:1234:1::1/64
 ipv6 nd managed-config-flag
 ipv6 nd other-config-flag

The managed-config-flag is the "m" flag and the other-config-flag is the "o" flag from that email. You might or might not need both, depending on what you want to do.

Don't forget that if your DHCP server is on another interface you'll also need something like:

ipv6 dhcprelay server 2001:db8:1234:2::2 dhcpinterfacename
ipv6 dhcprelay enable inside

So yes, DHCPv6 client, but needs a little help from routers on the network. I can't help feeling it's a bit of a mess, but it works.

Note that you'll also get the EUI-64 address and the privacy extension address in addition to the DHCPv6 assigned address. I don't know how to turn them off I'm afraid. In particular, at the moment, I don't know how the OS decides which one to use for outbound connections, which could present some problems.

Solution 3:

Mac OS X has definitely DHCPv6 support. I currently use ISC-DHCPD in combination with radvd on my Raspberry Pi as home Router. It is important that the M and the O Flag are set for route advertisement. That instructs to "switch" to DHCPv6. Radvd then advertises the default route (because, providing the route via DHCPv6 is currently not defined as a final standard). Remaining information is then provided via DHCPv6.

I only have Apple clients in my office environment and it works like a charm. Even my iPad and iPhone get leases via DHCPv6.

Here is an example configuration (I build it on raspbian, another OS with radvd and isc-dhcpd should also do it):

radvd.conf:

interface wlan0
{
    AdvSendAdvert on;
    AdvManagedFlag on;
    AdvOtherConfigFlag on;

    prefix 2001:1234:5678:9abc::/64
    {
        AdvOnLink on;
                AdvAutonomous off;
                AdvRouterAddr off;
    };

The important flags O and M are set with these directives:

AdvManagedFlag on;
AdvOtherConfigFlag on;

dhcpd6.conf:

ddns-update-style interim;    
allow leasequery; 
default-lease-time 600;
    max-lease-time 7200;    
    authoritative;   
    log-facility local7;

subnet6 2001:1234:5678:9abc::/64 {
    range6 2001:1234:5678:9abc::10 2001:1234:5678:9abc::ff;
    option dhcp6.name-servers 2001:4860:4860::8888, 2001:4860:4860::4444;
    option dhcp6.domain-search "example.com";
    option dhcp6.fqdn "example.com";

    allow unknown-clients;
}