Dhcpcd
Dynamic Host Configuration Protocol Client Daemon (net-misc/dhcpcd) is a popular DHCP client capable of handling both IPv4 and IPv6 configuration.
Installation[edit | edit source]
USE flags[edit | edit source]
USE flags for net-misc/dhcpcd A fully featured, yet light weight RFC2131 compliant DHCP client
debug
|
Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces |
embedded
|
Embed the definitions of dhcp options in the dhcpcd executable |
ipv6
|
Add support for IP version 6 |
privsep
|
Enable support for privilege separation |
udev
|
Enable virtual/udev integration (device discovery, power and storage device support, etc) |
Emerge[edit | edit source]
Use the following command to install dhcpcd:
root #emerge --ask net-misc/dhcpcdConfiguration[edit | edit source]
Files[edit | edit source]
All dhcpcd configuration can be set in the /etc/dhcpcd.conf file, but for most installations dhcpcd will work out of the box presuming most computers nowadays are behind a router or access point running a DHCP server. Though man 5 dhcpcd.conf[1] will be helpful in case advanced configuration is required.
Static IP addresses[edit | edit source]
In case the network interface card should be configured with a static IP address, add their data to /etc/dhcpcd.conf.[1] The following is an example of manually adding a static address, routes, and DNS by editing DHCPCD's configuration file using a text editor of choice:
/etc/dhcpcd.confstatic ip_address=192.168.0.10/24 static routers=192.168.0.1 static domain_name_servers=192.168.0.1
Usage[edit | edit source]
Invocation[edit | edit source]
root #dhcpcd --helpusage: dhcpcd [-46ABbDdEGgHJKkLnpqTVw]
[-C, --nohook hook] [-c, --script script]
[-e, --env value] [-F, --fqdn FQDN] [-f, --config file]
[-h, --hostname hostname] [-I, --clientid clientid]
[-i, --vendorclassid vendorclassid] [-l, --leasetime seconds]
[-m, --metric metric] [-O, --nooption option]
[-o, --option option] [-Q, --require option]
[-r, --request address] [-S, --static value]
[-s, --inform address[/cidr]] [-t, --timeout seconds]
[-u, --userclass class] [-v, --vendor code, value]
[-W, --whitelist address[/cidr]] [-y, --reboot seconds]
[-X, --blacklist address[/cidr]] [-Z, --denyinterfaces pattern]
[-z, --allowinterfaces pattern] [interface] [...]
dhcpcd -k, --release [interface]
dhcpcd -U, --dumplease interface
dhcpcd --version
dhcpcd -x, --exit [interface]
Run it as a service[edit | edit source]
See Network management using DHCPCD.
One-time DHCP[edit | edit source]
To configure a network interface for one-time DHCP use issue the following command:
root #dhcpcd eth0Be sure to replace eth0 in the command above with the appropriate network interface name.
Troubleshooting[edit | edit source]
See also[edit | edit source]
- Gentoo Handbook - Network configuration - The Handbook's recommendations on handling network interfaces.
- Netifrc โ Gentoo's default framework for configuring and managing network interfaces on systems running OpenRC.
- Network management using DHCPCD โ explains how to use dhcpcd for complete network stack management.
- Complete Handbook/Configuring the system#Networking information
External resources[edit | edit source]
- Dhcpcd on the Arch Wiki
- Forums post: No Internet access when update to dhcpcd 6.10.0
- DHCP on Wikipedia
- RFC 2131
References[edit | edit source]
- โ 1.0 1.1 Roy Marples. DHCPCD.CONF(5), Roy Marples's personal blog, March 9th, 2015. Retrieved on May 07th, 2015.