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