Tagged dhcp-client.xml

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@3887 af4574ff-66df-0310-9fd7-8a98e5e911e0
This commit is contained in:
Manuel Canales Esparcia 2005-04-30 17:58:58 +00:00
parent db78bbce2a
commit 59ed37f987

View File

@ -6,78 +6,94 @@
]> ]>
<sect1 id="dhcp-client" xreflabel="DHCP-&dhcp-version; Client"> <sect1 id="dhcp-client" xreflabel="DHCP-&dhcp-version; Client">
<sect1info> <?dbhtml filename="dhcpclient.html"?>
<othername>$LastChangedBy$</othername>
<date>$Date$</date> <sect1info>
</sect1info> <othername>$LastChangedBy$</othername>
<?dbhtml filename="dhcpclient.html"?> <date>$Date$</date>
<title>DHCP-&dhcp-version; Client</title> </sect1info>
<indexterm zone="dhcp-client">
<primary sortas="b-dhclient">dhclient</primary></indexterm> <title>DHCP-&dhcp-version; Client</title>
<para>The <application><acronym>DHCP</acronym></application> package comes with <indexterm zone="dhcp-client">
both a client (<command>dhclient</command>) and a server program for <primary sortas="b-dhclient">dhclient</primary>
using <acronym>DHCP</acronym>. If you want to install this package, </indexterm>
the instructions can be found at <xref linkend="dhcp"/>.
Note that if you only want to use the client, you <para>The <application>DHCP</application> package comes with
do <emphasis>not</emphasis> need to run the server and so do not need both a client (<command>dhclient</command>) and a server program for
the startup script and links provided for the server daemon. using DHCP. If you want to install this package,
You only need to run the <acronym>DHCP</acronym> server if you're providing the instructions can be found at <xref linkend="dhcp"/>.
this service to a network, and it's likely that you'll know if that's the Note that if you only want to use the client, you
case; if it isn't, don't run the server! Once you have installed the do <emphasis>not</emphasis> need to run the server and so do not need
package, return here for information on how to configure the client the startup script and links provided for the server daemon.
(<command>dhclient</command>).</para> You only need to run the DHCP server if you're providing
this service to a network, and it's likely that you'll know if that's the
<para id="dhclient-service">To configure <command>dhclient</command>, you need case; if it isn't, don't run the server! Once you have installed the
to first install the network service script, package, return here for information on how to configure the client
<filename>/etc/sysconfig/network-devices/services/dhclient</filename> (<command>dhclient</command>).</para>
included in the <xref linkend="intro-important-bootscripts"/> package
(as root).</para> <sect2 role="configuration">
<indexterm zone="dhcp-client dhclient-service"> <title>Configuring DHCP Client</title>
<primary sortas="f-dhclient">dhclient (service script)</primary></indexterm>
<para id="dhclient-service">To configure <command>dhclient</command>,
<screen><userinput role='root'><command>make install-service-dhclient</command></userinput></screen> you need to first install the network service script,
<filename>/etc/sysconfig/network-devices/services/dhclient</filename>
<para id="dhclient-config1">Next, create the included in the <xref linkend="intro-important-bootscripts"/> package
<filename>/etc/sysconfig/network-devices/ifconfig.eth0/dhclient</filename> (as <systemitem class="username">root</systemitem>):</para>
configuration file with the following commands as the root user. Adjust as
necessary for additional interfaces.</para> <indexterm zone="dhcp-client dhclient-service">
<indexterm zone="dhcp-client dhclient-config1"> <primary sortas="f-dhclient">dhclient (service script)</primary>
<primary </indexterm>
sortas="e-etc-sysconfig-...-dhclient">/etc/sysconfig/.../dhclient</primary>
</indexterm> <screen role='root'><userinput>make install-service-dhclient</userinput></screen>
<screen><userinput role='root'><command>install -d /etc/sysconfig/network-devices/ifconfig.eth0 &amp;&amp; <para id="dhclient-config1">Next, create the
cat &gt; /etc/sysconfig/network-devices/ifconfig.eth0/dhclient &lt;&lt; "EOF"</command> <filename>/etc/sysconfig/network-devices/ifconfig.eth0/dhclient</filename>
ONBOOT="yes" configuration file with the following commands as the <systemitem
class="username">root</systemitem> user. Adjust as
necessary for additional interfaces:</para>
<indexterm zone="dhcp-client dhclient-config1">
<primary sortas="e-etc-sysconfig-...-dhclient">/etc/sysconfig/.../dhclient</primary>
</indexterm>
<screen role='root'><userinput>install -d /etc/sysconfig/network-devices/ifconfig.eth0 &amp;&amp;
cat &gt; /etc/sysconfig/network-devices/ifconfig.eth0/dhclient &lt;&lt; "EOF"
<literal>ONBOOT="yes"
SERVICE="dhclient" SERVICE="dhclient"
DHCP_START="-q <replaceable>[add additional start parameters here]</replaceable>" DHCP_START="-q <replaceable>[add additional start parameters here]</replaceable>"
DHCP_STOP="-q -r <replaceable>[add additional stop parameters here]</replaceable>" DHCP_STOP="-q -r <replaceable>[add additional stop parameters here]</replaceable>"</literal>
<command>EOF</command></userinput></screen> EOF</userinput></screen>
<para>For more information on the appropriate <para>For more information on the appropriate
<envar>DHCP_START</envar> and <envar>DHCP_STOP</envar> <envar>DHCP_START</envar> and <envar>DHCP_STOP</envar>
values, examine the man page for <command>dhclient</command>.</para> values, examine the man page for <command>dhclient</command>.</para>
<para id="dhclient-config2">Finally, you should create the <para id="dhclient-config2">Finally, you should create the
<filename>/etc/dhclient.conf</filename> file using the following <filename>/etc/dhclient.conf</filename> file using the following commands
commands as the root user:</para> as the <systemitem class="username">root</systemitem> user:</para>
<indexterm zone="dhcp-client dhclient-config2">
<primary sortas="e-etc-dhclient.conf">/etc/dhclient.conf</primary></indexterm> <indexterm zone="dhcp-client dhclient-config2">
<primary sortas="e-etc-dhclient.conf">/etc/dhclient.conf</primary>
<note><para>You'll need to add a second interface definition to the file if you </indexterm>
have more than one interface.</para></note>
<note>
<screen><userinput role='root'><command>cat &gt; /etc/dhclient.conf &lt;&lt; "EOF"</command> <para>You'll need to add a second interface definition to the file if you
# dhclient.conf have more than one interface.</para>
</note>
<screen role='root'><userinput>cat &gt; /etc/dhclient.conf &lt;&lt; "EOF"
<literal># dhclient.conf
interface "eth0"{ interface "eth0"{
prepend domain-name-servers 127.0.0.1; prepend domain-name-servers 127.0.0.1;
request subnet-mask, broadcast-address, time-offset, routers, request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, host-name; domain-name, domain-name-servers, host-name;
require subnet-mask, domain-name-servers; require subnet-mask, domain-name-servers;
} }
# end dhclient.conf # end dhclient.conf</literal>
<command>EOF</command></userinput></screen> EOF</userinput></screen>
</sect2>
</sect1> </sect1>