<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../../general.ent">
  %general-entities;
]>

<sect1 id="ch-network-dhcpcd" role="wrap">
  <?dbhtml filename="dhcpcd.html"?>

  <title>DHCPCD-&dhcpcd-version;</title>

  <indexterm zone="ch-network-dhcpcd">
    <primary sortas="a-DHCPCD">DHCPCD</primary>
  </indexterm>

  <sect2 role="package">
    <title/>

    <para>The DHCPCD package provides a DHCP Client for network configuration.</para>

  </sect2>

  <sect2 role="installation">
    <title>Installation of DHCPCD</title>

    <para os="a">If you wish to configure your network to connect to a DHCP
      server, you will first need to install a DHCP client. CLFS uses the
      DHCPCD package for this.</para>

    <para os="b">Prepare DHCPCD for compilation:</para>

<screen os="c" role="nodump"><userinput>./configure --prefix=/usr --sbindir=/sbin \
    --sysconfdir=/etc --dbdir=/var/lib/dhcpcd --libexecdir=/usr/lib/dhcpcd</userinput></screen>

    <para os="d">Compile the package:</para>

<screen os="e" role="nodump"><userinput>make</userinput></screen>

    <para os="f">This package does not come with a test suite.</para>

    <para os="g">Install the package:</para>

<screen os="h" role="nodump"><userinput>make install</userinput></screen>

  </sect2>

  <sect2 id="conf-dhcpcd" role="configuration">
    <title>Creating the DHCP Network Interface Configuration File</title>

    <para>The following is an example for the eth0 interface. Refer to the
    dhcpcd.conf man page for more information. This step may be skipped if
    default behavior of dhcpcd is required.</para>

    <para>Create the <filename>/etc/dhcpcd.conf</filename> configuration file
    using the following commands. Adjust appropriately for additional options:</para>

<screen role="nodump"><userinput>cd /etc &amp;&amp;
cat &gt; dhcpcd.conf &lt;&lt; "EOF"
<literal># dhcpcd configuration eth0 interface
# See dhcpcd.conf(5) for details.

interface eth0
# dhcpcd-run-hooks uses these options.
option subnet_mask, routers, domain_name_servers

# The default timeout for waiting for a DHCP response is 30 seconds
# which may be too long or too short and can be changed here.
timeout 16</literal>
EOF</userinput></screen>

    <para>To configure another Static Interface, Follow <xref linkend="ch-network-static"/>.</para>

  </sect2>

  <sect2>
    <title>Configuring the Network Interface at boot</title>

    <para>Enabling of the Network Interface configuration is
    done per interface. To enable Network Interface
    configuration at boot, run:</para>

<screen role="nodump"><userinput>systemctl enable dhcpcd@eth0</userinput></screen>

    <para>To disable previously enabled Network Interface
    configuration at boot, run:</para>

<screen role="nodump"><userinput>systemctl disable dhcpcd@eth0</userinput></screen>

    <para>To manually start the Network Interface configuration,
    run:</para>

<screen role="nodump"><userinput>systemctl start dhcpcd@eth0</userinput></screen>

    <para>Replace eth0 with the correct Network Interface
    name as described on the beginning of this page.</para>

  </sect2>

  <sect2 id="contents-dhcpcd" role="content">
    <title>Contents of dhcpcd</title>

    <segmentedlist>
      <segtitle>Installed files</segtitle>

      <seglistitem>
        <seg>dhcpcd</seg>
      </seglistitem>
    </segmentedlist>

    <variablelist>
      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
      <?dbfo list-presentation="list"?>
      <?dbhtml list-presentation="table"?>

      <varlistentry id="dhcpcd">
        <term><command>dhcpcd</command></term>
        <listitem>
          <para>dhcpcd is an implementation of the DHCP client specified in
          RFC 2131. It gets the host information from a DHCP server and
          configures the network interface automatically.</para>
          <indexterm zone="ch-network-dhcpcd">
            <primary sortas="e-dhcpcd">dhcpcd</primary>
          </indexterm>
        </listitem>
      </varlistentry>

    </variablelist>

  </sect2>

</sect1>
