[f45b1953] | 1 | <sect2>
|
---|
[40330fcd] | 2 | <title>Configuring <application><acronym>DHCP</acronym></application></title>
|
---|
[f45b1953] | 3 |
|
---|
| 4 | <sect3><title>Config files</title>
|
---|
[e80cc95] | 5 | <para><filename>/etc/dhclient.conf</filename></para>
|
---|
[f45b1953] | 6 | </sect3>
|
---|
| 7 |
|
---|
| 8 | <sect3><title>Configuration Information</title>
|
---|
| 9 |
|
---|
[40330fcd] | 10 | <para>Information on configuring the <acronym>DHCP</acronym> client can be
|
---|
[65df9fca] | 11 | found in <xref linkend="connect-dhcp"/>.</para>
|
---|
[f45b1953] | 12 |
|
---|
[ae9c528] | 13 | <para>Note that you only need the <acronym>DHCP</acronym> server if
|
---|
[40330fcd] | 14 | you want to issue <acronym>LAN</acronym> addresses over your network. The
|
---|
| 15 | <acronym>DHCP</acronym> client doesn't need this script to be used. Also note
|
---|
| 16 | that this script is coded for the <emphasis role="strong">eth1</emphasis>
|
---|
[ae9c528] | 17 | interface, which may need to be modified for your hardware configuration.</para>
|
---|
[f45b1953] | 18 |
|
---|
[65df9fca] | 19 | <para>Install the <filename>/etc/rc.d/init.d/dhcp</filename>
|
---|
[ae9c528] | 20 | init script included in the <xref linkend="intro-important-bootscripts"/> package.</para>
|
---|
| 21 |
|
---|
| 22 | <screen><userinput><command>make install-dhcp</command></userinput></screen>
|
---|
[f45b1953] | 23 |
|
---|
[c51584b] | 24 | <para>The lease file must exist on startup. The following command will
|
---|
| 25 | satisfy that requirement:</para>
|
---|
| 26 |
|
---|
[40330fcd] | 27 | <screen><userinput><command>touch /var/state/dhcp/dhcpd.leases</command></userinput></screen>
|
---|
[c51584b] | 28 |
|
---|
[65df9fca] | 29 | <para>The following commands will create a base configuration file for a
|
---|
[40330fcd] | 30 | <acronym>DHCP</acronym> server. There are several options that you may want to
|
---|
| 31 | add (information that is passed back to the <acronym>DHCP</acronym> client) and
|
---|
| 32 | those are covered in the man pages for <filename>dhcp.conf</filename>.</para>
|
---|
[f45b1953] | 33 |
|
---|
[40330fcd] | 34 | <screen><userinput><command>cat > /etc/dhcpd.conf << "EOF"</command>
|
---|
[f45b1953] | 35 | default-lease-time 72000;
|
---|
| 36 | max-lease-time 144000;
|
---|
[47a3d8ff] | 37 | ddns-update-style ad-hoc;
|
---|
[f45b1953] | 38 |
|
---|
[65df9fca] | 39 | subnet <replaceable>[192.168.5.0]</replaceable> netmask <replaceable>[255.255.255.0]</replaceable> {
|
---|
| 40 | range <replaceable>[192.168.5.10] [192.168.5.240]</replaceable>;
|
---|
| 41 | option broadcast-address <replaceable>[195.168.5.255]</replaceable>;
|
---|
| 42 | option routers <replaceable>[192.168.5.1]</replaceable>;
|
---|
[f45b1953] | 43 | }
|
---|
[40330fcd] | 44 | <command>EOF</command></userinput></screen>
|
---|
[f45b1953] | 45 |
|
---|
| 46 | <para>All addresses should be changed to meet your circumstance.</para>
|
---|
| 47 |
|
---|
| 48 | </sect3>
|
---|
| 49 |
|
---|
| 50 | </sect2>
|
---|
| 51 |
|
---|