This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

Dhcpcd

From Gentoo Wiki (test)
Jump to:navigation Jump to:search

Dynamic Host Configuration Protocol Client Daemon (net-misc/dhcpcd) is a popular DHCP client. It is capable of handling both IPv4 and IPv6 configurations.

Installation

USE flags

USE flags for net-misc/dhcpcd A fully featured, yet light weight RFC2131 compliant DHCP client

+embedded Embed the definitions of dhcp options in the dhcpcd executable
+udev Enable virtual/udev integration (device discovery, power and storage device support, etc)
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
ipv6 Add support for IP version 6
privsep Enable support for privilege separation

Emerge

Use the following command to install dhcpcd:

root #emerge --ask net-misc/dhcpcd

Configuration

Files

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

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:

FILE /etc/dhcpcd.conf
static ip_address=192.168.0.10/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1

Usage

Invocation

root #dhcpcd --help

Run it as a service

See Network management using DHCPCD.

One-time DHCP

To configure a network interface for one-time DHCP use issue the following command:

root #dhcpcd eth0

Be sure to replace eth0 in the command above with the appropriate network interface name.

Troubleshooting

See also

External resources

References

  1. Jump up to: 1.0 1.1 Roy Marples. DHCPCD.CONF(5), Roy Marples's personal blog, March 9th, 2015. Retrieved on May 07th, 2015.