[f45b1953] | 1 | <sect1 id="connect-dhcp-client">
|
---|
| 2 | <?dbhtml filename="dhcpclient.html" dir="connect"?>
|
---|
[ca3bcd40] | 3 | <title>dhcp-&dhcp-version;</title>
|
---|
[f45b1953] | 4 |
|
---|
[d1332733] | 5 | <para>The dhcp package comes with both a client (called dhclient) and a
|
---|
[050d775d] | 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
|
---|
[f45b1953] | 12 | service to a network, and it's likely that you'll know if that's the
|
---|
[050d775d] | 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
|
---|
[d1332733] | 15 | (dhclient).</para>
|
---|
[f45b1953] | 16 |
|
---|
[050d775d] | 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>
|
---|
[f45b1953] | 20 |
|
---|
[d1332733] | 21 | <para>First, create the <filename>ifconfig.eth0</filename>
|
---|
[050d775d] | 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 &&
|
---|
[d1332733] | 26 | cat > /etc/sysconfig/network-devices/ifconfig.eth0 << "EOF"</userinput>
|
---|
[050d775d] | 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 |
|
---|
[a338b48] | 33 | <para>For more information on the appropriate
|
---|
[050d775d] | 34 | <userinput>DHCP_START</userinput> and <userinput>DHCP_STOP</userinput>
|
---|
| 35 | values, examine the man-page for dhclient.</para>
|
---|
| 36 |
|
---|
[d1332733] | 37 | <para>Next, you should then create
|
---|
[050d775d] | 38 | the <filename>/etc/dhclient.conf</filename> using the following command:</para>
|
---|
[f45b1953] | 39 |
|
---|
[e88b385] | 40 | <para><screen><userinput>cat > /etc/dhclient.conf << "EOF"</userinput>
|
---|
[f45b1953] | 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>
|
---|