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