[f45b1953] | 1 | <sect1 id="connect-dhcp-client">
|
---|
| 2 | <?dbhtml filename="dhcpclient.html" dir="connect"?>
|
---|
[ca3bcd40] | 3 | <title>dhcp-&dhcp-version;</title>
|
---|
[f45b1953] | 4 |
|
---|
| 5 | <para>The dhcp package comes with both a client and a server program for
|
---|
| 6 | using DHCP. If you want to install it, the instructions can be found
|
---|
| 7 | at <xref linkend="dhcp"/>. Note that if you only want to
|
---|
| 8 | use the client, you do <emphasis>not</emphasis> need to run the server and
|
---|
| 9 | so do not need the startup script and links provided for the server daemon.
|
---|
| 10 | Note that to use the client, you still need to alter your
|
---|
| 11 | <filename>ethnet</filename> script as described in the next section.
|
---|
| 12 | You only need to run the DHCP server however, if you're providing this
|
---|
| 13 | 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!</para>
|
---|
| 15 |
|
---|
| 16 | <para>To configure the client, you need to modify the
|
---|
| 17 | <filename>/etc/sysconfig/network-devices/ifconfig.eth0</filename> file
|
---|
| 18 | (or the appropriate one for the interface you are running DHCP on)
|
---|
| 19 | you created earlier by adding the appropriate <userinput>DHCP_PROG
|
---|
| 20 | </userinput>, <userinput>DHCP_START</userinput> and
|
---|
| 21 | <userinput>DHCP_STOP</userinput> values.</para>
|
---|
| 22 |
|
---|
| 23 | <para>Then create the <filename>/etc/dhclient.conf</filename> using the
|
---|
| 24 | following command:</para>
|
---|
| 25 |
|
---|
[e88b385] | 26 | <para><screen><userinput>cat > /etc/dhclient.conf << "EOF"</userinput>
|
---|
[f45b1953] | 27 | # dhclient.conf
|
---|
| 28 |
|
---|
| 29 | interface "eth0"{
|
---|
| 30 | prepend domain-name-servers 127.0.0.1;
|
---|
| 31 | request subnet-mask, broadcast-address, time-offset, routers,
|
---|
| 32 | domain-name, domain-name-servers, host-name;
|
---|
| 33 | require subnet-mask, domain-name-servers;
|
---|
| 34 | }
|
---|
| 35 | # end dhclient.conf
|
---|
| 36 | <userinput>EOF</userinput></screen></para>
|
---|
| 37 |
|
---|
| 38 | </sect1>
|
---|