Roy Marples’ dhcpcd (DHCP client daemon) is not the same as the discontinued internet Systems Consortium’s dhcpd (DHCP server daemon).
Configuring DHCPCD on a Scaleway Dedibox
- dedibox
- dedicated-servers
- DHCPCD
dhcpcd is an open-source DHCP client, supporting both IPv4, and IPv6. The feature-rich software can be used to configure and automate network-related parameters of your computer using the DHCP protocol.
In this tutorial, you will learn how to configure your IPv6 subnet with DHCPCD on a Scaleway Dedibox dedicated server.
Before you start
To complete the actions presented below, you must have:
- A Dedibox account logged into the console
- A [Dedibox dedicated server] (https://www.scaleway.com/en/dedibox)
- Root access to the server
Installing DHCPCD
- Change the root account of your server by using
su
and the password of theroot
user. - For Debian and Ubuntu, update the
apt
package manager repositories, then upgrade the software already installed on the machine to the latest version available in the repositories:apt update && apt upgrade -y - For Arch Linux, update the
pacman
package manager repositories.pacman -Syu - For Debian & Ubuntu, install DHCPCD using the
apt
package manager:apt install dhcpcd5 - For Arch Linux, install DHCPCD using the Arch Linux package manager:
pacman -S dhcpcd
Configuring DHCPCD
We assume you have already generated an IPv6 prefix and its associated DUID.
-
Open the DHCPCD configuration file located at
/etc/dhcpcd.conf
in a text editor of your choice and edit it as follows:# Allow users of this group to interact with dhcpcd via the control socket.#controlgroup wheel# Inform the DHCP server of our hostname for DDNS.#hostname# This parameter allows only selected interfaces to use the clientallowinterfaces eno*# Use the hardware address of the interface for the Client ID.#clientid# or# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.# Some non-RFC compliant DHCP servers do not reply with this set.# In this case, comment out duid and enable clientid above.duid# Persist interface configuration when dhcpcd exits.persistent# vendorclassid is set to blank to avoid sending the default of# dhcpcd-<version>:<os>:<machine>:<platform>vendorclassid# A list of options to request from the DHCP server.option classless_static_routes# Respect the network MTU. This is applied to DHCP routes.option interface_mtu# Request a hostname from the networkoption host_name# Most distributions have NTP support.#option ntp_servers# Rapid commit support.# Safe to enable by default because it requires the equivalent option set# on the server to actually work.option rapid_commit# A ServerID is required by RFC2131.require dhcp_server_identifier# Generate SLAAC address using the Hardware Address of the interface#slaac hwaddr# OR generate Stable Private IPv6 Addresses based from the DUID#slaac private# Do not attempt to obtain an IPv4LL address if we failed to get one via DHCP. See RFC 3927.noipv4ll# Specify the network interface to which the following configurations applyinterface eno1# Enable IPv6 Router Solicitation (RS) messages on the specified interfaceipv6rs# Request an IPv6 Non-Temporary Address (IA_NA) from the DHCPv6 serveria_na 1# Configure a static IPv6 address on the interface# Replace the "xxxx", "xxx", and "x" placeholder valuesstatic ip6_address=2001:bc8:xxxx:xxx::x/64 -
Write the [DUID] of your subnet in the file
/var/lib/dhcpcd/duid
using a text editor of your choice, for examplenano
:nano /var/lib/dhcpcd/duid -
Enable the DHCPCD service to be started automatically during system boot.
systemctl enable dhcpcd.service -
Start the service manually.
systemctl start dhcpcd.service -
Verify the status of the service.
systemctl status dhcpcd.serviceYou should see an output similar to the following:
● dhcpcd.service - DHCP Client DaemonLoaded: loaded (/lib/systemd/system/dhcpcd.service; enabled; vendor preset: enabled)Active: active (running) since Mon 2021-03-15 15:30:03 CET; 14s agoDocs: man:dhcpcd(8)Process: 22352 ExecStart=/usr/sbin/dhcpcd (code=exited, status=0/SUCCESS)Main PID: 22368 (dhcpcd)Tasks: 1 (limit: 4696)Memory: 1.5MCGroup: /system.slice/dhcpcd.service└─22368 /usr/sbin/dhcpcdMar 15 15:30:13 sd-160847 dhcpcd[22368]: enp1s0: pltime 604800 seconds, vltime 2592000 secondsMar 15 15:30:13 sd-160847 dhcpcd[22368]: enp1s0: sending NA for 2001:bc8:XXXX/64Mar 15 15:30:13 sd-160847 dhcpcd[22368]: enp1s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' ROUTERADVERTMar 15 15:30:14 sd-160847 dhcpcd[22368]: enp1s0: sending NA for 2001:bc8:XXXX/64Mar 15 15:30:15 sd-160847 dhcpcd[22368]: enp1s0: sending NA for 2001:bc8:1600:XXXX/64Mar 15 15:30:16 sd-160847 dhcpcd[22368]: enp1s0: Router Advertisement from fe80::XXXXMar 15 15:30:16 sd-160847 dhcpcd[22368]: enp1s0: adding address 2001:bc8:XXXX/64Mar 15 15:30:16 sd-160847 dhcpcd[22368]: enp1s0: pltime 604800 seconds, vltime 2592000 secondsMar 15 15:30:16 sd-160847 dhcpcd[22368]: enp1s0: sending NA for 2001:bc8:XXXX/64Mar 15 15:30:16 sd-160847 dhcpcd[22368]: enp1s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' ROUTERADVERT
Your server is now ready to communicate with IPv6. For more information about IPv6 at Scaleway Dedibox, refer to our dedicated documentation.