[0931098] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[6732c094] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[0931098] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
[fa3e12e1] | 6 | <!-- isc have a weird way of offering the tarballs and without dots in version!
|
---|
| 7 | FIXME - change hardcoded 423s in http url and version in ftp when upgrading -->
|
---|
| 8 | <!ENTITY dhcp-download-http "http://www.isc.org/software/dhcp/423/download/dhcp-423targz?download=">
|
---|
| 9 | <!ENTITY dhcp-download-ftp "ftp://ftp.isc.org/isc/dhcp/4.2.3/dhcp-&dhcp-version;.tar.gz">
|
---|
| 10 | <!ENTITY dhcp-md5sum "a06649ec5336d284fc86a0232c0edd63">
|
---|
| 11 | <!ENTITY dhcp-size "9.1 MB">
|
---|
| 12 | <!ENTITY dhcp-buildsize "185 MB (client and server), 140MB client only, 172MB server only">
|
---|
| 13 | <!ENTITY dhcp-time "0.7 SBU (client and server, or server), 0.6 SBU client only ">
|
---|
[0931098] | 14 | ]>
|
---|
| 15 |
|
---|
[40330fcd] | 16 | <sect1 id="dhcp" xreflabel="DHCP-&dhcp-version;">
|
---|
[6ad98e12] | 17 | <?dbhtml filename="dhcp.html"?>
|
---|
| 18 |
|
---|
| 19 | <sect1info>
|
---|
| 20 | <othername>$LastChangedBy$</othername>
|
---|
| 21 | <date>$Date$</date>
|
---|
| 22 | </sect1info>
|
---|
| 23 |
|
---|
| 24 | <title>DHCP-&dhcp-version;</title>
|
---|
| 25 |
|
---|
| 26 | <indexterm zone="dhcp">
|
---|
| 27 | <primary sortas="a-dhcp">Dhcp</primary>
|
---|
| 28 | </indexterm>
|
---|
| 29 |
|
---|
| 30 | <sect2 role="package">
|
---|
| 31 | <title>Introduction to DHCP</title>
|
---|
| 32 |
|
---|
| 33 | <para>The <application>DHCP</application> package contains both the client
|
---|
| 34 | and server programs for DHCP. <command>dhclient</command> (the client) is
|
---|
| 35 | useful for connecting your computer to a network which uses DHCP to assign
|
---|
| 36 | network addresses. <command>dhcpd</command> (the server) is useful for
|
---|
| 37 | assigning network addresses on your private network.</para>
|
---|
| 38 |
|
---|
[fa3e12e1] | 39 | &lfs70_checked;
|
---|
| 40 |
|
---|
[6ad98e12] | 41 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 42 | <itemizedlist spacing="compact">
|
---|
| 43 | <listitem>
|
---|
| 44 | <para>Download (HTTP): <ulink url="&dhcp-download-http;"/></para>
|
---|
| 45 | </listitem>
|
---|
| 46 | <listitem>
|
---|
| 47 | <para>Download (FTP): <ulink url="&dhcp-download-ftp;"/></para>
|
---|
| 48 | </listitem>
|
---|
| 49 | <listitem>
|
---|
| 50 | <para>Download MD5 sum: &dhcp-md5sum;</para>
|
---|
| 51 | </listitem>
|
---|
| 52 | <listitem>
|
---|
| 53 | <para>Download size: &dhcp-size;</para>
|
---|
| 54 | </listitem>
|
---|
| 55 | <listitem>
|
---|
| 56 | <para>Estimated disk space required: &dhcp-buildsize;</para>
|
---|
| 57 | </listitem>
|
---|
| 58 | <listitem>
|
---|
| 59 | <para>Estimated build time: &dhcp-time;</para>
|
---|
| 60 | </listitem>
|
---|
| 61 | </itemizedlist>
|
---|
| 62 |
|
---|
[413bf97] | 63 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
| 64 | <itemizedlist spacing='compact'>
|
---|
[b89d0335] | 65 | <listitem>
|
---|
[fa3e12e1] | 66 | <para>Recommended Patch (for client):
|
---|
| 67 | <ulink url="&patch-root;/dhcp-&dhcp-version;-iproute2-1.patch"/></para>
|
---|
[b89d0335] | 68 | </listitem>
|
---|
[413bf97] | 69 | <listitem>
|
---|
[d378ea3c] | 70 | <para>Optional Patch:
|
---|
[fa3e12e1] | 71 | <ulink url="&patch-root;/dhcp-&dhcp-version;-missing_ipv6-1.patch"/></para>
|
---|
[413bf97] | 72 | </listitem>
|
---|
| 73 | </itemizedlist>
|
---|
| 74 |
|
---|
[6ad98e12] | 75 | <bridgehead renderas="sect3">DHCP Dependencies</bridgehead>
|
---|
| 76 |
|
---|
| 77 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
[fa3e12e1] | 78 | <para role="required"><xref linkend="net-tools"/> is required at runtime
|
---|
| 79 | by <command>dhclient</command> if you do not use the iproute2 patch.</para>
|
---|
[6ad98e12] | 80 |
|
---|
[3cb0c57] | 81 | <para condition="html" role="usernotes">User Notes:
|
---|
| 82 | <ulink url="&blfs-wiki;/dhcp"/></para>
|
---|
| 83 |
|
---|
[6ad98e12] | 84 | </sect2>
|
---|
| 85 |
|
---|
| 86 | <sect2 role="kernel" id='dhcp-kernel'>
|
---|
| 87 | <title>Kernel Configuration</title>
|
---|
| 88 |
|
---|
[fa3e12e1] | 89 | <para>You must have Packet Socket support (Networking
|
---|
[d378ea3c] | 90 | Support ⇒ Networking Options ⇒ Packet Socket) compiled into
|
---|
[fa3e12e1] | 91 | the kernel. If you do not have IPv6 support (Networking Support ⇒
|
---|
| 92 | Networking Options ⇒ The IPv6 Protocol) compiled in, then you
|
---|
| 93 | must use the missing_ipv6 patch.</para>
|
---|
[6ad98e12] | 94 |
|
---|
| 95 | <indexterm zone="dhcp dhcp-kernel">
|
---|
| 96 | <primary sortas="d-dhcp">DHCP</primary>
|
---|
| 97 | </indexterm>
|
---|
| 98 |
|
---|
| 99 | </sect2>
|
---|
| 100 |
|
---|
| 101 | <sect2 role="installation">
|
---|
| 102 | <title>Installation of DHCP</title>
|
---|
| 103 |
|
---|
[fa3e12e1] | 104 | <para>If you have not compiled IPv6 support into the kernel, apply the
|
---|
| 105 | missing_ipv6 patch</para>
|
---|
[b89d0335] | 106 |
|
---|
[fa3e12e1] | 107 | <screen><userinput>patch -Np1 -i ../dhcp-&dhcp-version;-missing_ipv6-1.patch</userinput></screen>
|
---|
[b89d0335] | 108 |
|
---|
[fa3e12e1] | 109 | <para>If you are installing the client, apply the iproute2 patch unless you
|
---|
| 110 | will have installed <application>net-tools</application> by the time you wish
|
---|
| 111 | to use the client:</para>
|
---|
[61e058b] | 112 |
|
---|
[1e9bd536] | 113 | <screen><userinput>patch -Np1 -i ../dhcp-&dhcp-version;-iproute2-1.patch</userinput></screen>
|
---|
[61e058b] | 114 |
|
---|
[6ad98e12] | 115 | <para>Install <application>DHCP</application> by running
|
---|
| 116 | the following commands:</para>
|
---|
| 117 |
|
---|
[fa3e12e1] | 118 | <screen><userinput>sed -i 's%\(^sbindir =\).*%\1 @prefix@@sbindir@%' server/Makefile.in &&
|
---|
| 119 | ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
|
---|
| 120 | --sbindir=/sbin \
|
---|
| 121 | --with-srv-lease-file=/var/state/dhcp/dhcpd.leases \
|
---|
| 122 | --with-srv6-lease-file=/var/state/dhcp/dhcpd6.leases \
|
---|
| 123 | --with-cli-lease-file=/var/state/dhclient.leases \
|
---|
| 124 | --with-cli6-lease-file=/var/state/dhclient6.leases &&
|
---|
| 125 | sed -i 's/-Werror//' {client,common,dst,omapip,relay,server,tests}/Makefile</userinput></screen>
|
---|
| 126 |
|
---|
| 127 | <para>If you only wish to build the server, enter:</para>
|
---|
| 128 | <screen><userinput>sed -i 's/ client//' Makefile</userinput></screen>
|
---|
[6ad98e12] | 129 |
|
---|
[fa3e12e1] | 130 | <para>If you only wish to build the client, enter:</para>
|
---|
| 131 | <screen><userinput>sed -i 's/ dhcpctl relay server//' Makefile</userinput></screen>
|
---|
| 132 |
|
---|
| 133 | <para>Build your chosen variant(s) with:</para>
|
---|
| 134 | <screen><userinput>make</userinput></screen>
|
---|
| 135 |
|
---|
| 136 | <para>To test the results, issue: <command>make check</command></para>
|
---|
[275b1da] | 137 |
|
---|
[6ad98e12] | 138 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
[04a6794] | 139 |
|
---|
[fa3e12e1] | 140 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
| 141 |
|
---|
| 142 | <para>The supplied <filename>/etc/dhcpd.conf</filename> (server) and
|
---|
| 143 | <filename>/etc/dhclient.conf</filename> (client) are examples for a
|
---|
| 144 | specific <literal>BSD</literal> system. They are unlikely to be appropriate
|
---|
| 145 | to your needs, but you may wish to read them for ideas before deleting them
|
---|
| 146 | or moving them to a different location.</para>
|
---|
| 147 |
|
---|
| 148 | <para>Now create the director(y,ies) for the leases.</para>
|
---|
| 149 |
|
---|
| 150 | <para>For the server:</para>
|
---|
| 151 |
|
---|
| 152 | <screen role="root"><userinput>mkdir -pv /var/state/dhcp</userinput></screen>
|
---|
| 153 |
|
---|
| 154 | <para>For the client:</para>
|
---|
| 155 | <screen role="root"><userinput>mkdir -pv /var/state</userinput></screen>
|
---|
[0931098] | 156 |
|
---|
[6ad98e12] | 157 | </sect2>
|
---|
[0931098] | 158 |
|
---|
[6ad98e12] | 159 | <sect2 role="commands">
|
---|
| 160 | <title>Command Explanations</title>
|
---|
[0931098] | 161 |
|
---|
[fa3e12e1] | 162 | <para><command>sed -i 's%\(^sbindir =\).*%\1 @prefix@@sbindir@%' server/Makefile.in</command>
|
---|
| 163 | This command moves the <command>dhcp</command> program to
|
---|
| 164 | <filename class='directory'>/usr/sbin</filename> instead of
|
---|
| 165 | <filename class='directory'>/sbin</filename> because it is not needed
|
---|
| 166 | while the server is booting.</para>
|
---|
| 167 |
|
---|
| 168 | <para><command>--sbindir=/sbin</command> The <command>dhclient</command>
|
---|
| 169 | program is moved to <filename class='directory'>/sbin</filename> instead of
|
---|
| 170 | <filename class='directory'>/usr/sbin</filename> so that it is available
|
---|
| 171 | during boot, e.g. if <filename class='directory'>/usr</filename> is to be
|
---|
| 172 | an <literal>nfs</literal> mount.</para>
|
---|
| 173 |
|
---|
| 174 | <para><command>--with-*-lease-files=...</command> By default, lease files
|
---|
| 175 | are placed in <filename class='directory'>/var/db</filename> which is an
|
---|
| 176 | anachronism.</para>
|
---|
| 177 |
|
---|
| 178 | <para><command>sed -i 's/-Werror//' {client,common,...}/Makefile</command> -
|
---|
| 179 | the Makefiles in this package add <literal>-Werror</literal> to the
|
---|
| 180 | <literal>CFLAGS</literal>. On recent versions of <application>gcc</application>
|
---|
| 181 | more things, particularly unused variables, create warnings. The
|
---|
| 182 | <literal>-Werror</literal> flag causes warnings to break the build, so we
|
---|
| 183 | remove it where necessary.</para>
|
---|
| 184 |
|
---|
| 185 | <para><command>sed -i 's/ something//' Makefile</command> - this stops the
|
---|
| 186 | build from entering the director(y,ies) named here.</para>
|
---|
| 187 |
|
---|
| 188 | <para><option>rm -v /usr/lib/lib{dhcpctl,dst,omapi}.a</option> - there is
|
---|
| 189 | no easy way to prevent these static libraries being installed, but they are
|
---|
| 190 | only needed during the build of this package. <filename>libdhcpctl.a</filename>
|
---|
| 191 | is only installed if you build the server.</para>
|
---|
[0931098] | 192 |
|
---|
[6ad98e12] | 193 | </sect2>
|
---|
[0931098] | 194 |
|
---|
[6ad98e12] | 195 | <sect2 role="configuration">
|
---|
| 196 | <title>Configuring DHCP</title>
|
---|
[0931098] | 197 |
|
---|
[6ad98e12] | 198 | <sect3 id='dhcp-config'>
|
---|
| 199 | <title>Config Files</title>
|
---|
[04a6794] | 200 |
|
---|
[6ad98e12] | 201 | <para><filename>/etc/dhclient.conf</filename> and
|
---|
| 202 | <filename>/etc/dhcpd.conf</filename></para>
|
---|
[04a6794] | 203 |
|
---|
[6ad98e12] | 204 | <indexterm zone="dhcp dhcp-config">
|
---|
| 205 | <primary sortas="e-etc-dhclient.conf">/etc/dhclient.conf</primary>
|
---|
| 206 | </indexterm>
|
---|
[04a6794] | 207 |
|
---|
[6ad98e12] | 208 | <indexterm zone="dhcp dhcp-config">
|
---|
| 209 | <primary sortas="e-etc-dhcpd.conf">/etc/dhcpd.conf</primary>
|
---|
| 210 | </indexterm>
|
---|
[0931098] | 211 |
|
---|
[6ad98e12] | 212 | </sect3>
|
---|
[0931098] | 213 |
|
---|
[6ad98e12] | 214 | <sect3 id='dhcp-init'>
|
---|
| 215 | <title>Configuration Information</title>
|
---|
[0931098] | 216 |
|
---|
[6ad98e12] | 217 | <para>Information on configuring the DHCP client can be
|
---|
[a324403] | 218 | found in <xref linkend="basicnet-connect"/>.</para>
|
---|
[0931098] | 219 |
|
---|
[6ad98e12] | 220 | <para>Note that you only need the DHCP server if you want to issue
|
---|
| 221 | LAN addresses over your network. The DHCP client doesn't need this
|
---|
| 222 | script to be used. Also note that this script is coded for the
|
---|
| 223 | <emphasis role="strong">eth1</emphasis> interface, which may need
|
---|
| 224 | to be modified for your hardware configuration.</para>
|
---|
[4774914f] | 225 |
|
---|
[6ad98e12] | 226 | <para>Install the <filename>/etc/rc.d/init.d/dhcp</filename>
|
---|
[5254d12] | 227 | init script included in the <xref linkend="bootscripts"/>
|
---|
[6ad98e12] | 228 | package.</para>
|
---|
[04a6794] | 229 |
|
---|
[6ad98e12] | 230 | <indexterm zone="dhcp dhcp-init">
|
---|
| 231 | <primary sortas="f-dhcp">dhcpd</primary>
|
---|
| 232 | </indexterm>
|
---|
[0931098] | 233 |
|
---|
[6ad98e12] | 234 | <screen role="root"><userinput>make install-dhcp</userinput></screen>
|
---|
[0931098] | 235 |
|
---|
[6ad98e12] | 236 | <para>The lease file must exist on startup. The following command will
|
---|
| 237 | satisfy that requirement:</para>
|
---|
[0931098] | 238 |
|
---|
[6ad98e12] | 239 | <screen role="root"><userinput>touch /var/state/dhcp/dhcpd.leases</userinput></screen>
|
---|
[0931098] | 240 |
|
---|
[6ad98e12] | 241 | <para>The following commands will create a base configuration file
|
---|
| 242 | for a DHCP server. There are several options that you may want to
|
---|
| 243 | add (information that is passed back to the DHCP client) and those
|
---|
| 244 | are covered in the man pages for <filename>dhcp.conf</filename>.</para>
|
---|
| 245 |
|
---|
| 246 | <screen role="root"><userinput>cat > /etc/dhcpd.conf << "EOF"
|
---|
| 247 | <literal>default-lease-time 72000;
|
---|
[0931098] | 248 | max-lease-time 144000;
|
---|
| 249 |
|
---|
[3cb0c57] | 250 | subnet <replaceable><192.168.5.0></replaceable> netmask <replaceable><255.255.255.0></replaceable> {
|
---|
[d378ea3c] | 251 | range <replaceable><192.168.5.10> <192.168.5.240></replaceable>;
|
---|
[3cb0c57] | 252 | option broadcast-address <replaceable><192.168.5.255></replaceable>;
|
---|
| 253 | option routers <replaceable><192.168.5.1></replaceable>;
|
---|
[6ad98e12] | 254 | }</literal>
|
---|
| 255 | EOF</userinput></screen>
|
---|
| 256 |
|
---|
| 257 | <para>All addresses should be changed to meet your circumstance.</para>
|
---|
| 258 |
|
---|
| 259 | </sect3>
|
---|
| 260 |
|
---|
| 261 | </sect2>
|
---|
| 262 |
|
---|
| 263 | <sect2 role="content">
|
---|
| 264 | <title>Contents</title>
|
---|
| 265 |
|
---|
| 266 | <segmentedlist>
|
---|
| 267 | <segtitle>Installed Programs</segtitle>
|
---|
| 268 | <segtitle>Installed Libraries</segtitle>
|
---|
| 269 | <segtitle>Installed Directories</segtitle>
|
---|
| 270 |
|
---|
| 271 | <seglistitem>
|
---|
| 272 | <seg>dhcpd, dhcrelay, dhclient, dhclient-script, and omshell</seg>
|
---|
[fa3e12e1] | 273 | <seg>libbdhcpctl.a, libdst.a, libomapi.a</seg>
|
---|
[6ad98e12] | 274 | <seg>/var/state/dhcp, /usr/include/omapip, and /usr/include/isi-dhcp</seg>
|
---|
| 275 | </seglistitem>
|
---|
| 276 | </segmentedlist>
|
---|
| 277 |
|
---|
| 278 | <variablelist>
|
---|
| 279 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 280 | <?dbfo list-presentation="list"?>
|
---|
| 281 | <?dbhtml list-presentation="table"?>
|
---|
| 282 |
|
---|
| 283 | <varlistentry id="dhclient">
|
---|
| 284 | <term><command>dhclient</command></term>
|
---|
| 285 | <listitem>
|
---|
| 286 | <para>is the implementation of the DHCP client.</para>
|
---|
| 287 | <indexterm zone="dhcp dhclient">
|
---|
| 288 | <primary sortas="b-dhclient">dhclient</primary>
|
---|
| 289 | </indexterm>
|
---|
| 290 | </listitem>
|
---|
| 291 | </varlistentry>
|
---|
| 292 |
|
---|
[fa3e12e1] | 293 | <varlistentry id="dhclient-script">
|
---|
| 294 | <term><command>dhclient-script</command></term>
|
---|
| 295 | <listitem>
|
---|
| 296 | <para>is used by dhclient to (re)configure interfaces. It can make
|
---|
| 297 | extra changes by invoking custom dhclient-{entry,exit}-hooks.</para>
|
---|
| 298 | <indexterm zone="dhcp dhclient-script">
|
---|
| 299 | <primary sortas="b-dhclient-script">dhclient-script</primary>
|
---|
| 300 | </indexterm>
|
---|
| 301 | </listitem>
|
---|
| 302 | </varlistentry>
|
---|
| 303 |
|
---|
[6ad98e12] | 304 | <varlistentry id="dhcpd">
|
---|
| 305 | <term><command>dhcpd</command></term>
|
---|
| 306 | <listitem>
|
---|
| 307 | <para>implements Dynamic Host Configuration Protocol (DHCP) and
|
---|
| 308 | Internet Bootstrap Protocol (BOOTP) requests for network
|
---|
| 309 | addresses.</para>
|
---|
| 310 | <indexterm zone="dhcp dhcpd">
|
---|
| 311 | <primary sortas="b-dhcpd">dhcpd</primary>
|
---|
| 312 | </indexterm>
|
---|
| 313 | </listitem>
|
---|
| 314 | </varlistentry>
|
---|
| 315 |
|
---|
| 316 | <varlistentry id="dhcrelay">
|
---|
| 317 | <term><command>dhcrelay</command></term>
|
---|
| 318 | <listitem>
|
---|
| 319 | <para>provides a means to accept DHCP and BOOTP requests on a subnet
|
---|
| 320 | without a DHCP server and relay them to a DHCP server on another
|
---|
| 321 | subnet.</para>
|
---|
| 322 | <indexterm zone="dhcp dhcrelay">
|
---|
| 323 | <primary sortas="b-dhcrelay">dhcrelay</primary>
|
---|
| 324 | </indexterm>
|
---|
| 325 | </listitem>
|
---|
| 326 | </varlistentry>
|
---|
| 327 |
|
---|
| 328 | <varlistentry id="omshell">
|
---|
| 329 | <term><command>omshell</command></term>
|
---|
| 330 | <listitem>
|
---|
| 331 | <para> provides an interactive way to connect to, query, and
|
---|
| 332 | possibly change, the ISC DHCP Server's state via OMAPI, the
|
---|
| 333 | Object Management API.</para>
|
---|
| 334 | <indexterm zone="dhcp omshell">
|
---|
| 335 | <primary sortas="b-omshell">omshell</primary>
|
---|
| 336 | </indexterm>
|
---|
| 337 | </listitem>
|
---|
| 338 | </varlistentry>
|
---|
| 339 |
|
---|
| 340 | </variablelist>
|
---|
| 341 |
|
---|
| 342 | </sect2>
|
---|
[04a6794] | 343 |
|
---|
[f45b1953] | 344 | </sect1>
|
---|