[246c904] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[ff769b8c] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
[246c904] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
[9cf73e3] | 8 | <sect1 id="dhcp-client" xreflabel="DHCP-&dhcp-version; Client">
|
---|
[59ed37f9] | 9 | <?dbhtml filename="dhcpclient.html"?>
|
---|
[4839c17] | 10 |
|
---|
[59ed37f9] | 11 | <sect1info>
|
---|
| 12 | <othername>$LastChangedBy$</othername>
|
---|
| 13 | <date>$Date$</date>
|
---|
| 14 | </sect1info>
|
---|
[4839c17] | 15 |
|
---|
[59ed37f9] | 16 | <title>DHCP-&dhcp-version; Client</title>
|
---|
[4839c17] | 17 |
|
---|
[59ed37f9] | 18 | <indexterm zone="dhcp-client">
|
---|
| 19 | <primary sortas="b-dhclient">dhclient</primary>
|
---|
| 20 | </indexterm>
|
---|
[4839c17] | 21 |
|
---|
[59ed37f9] | 22 | <para>The <application>DHCP</application> package comes with
|
---|
[893d9711] | 23 | both a client (<command>dhclient</command>) and a server program for
|
---|
| 24 | using DHCP. If you want to install this package,
|
---|
[bbdb0ff4] | 25 | the instructions can be found at <xref linkend="dhcp"/>.
|
---|
[893d9711] | 26 | Note that if you only want to use the client, you
|
---|
| 27 | do <emphasis>not</emphasis> need to run the server and so do not need
|
---|
[59ed37f9] | 28 | the startup script and links provided for the server daemon.
|
---|
[893d9711] | 29 | You only need to run the DHCP server if you're providing
|
---|
[59ed37f9] | 30 | this service to a network, and it's likely that you'll know if that's the
|
---|
| 31 | case; if it isn't, don't run the server! Once you have installed the
|
---|
| 32 | package, return here for information on how to configure the client
|
---|
| 33 | (<command>dhclient</command>).</para>
|
---|
[4839c17] | 34 |
|
---|
[59ed37f9] | 35 | <sect2 role="configuration">
|
---|
| 36 | <title>Configuring DHCP Client</title>
|
---|
[4839c17] | 37 |
|
---|
[893d9711] | 38 | <para id="dhclient-service">To configure <command>dhclient</command>,
|
---|
[59ed37f9] | 39 | you need to first install the network service script,
|
---|
[4839c17] | 40 | <filename>/etc/sysconfig/network-devices/services/dhclient</filename>
|
---|
[893d9711] | 41 | included in the <xref linkend="intro-important-bootscripts"/> package
|
---|
[59ed37f9] | 42 | (as <systemitem class="username">root</systemitem>):</para>
|
---|
[4839c17] | 43 |
|
---|
[59ed37f9] | 44 | <indexterm zone="dhcp-client dhclient-service">
|
---|
| 45 | <primary sortas="f-dhclient">dhclient (service script)</primary>
|
---|
| 46 | </indexterm>
|
---|
[4839c17] | 47 |
|
---|
[59ed37f9] | 48 | <screen role='root'><userinput>make install-service-dhclient</userinput></screen>
|
---|
[4839c17] | 49 |
|
---|
[893d9711] | 50 | <para id="dhclient-config1">Next, create the
|
---|
[59ed37f9] | 51 | <filename>/etc/sysconfig/network-devices/ifconfig.eth0/dhclient</filename>
|
---|
[893d9711] | 52 | configuration file with the following commands as the <systemitem
|
---|
| 53 | class="username">root</systemitem> user. Adjust as
|
---|
[59ed37f9] | 54 | necessary for additional interfaces:</para>
|
---|
[4839c17] | 55 |
|
---|
[59ed37f9] | 56 | <indexterm zone="dhcp-client dhclient-config1">
|
---|
| 57 | <primary sortas="e-etc-sysconfig-...-dhclient">/etc/sysconfig/.../dhclient</primary>
|
---|
| 58 | </indexterm>
|
---|
[4839c17] | 59 |
|
---|
[e3353b3] | 60 | <screen role='root'><userinput>install -v -d /etc/sysconfig/network-devices/ifconfig.eth0 &&
|
---|
[59ed37f9] | 61 | cat > /etc/sysconfig/network-devices/ifconfig.eth0/dhclient << "EOF"
|
---|
| 62 | <literal>ONBOOT="yes"
|
---|
[afa198d] | 63 | SERVICE="dhclient"
|
---|
| 64 | DHCP_START="-q <replaceable>[add additional start parameters here]</replaceable>"
|
---|
[59ed37f9] | 65 | DHCP_STOP="-q -r <replaceable>[add additional stop parameters here]</replaceable>"</literal>
|
---|
| 66 | EOF</userinput></screen>
|
---|
[4839c17] | 67 |
|
---|
[893d9711] | 68 | <para>For more information on the appropriate
|
---|
[4839c17] | 69 | <envar>DHCP_START</envar> and <envar>DHCP_STOP</envar>
|
---|
[59ed37f9] | 70 | values, examine the man page for <command>dhclient</command>.</para>
|
---|
[4839c17] | 71 |
|
---|
[893d9711] | 72 | <para id="dhclient-config2">Finally, you should create the
|
---|
| 73 | <filename>/etc/dhclient.conf</filename> file using the following commands
|
---|
[4839c17] | 74 | as the <systemitem class="username">root</systemitem> user:</para>
|
---|
| 75 |
|
---|
[59ed37f9] | 76 | <indexterm zone="dhcp-client dhclient-config2">
|
---|
| 77 | <primary sortas="e-etc-dhclient.conf">/etc/dhclient.conf</primary>
|
---|
| 78 | </indexterm>
|
---|
[4839c17] | 79 |
|
---|
[59ed37f9] | 80 | <note>
|
---|
[893d9711] | 81 | <para>You'll need to add a second interface definition to the file if you
|
---|
[59ed37f9] | 82 | have more than one interface.</para>
|
---|
| 83 | </note>
|
---|
[4839c17] | 84 |
|
---|
[59ed37f9] | 85 | <screen role='root'><userinput>cat > /etc/dhclient.conf << "EOF"
|
---|
| 86 | <literal># dhclient.conf
|
---|
[4839c17] | 87 |
|
---|
[f45b1953] | 88 | interface "eth0"{
|
---|
| 89 | prepend domain-name-servers 127.0.0.1;
|
---|
| 90 | request subnet-mask, broadcast-address, time-offset, routers,
|
---|
| 91 | domain-name, domain-name-servers, host-name;
|
---|
| 92 | require subnet-mask, domain-name-servers;
|
---|
| 93 | }
|
---|
[59ed37f9] | 94 | # end dhclient.conf</literal>
|
---|
| 95 | EOF</userinput></screen>
|
---|
[4839c17] | 96 |
|
---|
[59ed37f9] | 97 | </sect2>
|
---|
[f45b1953] | 98 |
|
---|
| 99 | </sect1>
|
---|