dhcpcd setup

created onOctober 7, 2025

is the demon responsible for querying a DHCP server (i.e., ISC kea) and configure the machine for the network it is about to join from the lease it receives from the DHCP server. A DHCP lease contains

  • the IP address for a device.
  • the subnet mask.
  • the default gateway.
  • the IP addresses of DNS servers in the network.
  • a unique client identifier (i.e., a hostname).
  • the lease duration – the time duration during which the lease is valid. After the lease is expired, dhcpcd automatically request a new lease.

should not be confused with dhcpd – the latter ist the ISC dhcpd, which reached its EOL in the end of 2022.

starting

start for a specific interface, request a lease for the interface, wait for an address to be assigned before forking to background:

dhcpcd --waitip <interface>

start for a specific interface, immediately fork to background, request no lease for the interface:

dhcpcd -b --inactive <interface>

start for a specific interface, immediately fork to background, request a lease for the interface with a timeout of 10 seconds, write log to file specified in arg :

dhcpcd -b -t 10 --waitip <interface> --logfile <logfile>

renew lease for a specific interface:

dhcpcd -k eth0 && dhcpcd -n eth0
x