2004-06-12 09:11:39 +08:00
|
|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
2005-04-04 04:52:42 +08:00
|
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
|
|
|
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
2004-06-12 09:11:39 +08:00
|
|
|
<!ENTITY % general-entities SYSTEM "../../general.ent">
|
|
|
|
%general-entities;
|
|
|
|
]>
|
|
|
|
|
2005-01-20 05:14:55 +08:00
|
|
|
<sect1 id="dhcp-client" xreflabel="DHCP-&dhcp-version; Client">
|
2005-05-01 01:58:58 +08:00
|
|
|
<?dbhtml filename="dhcpclient.html"?>
|
2005-05-31 00:13:27 +08:00
|
|
|
|
2005-05-01 01:58:58 +08:00
|
|
|
<sect1info>
|
|
|
|
<othername>$LastChangedBy$</othername>
|
|
|
|
<date>$Date$</date>
|
|
|
|
</sect1info>
|
2005-05-31 00:13:27 +08:00
|
|
|
|
2005-05-01 01:58:58 +08:00
|
|
|
<title>DHCP-&dhcp-version; Client</title>
|
2005-05-31 00:13:27 +08:00
|
|
|
|
2005-05-01 01:58:58 +08:00
|
|
|
<indexterm zone="dhcp-client">
|
|
|
|
<primary sortas="b-dhclient">dhclient</primary>
|
|
|
|
</indexterm>
|
2005-05-31 00:13:27 +08:00
|
|
|
|
2005-05-01 01:58:58 +08:00
|
|
|
<para>The <application>DHCP</application> package comes with
|
|
|
|
both a client (<command>dhclient</command>) and a server program for
|
|
|
|
using DHCP. If you want to install this package,
|
2005-05-31 04:49:04 +08:00
|
|
|
the instructions can be found at <xref linkend="dhcp"/>.
|
2005-05-01 01:58:58 +08:00
|
|
|
Note that if you only want to use the client, you
|
|
|
|
do <emphasis>not</emphasis> need to run the server and so do not need
|
|
|
|
the startup script and links provided for the server daemon.
|
|
|
|
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
|
|
|
|
case; if it isn't, don't run the server! Once you have installed the
|
|
|
|
package, return here for information on how to configure the client
|
|
|
|
(<command>dhclient</command>).</para>
|
2005-05-31 00:13:27 +08:00
|
|
|
|
2005-05-01 01:58:58 +08:00
|
|
|
<sect2 role="configuration">
|
|
|
|
<title>Configuring DHCP Client</title>
|
2005-05-31 00:13:27 +08:00
|
|
|
|
2005-05-01 01:58:58 +08:00
|
|
|
<para id="dhclient-service">To configure <command>dhclient</command>,
|
|
|
|
you need to first install the network service script,
|
2005-05-31 00:13:27 +08:00
|
|
|
<filename>/etc/sysconfig/network-devices/services/dhclient</filename>
|
2005-05-01 01:58:58 +08:00
|
|
|
included in the <xref linkend="intro-important-bootscripts"/> package
|
|
|
|
(as <systemitem class="username">root</systemitem>):</para>
|
2005-05-31 00:13:27 +08:00
|
|
|
|
2005-05-01 01:58:58 +08:00
|
|
|
<indexterm zone="dhcp-client dhclient-service">
|
|
|
|
<primary sortas="f-dhclient">dhclient (service script)</primary>
|
|
|
|
</indexterm>
|
2005-05-31 00:13:27 +08:00
|
|
|
|
2005-05-01 01:58:58 +08:00
|
|
|
<screen role='root'><userinput>make install-service-dhclient</userinput></screen>
|
2005-05-31 00:13:27 +08:00
|
|
|
|
2005-05-01 01:58:58 +08:00
|
|
|
<para id="dhclient-config1">Next, create the
|
|
|
|
<filename>/etc/sysconfig/network-devices/ifconfig.eth0/dhclient</filename>
|
|
|
|
configuration file with the following commands as the <systemitem
|
|
|
|
class="username">root</systemitem> user. Adjust as
|
|
|
|
necessary for additional interfaces:</para>
|
2005-05-31 00:13:27 +08:00
|
|
|
|
2005-05-01 01:58:58 +08:00
|
|
|
<indexterm zone="dhcp-client dhclient-config1">
|
|
|
|
<primary sortas="e-etc-sysconfig-...-dhclient">/etc/sysconfig/.../dhclient</primary>
|
|
|
|
</indexterm>
|
2005-05-31 00:13:27 +08:00
|
|
|
|
2005-05-01 17:37:53 +08:00
|
|
|
<screen role='root'><userinput>install -v -d /etc/sysconfig/network-devices/ifconfig.eth0 &&
|
2005-05-01 01:58:58 +08:00
|
|
|
cat > /etc/sysconfig/network-devices/ifconfig.eth0/dhclient << "EOF"
|
|
|
|
<literal>ONBOOT="yes"
|
2004-07-29 12:53:55 +08:00
|
|
|
SERVICE="dhclient"
|
|
|
|
DHCP_START="-q <replaceable>[add additional start parameters here]</replaceable>"
|
2005-05-01 01:58:58 +08:00
|
|
|
DHCP_STOP="-q -r <replaceable>[add additional stop parameters here]</replaceable>"</literal>
|
|
|
|
EOF</userinput></screen>
|
2005-05-31 00:13:27 +08:00
|
|
|
|
2005-05-01 01:58:58 +08:00
|
|
|
<para>For more information on the appropriate
|
2005-05-31 00:13:27 +08:00
|
|
|
<envar>DHCP_START</envar> and <envar>DHCP_STOP</envar>
|
2005-05-01 01:58:58 +08:00
|
|
|
values, examine the man page for <command>dhclient</command>.</para>
|
2005-05-31 00:13:27 +08:00
|
|
|
|
2005-05-01 01:58:58 +08:00
|
|
|
<para id="dhclient-config2">Finally, you should create the
|
|
|
|
<filename>/etc/dhclient.conf</filename> file using the following commands
|
2005-05-31 00:13:27 +08:00
|
|
|
as the <systemitem class="username">root</systemitem> user:</para>
|
|
|
|
|
2005-05-01 01:58:58 +08:00
|
|
|
<indexterm zone="dhcp-client dhclient-config2">
|
|
|
|
<primary sortas="e-etc-dhclient.conf">/etc/dhclient.conf</primary>
|
|
|
|
</indexterm>
|
2005-05-31 00:13:27 +08:00
|
|
|
|
2005-05-01 01:58:58 +08:00
|
|
|
<note>
|
|
|
|
<para>You'll need to add a second interface definition to the file if you
|
|
|
|
have more than one interface.</para>
|
|
|
|
</note>
|
2005-05-31 00:13:27 +08:00
|
|
|
|
2005-05-01 01:58:58 +08:00
|
|
|
<screen role='root'><userinput>cat > /etc/dhclient.conf << "EOF"
|
|
|
|
<literal># dhclient.conf
|
2005-05-31 00:13:27 +08:00
|
|
|
|
2002-07-08 04:28:42 +08:00
|
|
|
interface "eth0"{
|
|
|
|
prepend domain-name-servers 127.0.0.1;
|
|
|
|
request subnet-mask, broadcast-address, time-offset, routers,
|
|
|
|
domain-name, domain-name-servers, host-name;
|
|
|
|
require subnet-mask, domain-name-servers;
|
|
|
|
}
|
2005-05-01 01:58:58 +08:00
|
|
|
# end dhclient.conf</literal>
|
|
|
|
EOF</userinput></screen>
|
2005-05-31 00:13:27 +08:00
|
|
|
|
2005-05-01 01:58:58 +08:00
|
|
|
</sect2>
|
2002-07-08 04:28:42 +08:00
|
|
|
|
|
|
|
</sect1>
|