This is an old revision of the document!

DHCPv6 with Prefix Delegation

AstLinux supports DHCPv6 with Prefix Delegation (DHCPv6-PD) to dynamically assign an IPv6 address to the external interface and optionally assign /64 prefixes to internal interfaces.

The DHCPv6 client daemon is provided by wide-dhcpv6 (with Debian patches) working together with dnsmasq.

Note: AstLinux 1.2.5 or later is required

DHCPv6 Client Configuration

Enable DHCPv6 client on the external interface as follows.

Select the Network Tab in the web interface.
Network Tab

External Interface: → Connection Type:
Select the proper entry containing: DHCPv6

The default DHCPv6 client settings are:
DHCPv6 Network Tab

The default settings should work for most situations. Though the supported values of “DHCPv6 Prefix Length” will vary. The default value of “60” will allow 16 [ie. 2^(64-60) ] unique /64 prefixes for local use.

When DHCPv6 Prefix Delegation is enabled, specify which internal interface(s) should get an automatic /64 prefix. You may enable for multiple interfaces provided the supplied DHCPv6 Prefix Length is less than 64.

Internal Interfaces: → Interface: → IPv6 Autoconfig:
DHCPv6 Internal Interface

Tip → Any associated static IPv6/nn: entry will be ignored if Prefix Delegation is enabled, best practice to leave empty for this case.

Note → A “Reboot System” is required to apply any changes related to DHCPv6.

DHCPv6 Client Action Script

Note: AstLinux 1.2.10 or later is required

If an executable script exists at /mnt/kd/dhcp6c.script the dhcp6c daemon will call the script after a DHCPv6 request is processed.

In order to help coding a script, unique to AstLinux, the following environmental variables will be set when appropriate.

External interface and DHCPv6 assigned address:


Prefix Delegation interfaces and associated IPv6 addresses, a comma-separated list for each:


Assigned Prefix, ex. 2001:0db8:1750:2800::/56


Prefix base string, ex. 2001:0db8:1750:28


Prefix Length as a number, ex. 56


Lastly, an indication whether the DHCPv6 update was different from the previous update:


The dhcp6c_changed can be empty if there was no previous dhcp6c_cache file to compare, “yes” if different from previous, and “no” if the same as previous. The most common use case would be to compare dhcp6c_changed with “no” to skip operations that have been previously performed.

Note → Do not expect all the variables to be always defined, though if dhcp6c_prefix is defined then the complete set will be defined.

As an example, a simple script to log when the DHCPv6 lease is updated and whether it changed:


if [ -n "$dhcp6c_prefix" ]; then
  logger -t dhcp6c -p "Updated with Prefix: $dhcp6c_prefix${dhcp6c_changed:+ changed=$dhcp6c_changed}"

Debugging DHCPv6

DHCP (DHCPv4) has been supported by ISP's in a standard way for a long time, but IPv6 is relatively new and DHCPv6 together with prefix delegation can be problematic. In order to diagnose a problem with your ISP it may be necessary to do some debugging from the CLI.

Debug example using an interactive CLI session, assuming the external interface (EXTIF) is eth0, edit accordingly if different:

/etc/ifplugd/dhcp6c.action eth0 down
dhcp6c -Df -c /etc/wide-dhcpv6/dhcp6c-eth0.conf -p /var/run/ eth0

The dhcp6c process now logs to terminal in foreground with verbose debugging enabled.

When finished, return to normal by …

/etc/ifplugd/dhcp6c.action eth0 up