[f45b1953] | 1 | <sect1 id="connect-dhcp-client">
|
---|
| 2 | <?dbhtml filename="dhcpclient.html" dir="connect"?>
|
---|
[f07203c5] | 3 | <title>DHCP-&dhcp-version;</title>
|
---|
[f45b1953] | 4 |
|
---|
[f07203c5] | 5 | <para>The <application><acronym>DHCP</acronym></application> package comes with
|
---|
| 6 | both a client (called <command>dhclient</command>) and a server program for
|
---|
| 7 | using <acronym>DHCP</acronym>. If you want to install this package,
|
---|
[050d775d] | 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.
|
---|
[36f9a23] | 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
|
---|
[050d775d] | 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
|
---|
[36f9a23] | 16 | (<command>dhclient</command>).</para>
|
---|
[f45b1953] | 17 |
|
---|
[b5ea3492] | 18 | <para>To configure <command>dhclient</command>, we need to first install
|
---|
| 19 | the network service script,
|
---|
| 20 | <filename>/etc/sysconfig/network-devices/services/dhclient</filename>
|
---|
| 21 | included in the <xref linkend="intro-important-bootscripts"/> package.</para>
|
---|
[f45b1953] | 22 |
|
---|
[b5ea3492] | 23 | <screen><userinput><command>make install-service-dhclient</command></userinput></screen>
|
---|
[050d775d] | 24 |
|
---|
[b5ea3492] | 25 | <para>Next, create the <filename>ifconfig.eth0</filename>
|
---|
| 26 | file with the following commands. Adjust as necessary for additional
|
---|
| 27 | interfaces.</para>
|
---|
| 28 |
|
---|
| 29 | <para><emphasis>Note</emphasis>: this will overwrite any existing file.</para>
|
---|
| 30 |
|
---|
| 31 | <screen><userinput><command>cat > /etc/sysconfig/network-devices/ifconfig.eth0 << "EOF"</command>
|
---|
[050d775d] | 32 | ONBOOT=yes
|
---|
[b5ea3492] | 33 | DHCP_START="<place appropriate start parameters here>"
|
---|
| 34 | DHCP_STOP="-r <add additional stop parameters here>"
|
---|
| 35 | SERVICE=dhclient
|
---|
[36f9a23] | 36 | <command>EOF</command></userinput></screen>
|
---|
[050d775d] | 37 |
|
---|
[a338b48] | 38 | <para>For more information on the appropriate
|
---|
[52b9837f] | 39 | <envar>DHCP_START</envar> and <envar>DHCP_STOP</envar>
|
---|
[36f9a23] | 40 | values, examine the man page for <command>dhclient</command>.</para>
|
---|
[050d775d] | 41 |
|
---|
[b5ea3492] | 42 | <para>Finally, you should then create
|
---|
| 43 | the <filename>/etc/dhclient.conf</filename> using the following
|
---|
| 44 | commands. Append to the file if you have more than one interface:</para>
|
---|
[f45b1953] | 45 |
|
---|
[36f9a23] | 46 | <screen><userinput><command>cat > /etc/dhclient.conf << "EOF"</command>
|
---|
[f45b1953] | 47 | # dhclient.conf
|
---|
| 48 |
|
---|
| 49 | interface "eth0"{
|
---|
| 50 | prepend domain-name-servers 127.0.0.1;
|
---|
| 51 | request subnet-mask, broadcast-address, time-offset, routers,
|
---|
| 52 | domain-name, domain-name-servers, host-name;
|
---|
| 53 | require subnet-mask, domain-name-servers;
|
---|
| 54 | }
|
---|
| 55 | # end dhclient.conf
|
---|
[36f9a23] | 56 | <command>EOF</command></userinput></screen>
|
---|
[f45b1953] | 57 |
|
---|
| 58 | </sect1>
|
---|