Configuring a Kea DHCPv6 Service
kea-dhcp6
service.
- Make a backup copy of the original configuration file.The installed configuration files include comments and example settings that could be helpful as you configure a network. With a backup, you can edit the original copy while preserving the original file contents.
sudo cp /etc/kea/kea-dhcp6.conf /etc/kea/kea-dhcp6.conf.bak
- Open
/etc/kea/kea-dhcp6.conf
, then replace the contents with the following example text:{ "Dhcp6": { "interfaces-config": { "interfaces": [ "<interface-name>" ] }, "lease-database": { "type": "memfile", "persist": true, "name": "/var/lib/kea/kea-leases6.csv" }, "preferred-lifetime": 3000, "valid-lifetime": 4000, "renew-timer": 1000, "rebind-timer": 2000, "option-data": [ { "name": "dns-servers", "data": "<DNS server IP addresses>" } ], "subnet6": [ { "id": 1, "subnet": "<subnet IP address/netmask>", "interface": "<interface-name>", "pools": [ { "pool": "<IP address range>", "user-context": { "charging": true } } ] } ], "loggers": [ { "name": "kea-dhcp6", "output-options": [ { "output": "stdout" } ], "debuglevel": 0, "severity": "INFO" } ] } }
- Replace placeholder values with values that apply to your network.
- Replace the value of
interfaces
with names of interfaces on which you want the service to listen for DHCP messages.For example:"interfaces": [ "eno1" ]
- Review the parameters and values in
lease-database
and make any changes that suit the needs of your network.Consider changing any of the following parameters:-
type
—The type of databasekea-dhcp4
uses.memfile
is the default. In this case, the service keeps lease information in memory and saves the information to a CSV file on disk.If you have set up a MySQL or PostgreSQL database for lease database storage, you can change the value to
mysql
orpostgresql
. See the Kea Administrator's Reference Manual for more information. -
persist
—Boolean that indicates whetherkea-dhcp4
saves lease database information to disk.true
is the default. If you set tofalse
, a system restart would causekea-dhcp4
to lose a record of which IP addresses have been assigned. -
name
—The absolute path to the database file. Kea provides a default CSV file forkea-dhcp6
in/var/lib/kea/kea-leases6.csv
, but you can enter a custom value here.
-
- Review the value of
valid-lifetime
and change the value to suit the needs of your network.Enter an integer representing the number of seconds the leases assigned by the server are valid. - In
option-data
, underdns-servers
replace thedata
value with the IP addresses of name servers you want to use.For example:"name": "dns-servers", "data": "fc00:1:1::10, fc00:1:1::11"
- Replace the
subnet
value with the subnet IP address on your network.For example:"subnet": "fc00:0001:0001::/48",
- Enter the value of network interfaces that connect to the subnet you defined.For example:
"interfaces": [ "eno1" ]
- Replace the
pool
value with a range of IP addresses within the subnet you have defined.For example:"pool": "fc00:1:1::20 - fc00:1:1::1000",
- Review the values in
loggers
and change any values to suit the needs of your network.
- Replace the value of
- Save the configuration file.
- Check the configuration file for syntax errors.
kea-dhcp6 -t /etc/kea/kea-dhcp6.conf
- Enable and start the DHCP service.
sudo systemctl enable --now kea-dhcp6