LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

dhcpcd

DHCP and DHCPv6 client daemon

TLDR

Obtain a lease on a specific interface
$ sudo dhcpcd [eth0]
copy
Release all address leases and exit
$ sudo dhcpcd -k
copy
Request new leases (rebind)
$ sudo dhcpcd -n
copy
Configure IPv4 only
$ sudo dhcpcd -4 [eth0]
copy
Configure IPv6 only
$ sudo dhcpcd -6 [eth0]
copy
Test mode (don't configure, just print variables)
$ sudo dhcpcd -T [eth0]
copy

SYNOPSIS

dhcpcd [options] [interface]

DESCRIPTION

dhcpcd is a DHCP and DHCPv6 client daemon that automatically configures network interfaces. It obtains IP addresses, default routes, and DNS servers from DHCP servers on the network, and can also process IPv6 Router Advertisements for stateless autoconfiguration.The daemon runs in the background managing network configuration as interfaces come up and down. It handles lease renewal, rebinding, and release operations automatically. Configuration hooks allow running custom scripts when network state changes.dhcpcd is commonly used as the default network configuration tool on many Linux distributions, particularly those without NetworkManager. It's lightweight, follows RFC standards closely, and integrates well with embedded and server environments.

PARAMETERS

-k, --release

Release current leases and exit
-n, --rebind
Request new leases (rebind)
-x, --exit
Exit daemon
-d, --debug
Debug mode (don't fork)
-B, --nobackground
Don't run in background
-4, --ipv4only
Only configure IPv4
-6, --ipv6only
Only configure IPv6
-b, --background
Background immediately
-S, --static value
Configure a static DHCP value (e.g., ipaddress, routers, domainname_servers)
-s, --inform address
Send DHCP INFORM instead of DISCOVER/REQUEST
-T, --test
Test mode, don't configure interfaces

CONFIGURATION

/etc/dhcpcd.conf

Main configuration file controlling interface behavior, static addresses, hooks, and client options.

INSTALL

sudo apt install dhcpcd-base
copy
sudo dnf install dhcpcd
copy
sudo pacman -S dhcpcd
copy
sudo apk add dhcpcd
copy
sudo zypper install dhcpcd
copy
nix profile install nixpkgs#dhcpcd
copy

CAVEATS

May conflict with NetworkManager or systemd-networkd. Configuration file is /etc/dhcpcd.conf. Requires root privileges.

SEE ALSO

dhclient(8), nmcli(1), ip(8)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid