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 | <?dbhtml filename="dhcpclient.html"?>
|
---|
10 | <title>DHCP-&dhcp-version;</title>
|
---|
11 |
|
---|
12 | <para>The <application><acronym>DHCP</acronym></application> package comes with
|
---|
13 | both a client (<command>dhclient</command>) and a server program for
|
---|
14 | using <acronym>DHCP</acronym>. If you want to install this package,
|
---|
15 | the instructions can be found at <xref linkend="dhcp"/>.
|
---|
16 | Note that if you only want to use the client, you
|
---|
17 | do <emphasis>not</emphasis> need to run the server and so do not need
|
---|
18 | the startup script and links provided for the server daemon.
|
---|
19 | You only need to run the <acronym>DHCP</acronym> server if you're providing
|
---|
20 | this service to a network, and it's likely that you'll know if that's the
|
---|
21 | case; if it isn't, don't run the server! Once you have installed the
|
---|
22 | package, return here for information on how to configure the client
|
---|
23 | (<command>dhclient</command>).</para>
|
---|
24 |
|
---|
25 | <para>To configure <command>dhclient</command>, you need to first install
|
---|
26 | the network service script,
|
---|
27 | <filename>/etc/sysconfig/network-devices/services/dhclient</filename>
|
---|
28 | included in the <xref linkend="intro-important-bootscripts"/> package.</para>
|
---|
29 |
|
---|
30 | <screen><userinput><command>make install-service-dhclient</command></userinput></screen>
|
---|
31 |
|
---|
32 | <para>Next, create the <filename>ifconfig.eth0</filename>
|
---|
33 | file with the following commands. Adjust as necessary for additional
|
---|
34 | interfaces.</para>
|
---|
35 |
|
---|
36 | <para><emphasis>Note</emphasis>: this will overwrite any existing file.</para>
|
---|
37 |
|
---|
38 | <screen><userinput><command>cat > /etc/sysconfig/network-devices/ifconfig.eth0 << "EOF"</command>
|
---|
39 | ONBOOT=yes
|
---|
40 | DHCP_START="<replaceable>[place appropriate start parameters here]</replaceable>"
|
---|
41 | DHCP_STOP="-r <replaceable>[add additional stop parameters here]</replaceable>"
|
---|
42 | SERVICE=dhclient
|
---|
43 | <command>EOF</command></userinput></screen>
|
---|
44 |
|
---|
45 | <para>For more information on the appropriate
|
---|
46 | <envar>DHCP_START</envar> and <envar>DHCP_STOP</envar>
|
---|
47 | values, examine the man page for <command>dhclient</command>.</para>
|
---|
48 |
|
---|
49 | <para> You should then create
|
---|
50 | <filename>/etc/dhclient.conf</filename> using the following
|
---|
51 | commands. Append to the file if you have more than one interface:</para>
|
---|
52 |
|
---|
53 | <screen><userinput><command>cat > /etc/dhclient.conf << "EOF"</command>
|
---|
54 | # dhclient.conf
|
---|
55 |
|
---|
56 | interface "eth0"{
|
---|
57 | prepend domain-name-servers 127.0.0.1;
|
---|
58 | request subnet-mask, broadcast-address, time-offset, routers,
|
---|
59 | domain-name, domain-name-servers, host-name;
|
---|
60 | require subnet-mask, domain-name-servers;
|
---|
61 | }
|
---|
62 | # end dhclient.conf
|
---|
63 | <command>EOF</command></userinput></screen>
|
---|
64 |
|
---|
65 | <para>Finally, if the <acronym>DHCP</acronym> configured interface is
|
---|
66 | used as your default gateway, you should remove the GATEWAY and GATEWAY_IF
|
---|
67 | variables from <filename>/etc/sysconfig/network</filename>: </para>
|
---|
68 |
|
---|
69 | <screen><userinput><command>sed -i "s/GATEWAY/#GATEWAY/" /etc/sysconfig/network</command></userinput></screen>
|
---|
70 |
|
---|
71 | </sect1>
|
---|