mirror of
https://github.com/Zeckmathederg/glfs.git
synced 2025-01-24 23:32:12 +08:00
01600b9607
git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@821 af4574ff-66df-0310-9fd7-8a98e5e911e0
53 lines
2.0 KiB
XML
53 lines
2.0 KiB
XML
<sect1 id="connect-dhcp-client">
|
|
<?dbhtml filename="dhcpclient.html" dir="connect"?>
|
|
<title>dhcp-&dhcp-version;</title>
|
|
|
|
<para>The dhcp package comes with both a client (called dhclient) and a
|
|
server program for using DHCP. If you want to install this package,
|
|
the instructions can be found at <xref linkend="dhcp"/>.
|
|
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
|
|
(dhclient).</para>
|
|
|
|
<para>To configure dhclient, you need to create two files,
|
|
<filename>/etc/sysconfig/network-devices/ifconfig.eth0</filename> and
|
|
<filename>/etc/dhclient.conf</filename>.</para>
|
|
|
|
<para>First, create the <filename>ifconfig.eth0</filename>
|
|
file with the following commands (note that this will overwrite any
|
|
existing file):</para>
|
|
|
|
<para><screen><userinput>cd /etc/sysconfig/network-devices &&
|
|
cat > /etc/sysconfig/network-devices/ifconfig.eth0 << "EOF"</userinput>
|
|
ONBOOT=yes
|
|
DHCP_PROG=/sbin/dhclient
|
|
DHCP_START=<appropriate start parameters>
|
|
DHCP_STOP=-r
|
|
<userinput>EOF</userinput></screen></para>
|
|
|
|
<para>For more information on the appropriate
|
|
<userinput>DHCP_START</userinput> and <userinput>DHCP_STOP</userinput>
|
|
values, examine the man page for dhclient.</para>
|
|
|
|
<para>Next, you should then create
|
|
the <filename>/etc/dhclient.conf</filename> using the following command:</para>
|
|
|
|
<para><screen><userinput>cat > /etc/dhclient.conf << "EOF"</userinput>
|
|
# dhclient.conf
|
|
|
|
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;
|
|
}
|
|
# end dhclient.conf
|
|
<userinput>EOF</userinput></screen></para>
|
|
|
|
</sect1>
|