<?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"><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"><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"><userinput>make install</userinput></screen>

  </sect2>

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

    <para>First install the service from the CLFS Bootscripts package:</para>

<screen><userinput>tar -xvf bootscripts-cross-lfs-&bootscripts-clfs-version;.tar.xz
cd bootscripts-cross-lfs-&bootscripts-clfs-version;
make install-service-dhcpcd</userinput></screen>

    <para>Finally, create the
    <filename>/etc/sysconfig/network-devices/ifconfig.eth0/dhcpcd</filename>
    configuration file using the following commands. Adjust appropriately for
    additional interfaces:</para>

<screen><userinput>cd /etc/sysconfig/network-devices &amp;&amp;
mkdir -v ifconfig.eth0 &amp;&amp;
cat &gt; ifconfig.eth0/dhcpcd &lt;&lt; "EOF"
<literal>ONBOOT="yes"
SERVICE="dhcpcd"

# Start Command for DHCPCD
DHCP_START="-q"

# Stop Command for DHCPCD
DHCP_STOP="-k"</literal>
EOF</userinput></screen>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="static.xml"
    xpointer="xpointer(//*[@os='var-ob'])"/>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="static.xml"
    xpointer="xpointer(//*[@os='var-s'])"/>

    <para>The <envar>DHCP_START</envar> and <envar>DHCP_STOP</envar> variables
    arguments that are passed onto <filename>dhcpcd</filename> when starting
    and stoppping the service. More information about what can be passed can
    be found in the <filename>dhcpcd(8)</filename> man page.</para>

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