How to Install and Use IPv6 DHCP on AlmaLinux / Red Hat
This guide explains how to configure DHCPv6 using ISC dhcpd on AlmaLinux or Red Hat–based systems.
It is assumed that you have already installed and configured ISC dhcpd for IPv4. You will also need a private IPv6 subnet (see the referenced blog for generating one).
Overview
- DHCPv6 uses UDP port 546
- IPv6 DHCP requires a separate configuration file
- Router Advertisements (radvd) are required alongside DHCPv6
DHCPv6 Configuration
The main configuration file for DHCPv6 is:
/etc/dhcp/dhcpd6.conf
authoritative;
option dhcp6.name-servers fda8:e166:952c:a267::10, fda8:e166:952c:a267::11;
option dhcp6.domain-search "example.local";
subnet6 fda8:e166:952c:a267::/64 {
range6 fda8:e166:952c:a267::240 fda8:e166:952c:a267::253;
}
#include "/etc/dhcp/dhcpd6.in";
Restart the DHCPv6 service:
systemctl restart dhcpd6
Router Advertisement Daemon (radvd)
DHCPv6 also requires radvd to advertise the IPv6 prefix to clients.
Install radvd:
dnf install radvd
radvd Configuration
Edit /etc/radvd.conf:
interface enp1s0 {
AdvSendAdvert on;
AdvManagedFlag on;
AdvOtherConfigFlag on;
prefix fda8:e166:952c:a267::/64 {
AdvOnLink on;
AdvAutonomous off;
};
};
⚠️ Important:
Change the network interface name and IPv6 subnet to match your system.
Permissions
The radvd.conf file must be owned by the radvd user and group:
chown radvd:radvd /etc/radvd.conf
chmod 400 /etc/radvd.conf
Restart radvd:
systemctl restart radvd
Verifying Operation
You should see DHCPv6 log entries in /var/log/messages, for example:
Jan 15 11:42:22 router dhcpd[8138]: Solicit message from fe80::211:32ff:feb8:1d1b port 546, transaction ID 0x6F9F8C00
Jan 15 11:42:22 router dhcpd[8138]: Advertise NA: address fda8:e166:952c:a267::251 to client with duid 00:03:00:01:00:11:32:b8:1d:1b iaid = 850926875 valid for 43200 seconds
Jan 15 11:42:22 router dhcpd[8138]: Sending Advertise to fe80::211:32ff:feb8:1d1b port 546
Jan 15 11:42:22 router dhcpd[8138]: Request message from fe80::211:32ff:feb8:1d1b port 546, transaction ID 0x968BF400
Jan 15 11:42:22 router dhcpd[8138]: Reply NA: address fda8:e166:952c:a267::251 to client with duid 00:03:00:01:00:11:32:b8:1d:1b iaid = 850926875 valid for 7500 seconds
Jan 15 11:42:22 router dhcpd[8138]: Sending Reply to fe80::211:32ff:feb8:1d1b port 546
For more background information, see:
Static IPv6 Leases
In IPv4, static leases are assigned using MAC addresses.
In IPv6, static leases use the DUID (DHCP Unique Identifier).
To define static leases, uncomment this line in dhcpd6.conf:
#include "/etc/dhcp/dhcpd6.in";
Example Static Lease
/etc/dhcp/dhcpd6.in
host linux {
option dhcp-client-identifier 00:04:9e:27:50:71:12:a7:f3:9c:df:d9:7e:2c:7b:a4:9f:ee;
fixed-address6 fda8:e166:952c:a267::117;
}