dhcpcd の概要

dhcpcd は、RFC2131 にて定義されている DHCP クライアントの実装です。 DHCP クライアントは、DHCP を利用してネットワークアドレスが割り当てられたネットワークへのアクセスに用いられます。 dhcpcd は十分な機能を有すると同時に、大変軽量な DHCP クライアントです。

本パッケージは LFS-8.0 において正しくビルドでき動作することが確認されています。


dhcpcd の依存パッケージ


LLVM-4.0.1 (Clang 込み)

ユーザー情報: http://wiki.linuxfromscratch.org/blfs/wiki/dhcpcd

dhcpcd のインストール

以下のコマンドを実行して dhcpcd をビルドします。

./configure --libexecdir=/lib/dhcpcd \
            --dbdir=/var/lib/dhcpcd  &&


root ユーザーになって以下を実行します。

make install


--libexecdir=/lib/dhcpcd: The default /libexec is not FHS-compliant. Since this directory may need to be available early in the boot, /usr/libexec cannot be used either.

--dbdir=/var/lib/dhcpcd: The default /var/db is not FHS-compliant

--with-hook=...: You can optionally install more hooks, for example to install some configuration files such as ntp.conf. The set of hooks is in the dhcpcd-hooks directory in the build tree.

dhcpcd の設定




If you want to configure network interfaces at boot using dhcpcd, you need to install the systemd unit included in blfs-systemd-units-20160602 package by running the following command as the root user:

make install-dhcpcd

Whenever dhcpcd configures or shuts down a network interface, it executes hook scripts. For more details about those scripts, see the dhcpcd-run-hooks and dhcpcd man pages.



The default behavior of dhcpcd sets the hostname and mtu settings. It also overwrites /etc/resolv.conf and /etc/ntp.conf. These modifications to system files and settings on system configuration files are done by hooks which are stored in /lib/dhcpcd/dhcpcd-hooks. Setup dhcpcd by removing or adding hooks from/to that directory. The execution of hooks can be disabled by using the --nohook (-C) command line option or by the nohook option in the /etc/dhcpcd.conf file.



Make sure that you disable the systemd-networkd service or configure it not to manage the interfaces you want to manage with dhcpcd.

At this point you can test if dhcpcd is behaving as expected by running the following command as the root user:

systemctl start dhcpcd@eth0

To start dhcpcd on a specific interface at boot, enable the previously installed systemd unit by running the following command as the root user:

systemctl enable dhcpcd@eth0

Replace eth0 with the actual interface name.


インストールプログラム: dhcpcd
インストールライブラリ: /lib/dhcpcd/dev/udev.so
インストールディレクトリ: /{,var/}lib/dhcpcd, /usr/share/dhcpcd



RFC2131 にて定義されている DHCP クライアントの実装です。


add udev support for interface arrival and departure; this is because udev likes to rename the interface, which it can't do if dhcpcd grabs it first.

最終更新日: 2017-02-19 15:13:39 +0900