[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">
|
---|
[a0f03b0] | 9 | <sect1info>
|
---|
[5cd0959d] | 10 | <othername>$LastChangedBy$</othername>
|
---|
| 11 | <date>$Date$</date>
|
---|
[a0f03b0] | 12 | </sect1info>
|
---|
[00bb024c] | 13 | <?dbhtml filename="dhcpclient.html"?>
|
---|
[9cf73e3] | 14 | <title>DHCP-&dhcp-version; Client</title>
|
---|
| 15 | <indexterm zone="dhcp-client">
|
---|
| 16 | <primary sortas="b-dhclient">dhclient</primary></indexterm>
|
---|
[f45b1953] | 17 |
|
---|
[f07203c5] | 18 | <para>The <application><acronym>DHCP</acronym></application> package comes with
|
---|
[1af021dc] | 19 | both a client (<command>dhclient</command>) and a server program for
|
---|
[f07203c5] | 20 | using <acronym>DHCP</acronym>. If you want to install this package,
|
---|
[050d775d] | 21 | the instructions can be found at <xref linkend="dhcp"/>.
|
---|
| 22 | Note that if you only want to use the client, you
|
---|
| 23 | do <emphasis>not</emphasis> need to run the server and so do not need
|
---|
| 24 | the startup script and links provided for the server daemon.
|
---|
[36f9a23] | 25 | You only need to run the <acronym>DHCP</acronym> server if you're providing
|
---|
| 26 | this service to a network, and it's likely that you'll know if that's the
|
---|
[050d775d] | 27 | case; if it isn't, don't run the server! Once you have installed the
|
---|
| 28 | package, return here for information on how to configure the client
|
---|
[36f9a23] | 29 | (<command>dhclient</command>).</para>
|
---|
[f45b1953] | 30 |
|
---|
[9cf73e3] | 31 | <para id="dhclient-service">To configure <command>dhclient</command>, you need
|
---|
| 32 | to first install the network service script,
|
---|
[b5ea3492] | 33 | <filename>/etc/sysconfig/network-devices/services/dhclient</filename>
|
---|
[791e96fa] | 34 | included in the <xref linkend="intro-important-bootscripts"/> package
|
---|
| 35 | (as root).</para>
|
---|
[9cf73e3] | 36 | <indexterm zone="dhcp-client dhclient-service">
|
---|
| 37 | <primary sortas="f-dhclient">dhclient (service script)</primary></indexterm>
|
---|
[f45b1953] | 38 |
|
---|
[791e96fa] | 39 | <screen><userinput role='root'><command>make install-service-dhclient</command></userinput></screen>
|
---|
[050d775d] | 40 |
|
---|
[9cf73e3] | 41 | <para id="dhclient-config1">Next, create the
|
---|
[afa198d] | 42 | <filename>/etc/sysconfig/network-devices/ifconfig.eth0/dhclient</filename>
|
---|
[791e96fa] | 43 | configuration file with the following commands as the root user. Adjust as
|
---|
| 44 | necessary for additional interfaces.</para>
|
---|
[9cf73e3] | 45 | <indexterm zone="dhcp-client dhclient-config1">
|
---|
| 46 | <primary
|
---|
| 47 | sortas="e-etc-sysconfig-...-dhclient">/etc/sysconfig/.../dhclient</primary>
|
---|
| 48 | </indexterm>
|
---|
[b5ea3492] | 49 |
|
---|
[791e96fa] | 50 | <screen><userinput role='root'><command>install -d /etc/sysconfig/network-devices/ifconfig.eth0 &&
|
---|
[afa198d] | 51 | cat > /etc/sysconfig/network-devices/ifconfig.eth0/dhclient << "EOF"</command>
|
---|
| 52 | ONBOOT="yes"
|
---|
| 53 | SERVICE="dhclient"
|
---|
| 54 | DHCP_START="-q <replaceable>[add additional start parameters here]</replaceable>"
|
---|
| 55 | DHCP_STOP="-q -r <replaceable>[add additional stop parameters here]</replaceable>"
|
---|
[36f9a23] | 56 | <command>EOF</command></userinput></screen>
|
---|
[050d775d] | 57 |
|
---|
[a338b48] | 58 | <para>For more information on the appropriate
|
---|
[52b9837f] | 59 | <envar>DHCP_START</envar> and <envar>DHCP_STOP</envar>
|
---|
[36f9a23] | 60 | values, examine the man page for <command>dhclient</command>.</para>
|
---|
[050d775d] | 61 |
|
---|
[9cf73e3] | 62 | <para id="dhclient-config2">Finally, you should create the
|
---|
[afa198d] | 63 | <filename>/etc/dhclient.conf</filename> file using the following
|
---|
[791e96fa] | 64 | commands as the root user:</para>
|
---|
[9cf73e3] | 65 | <indexterm zone="dhcp-client dhclient-config2">
|
---|
| 66 | <primary sortas="e-etc-dhclient.conf">/etc/dhclient.conf</primary></indexterm>
|
---|
[afa198d] | 67 |
|
---|
[802e6fe7] | 68 | <note><para>You'll need to add a second interface definition to the file if you
|
---|
| 69 | have more than one interface.</para></note>
|
---|
[f45b1953] | 70 |
|
---|
[791e96fa] | 71 | <screen><userinput role='root'><command>cat > /etc/dhclient.conf << "EOF"</command>
|
---|
[f45b1953] | 72 | # dhclient.conf
|
---|
| 73 |
|
---|
| 74 | interface "eth0"{
|
---|
| 75 | prepend domain-name-servers 127.0.0.1;
|
---|
| 76 | request subnet-mask, broadcast-address, time-offset, routers,
|
---|
| 77 | domain-name, domain-name-servers, host-name;
|
---|
| 78 | require subnet-mask, domain-name-servers;
|
---|
| 79 | }
|
---|
| 80 | # end dhclient.conf
|
---|
[36f9a23] | 81 | <command>EOF</command></userinput></screen>
|
---|
[f45b1953] | 82 |
|
---|
| 83 | </sect1>
|
---|