# Ipv6: use delegated prefix from ISP with dhcp6 server



## zirias@ (Apr 23, 2019)

My ISP delegates me a /56 prefix and I successfully used that with `dhcp6c` to assign /64 prefixes to my network interfaces on the router. These are used with `rtadvd` to provide the hosts with SLAAC, so far so good.

Now, this prefix delegation is dynamic and I'd still like to have my hosts in DNS, so I can find them from "outside". So, it would be very nice to use the prefix with dhcpv6 instead of slaac, and let the dhcp6 server do dynamic DNS updates. Looking into this, I found dhcpy6d which allows passing a dynamic prefix on the commandline, therefore I guess I could come up with a script parsing the current prefix from some `ifconfig` output and restart `dhcpy6d` as needed. This however seems "pretty hacky" to me.

Is there a better way to do what I want?

Alternatively, I'm running a samba DC and windows clients already update DNS, but FreeBSD clients (with samba/winbind) don't, is it possible to have them update DNS as well, in which case SLAAC would do for me?


----------



## SirDice (Apr 23, 2019)

This was quite useful for me: https://subatomicsolutions.org/8-freebsd/17-isc-dhcp-ipv4-ipv6-server-on-a-dual-stack-network


----------



## zirias@ (Apr 23, 2019)

SirDice said:


> This was quite useful for me: https://subatomicsolutions.org/8-freebsd/17-isc-dhcp-ipv4-ipv6-server-on-a-dual-stack-network


Looks like a nice how-to for getting DNS updates with the ISC dhcp servers working, so thanks, it might be of use ... but it doesn't have anything to say about using a _dynamic_ prefix for dhcpv6 leases, which is my primary issue here. Of course, I could as well update dhcp6s.conf with a script, which would be "hacky" as well, but it might work...


----------



## SirDice (Apr 24, 2019)

I haven't tried this yet but the ISC DHCP daemon can also do SLAAC. But I'm not sure if it would still register the IP address in DNS. That's something I was planning on trying out next. The referenced howto at least allowed me to register both IPv4 and IPv6 in the same domain, something I wanted to have for a long time.


----------



## denrad (Oct 10, 2020)

Your prefix delegation is assigned by your ISP's DHCPv6 server. AFAIK it be the same lease as the ia-na address you were assigned. It should be perpetual so long as your router is always on and routinely renews it's lease with your ISP's DHCP server(s).

There is no mechanism that I know of that will dynamically register SLAAC addresses in DNS. However your network clients can have both SLAAC assigned (temporary) addresses which _can't_ be easily added to DNS, as well as a DHCPv6 assigned address which *can* be added via DDNS. Following the guide from the link previously posted to setup IPv4 and IPv6 DHCP servers and configure the servers to do all the DDNS updates and deny client updates. Whenever either the DHCPv4 or DHCPv6 server assigns an address to a client it will also use DDNS to add/update their respective A or AAAA host record in DNS.

FreeBSD supports SLAAC natively but the native dhclient does not support acquiring a DHCPv6 address. This article https://subatomicsolutions.org/8-freebsd/13-ipv4-ipv6-client-addresses-via-dhcp details installing and configuring ISC's DHCP client on FreeBSD to acquire a DHCPv6 assigned IPv6 address.


----------

