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