1 | <sect1 id="connect-dhcp-client">
|
---|
2 | <?dbhtml filename="dhcpclient.html" dir="connect"?>
|
---|
3 | <title>dhcp-&dhcp-version;</title>
|
---|
4 |
|
---|
5 | <para>The <application>dhcp</application> package comes with both a client
|
---|
6 | (called <command>dhclient</command>) and a server program for using
|
---|
7 | <acronym>DHCP</acronym>. If you want to install this package,
|
---|
8 | the instructions can be found at <xref linkend="dhcp"/>.
|
---|
9 | Note that if you only want to use the client, you
|
---|
10 | do <emphasis>not</emphasis> need to run the server and so do not need
|
---|
11 | the startup script and links provided for the server daemon.
|
---|
12 | You only need to run the <acronym>DHCP</acronym> server if you're providing
|
---|
13 | this service to a network, and it's likely that you'll know if that's the
|
---|
14 | case; if it isn't, don't run the server! Once you have installed the
|
---|
15 | package, return here for information on how to configure the client
|
---|
16 | (<command>dhclient</command>).</para>
|
---|
17 |
|
---|
18 | <para>To configure <command>dhclient</command>, you need to create two files,
|
---|
19 | <filename>/etc/sysconfig/network-devices/ifconfig.eth0</filename> and
|
---|
20 | <filename>/etc/dhclient.conf</filename>.</para>
|
---|
21 |
|
---|
22 | <para>First, create the <filename>ifconfig.eth0</filename>
|
---|
23 | file with the following commands (note that this will overwrite any
|
---|
24 | existing file):</para>
|
---|
25 |
|
---|
26 | <screen><userinput><command>cd /etc/sysconfig/network-devices &&
|
---|
27 | cat > /etc/sysconfig/network-devices/ifconfig.eth0 << "EOF"</command>
|
---|
28 | ONBOOT=yes
|
---|
29 | DHCP_PROG=/sbin/dhclient
|
---|
30 | DHCP_START=<appropriate start parameters>
|
---|
31 | DHCP_STOP=-r
|
---|
32 | <command>EOF</command></userinput></screen>
|
---|
33 |
|
---|
34 | <para>For more information on the appropriate
|
---|
35 | <envar>DHCP_START</envar> and <envar>DHCP_STOP</envar>
|
---|
36 | values, examine the man page for <command>dhclient</command>.</para>
|
---|
37 |
|
---|
38 | <para>Next, you should then create
|
---|
39 | the <filename>/etc/dhclient.conf</filename> using the following command:</para>
|
---|
40 |
|
---|
41 | <screen><userinput><command>cat > /etc/dhclient.conf << "EOF"</command>
|
---|
42 | # dhclient.conf
|
---|
43 |
|
---|
44 | interface "eth0"{
|
---|
45 | prepend domain-name-servers 127.0.0.1;
|
---|
46 | request subnet-mask, broadcast-address, time-offset, routers,
|
---|
47 | domain-name, domain-name-servers, host-name;
|
---|
48 | require subnet-mask, domain-name-servers;
|
---|
49 | }
|
---|
50 | # end dhclient.conf
|
---|
51 | <command>EOF</command></userinput></screen>
|
---|
52 |
|
---|
53 | </sect1>
|
---|