[246c904] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
[f45b1953] | 8 | <sect1 id="connect-dhcp-client">
|
---|
[00bb024c] | 9 | <?dbhtml filename="dhcpclient.html"?>
|
---|
[f07203c5] | 10 | <title>DHCP-&dhcp-version;</title>
|
---|
[f45b1953] | 11 |
|
---|
[f07203c5] | 12 | <para>The <application><acronym>DHCP</acronym></application> package comes with
|
---|
[1af021dc] | 13 | both a client (<command>dhclient</command>) and a server program for
|
---|
[f07203c5] | 14 | using <acronym>DHCP</acronym>. If you want to install this package,
|
---|
[050d775d] | 15 | the instructions can be found at <xref linkend="dhcp"/>.
|
---|
| 16 | Note that if you only want to use the client, you
|
---|
| 17 | do <emphasis>not</emphasis> need to run the server and so do not need
|
---|
| 18 | the startup script and links provided for the server daemon.
|
---|
[36f9a23] | 19 | You only need to run the <acronym>DHCP</acronym> server if you're providing
|
---|
| 20 | this service to a network, and it's likely that you'll know if that's the
|
---|
[050d775d] | 21 | case; if it isn't, don't run the server! Once you have installed the
|
---|
| 22 | package, return here for information on how to configure the client
|
---|
[36f9a23] | 23 | (<command>dhclient</command>).</para>
|
---|
[f45b1953] | 24 |
|
---|
[1af021dc] | 25 | <para>To configure <command>dhclient</command>, you need to first install
|
---|
[b5ea3492] | 26 | the network service script,
|
---|
| 27 | <filename>/etc/sysconfig/network-devices/services/dhclient</filename>
|
---|
| 28 | included in the <xref linkend="intro-important-bootscripts"/> package.</para>
|
---|
[f45b1953] | 29 |
|
---|
[b5ea3492] | 30 | <screen><userinput><command>make install-service-dhclient</command></userinput></screen>
|
---|
[050d775d] | 31 |
|
---|
[afa198d] | 32 | <para>Next, create the
|
---|
| 33 | <filename>/etc/sysconfig/network-devices/ifconfig.eth0/dhclient</filename>
|
---|
| 34 | configuration file with the following commands. Adjust as necessary for
|
---|
| 35 | additional interfaces.</para>
|
---|
[b5ea3492] | 36 |
|
---|
[afa198d] | 37 | <screen><userinput><command>install -d /etc/sysconfig/network-devices/ifconfig.eth0 &&
|
---|
| 38 | cat > /etc/sysconfig/network-devices/ifconfig.eth0/dhclient << "EOF"</command>
|
---|
| 39 | ONBOOT="yes"
|
---|
| 40 | SERVICE="dhclient"
|
---|
| 41 | DHCP_START="-q <replaceable>[add additional start parameters here]</replaceable>"
|
---|
| 42 | DHCP_STOP="-q -r <replaceable>[add additional stop parameters here]</replaceable>"
|
---|
[36f9a23] | 43 | <command>EOF</command></userinput></screen>
|
---|
[050d775d] | 44 |
|
---|
[a338b48] | 45 | <para>For more information on the appropriate
|
---|
[52b9837f] | 46 | <envar>DHCP_START</envar> and <envar>DHCP_STOP</envar>
|
---|
[36f9a23] | 47 | values, examine the man page for <command>dhclient</command>.</para>
|
---|
[050d775d] | 48 |
|
---|
[afa198d] | 49 | <para>Finally, you should create the
|
---|
| 50 | <filename>/etc/dhclient.conf</filename> file using the following
|
---|
| 51 | commands:</para>
|
---|
| 52 |
|
---|
[802e6fe7] | 53 | <note><para>You'll need to add a second interface definition to the file if you
|
---|
| 54 | have more than one interface.</para></note>
|
---|
[f45b1953] | 55 |
|
---|
[36f9a23] | 56 | <screen><userinput><command>cat > /etc/dhclient.conf << "EOF"</command>
|
---|
[f45b1953] | 57 | # dhclient.conf
|
---|
| 58 |
|
---|
| 59 | interface "eth0"{
|
---|
| 60 | prepend domain-name-servers 127.0.0.1;
|
---|
| 61 | request subnet-mask, broadcast-address, time-offset, routers,
|
---|
| 62 | domain-name, domain-name-servers, host-name;
|
---|
| 63 | require subnet-mask, domain-name-servers;
|
---|
| 64 | }
|
---|
| 65 | # end dhclient.conf
|
---|
[36f9a23] | 66 | <command>EOF</command></userinput></screen>
|
---|
[f45b1953] | 67 |
|
---|
| 68 | </sect1>
|
---|