3.116. <AddressAllocator DHCPv6>

AddressAllocator DHCPv6 works in conjunction with <AuthBy DYNADDRESS> (see Section 3.53. <AuthBy DYNADDRESS>) and a DHCPv6 server to dynamically allocate IPv6 addresses, IPv6 delegated prefixes and to request other configuration information from the DHCPv6 server.
AddressAllocator DHCPv6 has been tested with a number of DHCPv6 servers, however it has been mostly tested the DHCP server from the Internet Software Consortium (ISC). For more information, see ISC website Opens in new window. Version 4.3.3 or later is recommended.
AddressAllocator DHCPv6 makes the following allocation variables available for replies. The allocation variables names are case insensitive DHCPv6 option names without the leading ‘OPTION_’. These names can be by default used in MapAttribute in AuthBy DYNADDRESS.
An example AddressAllocator DHCPv6 configuration file can be found in the distribution in the file goodies/addressallocatordhcpv6.cfg.
An example ISC DHCP server configuration file can be found in the distribution in the file goodies/addressallocatordhcpv6-dhcpd.conf.
Because AddressAllocator DHCPv6 binds to the DHCPv6 server address, it is not possible to run the DHCPv6 server on the same host as Radiator.
PoolHint supplied in the AuthBy DYNADDRESS clause for the purposes of allocation is sent to the DHCPv6 server with OPTION_USER_CLASS. Some DHCPv6 servers may not be able to use this option. For this reason PoolHint is also sent with OPTION_CLIENTID. For more information, see Section 3.116.8. DHCPClientIdentifier.
Because the DHCPv6 address allocator binds to DHCPv6 client port 546, Radiator must be run as root, or at least with suitable privileges.

3.116.1. Identifier

This mandatory parameter specifies a symbolic name for this AddressAllocator clause. It must exactly match the Allocator parameter in an AuthBy DYNADDRESS in order for it to be used to allocate addresses.
Identifier        dhcpv6allocator

3.116.2. Host

The host name or IP address of the DHCP server. Hostname of the DHCP server to use. Defaults to All_DHCP_Relay_Agents_and_Servers (ff02::1:2). Radiator will allocate an address from the first DHCPv6 server to answer a solicit request.
# Use ALL_DHCP_Servers address
Host ff05::1:3

3.116.3. Port

The UDP port number on the DHCPv6 server. Defaults to port 547.
Port 67

3.116.4. ClientPort

The local UDP port number to send DHCPv6 messages from. Defaults to port 546.
Port 68

3.116.5. LocalAddress

The local IP address to bind to. Defaults to the IPv6 wildcard address. Consider using interface's link-local address.
You can always use the link-local address of the interface for LocalAddress. Using link-local address is preferred and limits the set of addresses Radiator listens on to the smallest number of possibilities. The default value for LocalAddress is ::, the IPv6 wildcard address.
On Linux and macOS, you can configure 'LocalAddress ::'. On Windows, you need to set LocalAddress to the link-local address of the interface Radiator shares with the DHCPv6 server. Using global address may also work on all operating systems.
LocalAddress fe80::dead:beff:feef:1234

3.116.6. InterfaceName

InterfaceName defines the interface for sending DHCPv6 requests. There is no default.
InterfaceName currently works only on Linux. On Linux, InterfaceName value must be the interface shared with the DHCPv6 server.
InterfaceName or InterfaceIndex is needed to select the correct interface for link-local communication with the DHCPv6 server.
InterfaceName eth0

3.116.7. InterfaceIndex

On macOS and Windows you need to set InterfaceIndex. On macOS, the interface index numbering typically follows ‘ifconfig -a’ output with the first interface having index number 1. On Windows, run ‘netstat -nr’ to display the interface index numbers.
InterfaceName or InterfaceIndex is needed to select the correct interface for link-local communication with the DHCPv6 server.
InterfaceIndex 4

3.116.8. DHCPClientIdentifier

The Client Identifier to be used by the DHCPv6 server to track allocations. Sent by Radiator with OPTION_CLIENTID. Defaults to the user name in the current request followed by PoolHint: %{User-Name}-%{Reply:PoolHint}.
DHCPClientIdentifier %{User-Name}-pool-%{Reply:PoolHint}

3.116.9. DefaultLease

Specifies the default lease period requested. If SessionTimeout is set by a previous AuthBy then that is used as the expiry time. Defaults to one day (86400 seconds).
DefaultLease 86400

3.116.10. Synchronous

Normally DHCPv6 requests are processed asynchronously. This optional parameter can be used to make the requests synchronous.

3.116.11. UserClass

This optional parameter can be used to specify a User Class to be passed to the DHCP server to assist with address allocation. Any text and/or Radiator special characters are permitted. Refer to the DHCP server documentation for further details regarding the use of classes.
UserClass %{Client:Identifier}

3.116.12. AllocateDoneHook

AllocateDoneHook provides access to the received DHPCPv6 reply and allows modifying the results after Radiator has processed them, but before they are passed to AuthBy DYNADDRESS and made available for MapAttribute. The option values are in their native format. See the relevant RFCs for the details.
This example requires domain_list is specified with MapAttribute. Radiator will not otherwise request OPTION_DOMAIN_LIST from DHCPv6.
# Domain list is in RFC 1035 format. Format it later.
AllocateDoneHook sub { my $result = $_[0]; my $reply = $_[1]; \
my @o = $reply->option($Radius::DHCPv6::OPTION_DOMAIN_LIST); \
$result->{domain_list} = $o[1] if $o[0]; }