dhcpcd-6.11.5

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  &&
make

このパッケージにテストスイートはありません。

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 の設定

設定ファイル

/etc/dhcpcd.conf

全般的な設定情報

To configure dhcpcd, you need to first install the network service script, /lib/services/dhcpcd included in the blfs-bootscripts-20170731 package (as user root):

make install-service-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.

Finally, as the root user create the /etc/sysconfig/ifconfig.eth0 configuration file using the following commands. Adjust appropriately for additional interfaces:

cat > /etc/sysconfig/ifconfig.eth0 << "EOF"
ONBOOT="yes"
IFACE="eth0"
SERVICE="dhcpcd"
DHCP_START="-b -q <insert appropriate start options here>"
DHCP_STOP="-k <insert additional stop options here>"
EOF

For more information on the appropriate DHCP_START and DHCP_STOP values, examine the man page for dhcpcd.

[注記]

注記

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.

Review the dhcpcd man page for switches to add to the DHCP_START value.

設定情報: 固定IP

Although not usual, it is possible that you need to configure dhcpcd to use a fixed ip. Here, we give an example. As the root user create the /etc/sysconfig/ifconfig.eth0 configuration file using the following commands. Adjust appropriately for additional interfaces and for the actual ip and router you need:

cat > /etc/sysconfig/ifconfig.eth0 << "EOF"
ONBOOT="yes"
IFACE="eth0"
SERVICE="dhcpcd"
DHCP_START="-b -q -S ip_address=192.168.0.10/24 -S routers=192.168.0.1"
DHCP_STOP="-k"
EOF

You can either use DNS servers in /etc/resolv.conf from another system, your preferred servers, or just the example /etc/resolv.conf.head file below as is:

cat > /etc/resolv.conf.head << "EOF"
# OpenDNS servers
nameserver 208.67.222.222
nameserver 208.67.220.220
EOF

パッケージ構成

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

概略説明

dhcpcd

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

udev.so

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