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