]> git.ipfire.org Git - thirdparty/dhcp.git/blame - server/dhcpd.8
new man pages
[thirdparty/dhcp.git] / server / dhcpd.8
CommitLineData
08fe7cdb
TL
1.\" dhcpd.8
2.\"
3.\" Copyright (c) 1995, 1996 The Internet Software Consortium.
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\"
10.\" 1. Redistributions of source code must retain the above copyright
11.\" notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\" notice, this list of conditions and the following disclaimer in the
14.\" documentation and/or other materials provided with the distribution.
15.\" 3. Neither the name of The Internet Software Consortium nor the names
16.\" of its contributors may be used to endorse or promote products derived
17.\" from this software without specific prior written permission.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
20.\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
21.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23.\" DISCLAIMED. IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
24.\" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
27.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
30.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31.\" SUCH DAMAGE.
32.\"
33.\" This software has been written for the Internet Software Consortium
34.\" by Ted Lemon <mellon@fugue.com> in cooperation with Vixie
35.\" Enterprises. To learn more about the Internet Software Consortium,
36.\" see ``http://www.isc.org/isc''. To learn more about Vixie
37.\" Enterprises, see ``http://www.vix.com''.
ee0cda4d
TL
38.TH dhcpd 8
39.SH NAME
5e6b52dc 40dhcpd - Dynamic Host Configuration Protocol Server
ee0cda4d
TL
41.SH SYNOPSIS
42.B dhcpd
43[
44.B -p
45.I port
46]
d27562c7
TL
47[
48.B -f
49]
50[
5e6b52dc
TL
51.B -d
52]
53[
e2ac5814
TL
54.B -cf
55.I config-file
56]
57[
58.B -lf
59.I lease-file
60]
61[
d27562c7
TL
62.I if0
63[
64.I ...ifN
65]
66]
ee0cda4d 67.SH DESCRIPTION
5e6b52dc
TL
68The Internet Software Consortium DHCP Server, dhcpd, implements the
69Dynamic Host Configuration Protocol (DHCP) and the Internet Bootstrap
70Protocol (BOOTP). DHCP allows hosts on a TCP/IP network to request
71and be assigned IP addresses, and also to discover information about
72the network to which they are attached. BOOTP provides similar
73functionality, with certain restrictions.
ee0cda4d
TL
74.SH OPERATION
75.PP
08fe7cdb
TL
76The DHCP protocol allows a host which is unknown to the network
77administrator to be automatically assigned a new IP address out of a
78pool of IP addresses for its network. In order for this to work, the
79network administrator allocates address pools in each subnet and
ee0cda4d
TL
80enters them into the dhcpd.conf(5) file.
81.PP
08fe7cdb 82On startup, dhcpd reads the
ee0cda4d 83.IR dhcpd.conf
5e6b52dc
TL
84file and stores a list of available addresses on each subnet in
85memory. When a client requests an address using the DHCP protocol,
86dhcpd allocates an address for it. Each client is assigned a lease,
87which expires after an amount of time chosen by the administrator (by
88default, one day). Before leases expire, the clients to which leases
89are assigned are expected to renew them in order to continue to use
90the addresses. Once a lease has expired, the client to which that
91lease was assigned is no longer permitted to use the leased IP
92address.
ee0cda4d 93.PP
08fe7cdb 94In order to keep track of leases across system reboots and server
ee0cda4d
TL
95restarts, dhcpd keeps a list of leases it has assigned in the
96dhcpd.leases(5) file. Before dhcpd grants a lease to a host, it
97records the lease in this file and makes sure that the contents of the
98file are flushed to disk. This ensures that even in the event of a
99system crash, dhcpd will not forget about a lease that it has
100assigned. On startup, after reading the dhcpd.conf file, dhcpd
101reads the dhcpd.leases file to refresh its memory about what leases
102have been assigned.
103.PP
104New leases are appended to the end of the dhcpd.leases
08fe7cdb 105file. In order to prevent the file from becoming arbitrarily large,
ee0cda4d
TL
106from time to time dhcpd creates a new dhcpd.leases file from its
107in-core lease database. Once this file has been written to disk, the
108old file is renamed
109.IR dhcpd.leases~ ,
110and the new file is renamed dhcpd.leases. If the system crashes in
111the middle of this process, whichever dhcpd.leases file remains will
112contain all the lease information, so there is no need for a special
113crash recovery process.
114.PP
5e6b52dc
TL
115BOOTP support is also provided by this server. Unlike DHCP, the BOOTP
116protocol does not provide a protocol for recovering
117dynamically-assigned addresses once they are no longer needed. It is
118still possible to dynamically assign addresses to BOOTP clients, but
119some administrative process for reclaiming addresses is required. By
120default, leases are granted to BOOTP clients in perpetuity, although
121the network administrator may set an earlier cutoff date or a shorter
122lease length for BOOTP leases if that makes sense.
123.PP
124BOOTP clients may also be served in the old standard way, which is to
125simply provide a declaration in the dhcpd.conf file for each
126BOOTP client, permanently assigning an address to each client.
ee0cda4d
TL
127.PP
128Whenever changes are made to the dhcpd.conf file, dhcpd must be
129restarted. To restart dhcpd, send a SIGTERM (signal 15) to the
130process ID contained in
5e6b52dc
TL
131.IR RUNDIR/dhcpd.pid ,
132and then re-invoke dhcpd. Because the DHCP server database is not as
133lightweight as a BOOTP database, dhcpd does not automatically restart
134itself when it sees a change to the dhcpd.conf file.
d27562c7
TL
135.SH COMMAND LINE
136.PP
5e6b52dc
TL
137The names of the network interfaces on which dhcpd should listen for
138broadcasts may be specified on the command line. This should be done
139on systems where dhcpd is unable to identify non-broadcast interfaces,
140but should not be required on other systems. If no interface names
141are specified on the command line dhcpd will identify all network
142interfaces which are up, elimininating non-broadcast interfaces if
143possible, and listen for DHCP broadcasts on each interface.
d27562c7 144.PP
5e6b52dc
TL
145If dhcpd should listen on a port other than the standard (port 67),
146the
d27562c7 147.B -p
5e6b52dc
TL
148flag may used. It should be followed by the udp port number on which
149dhcpd should listen. This is mostly useful for debugging purposes.
d27562c7 150.PP
5e6b52dc
TL
151To run dhcpd as a foreground process, rather than allowing it to run
152as a daemon in the background, the
d27562c7 153.B -f
5e6b52dc
TL
154flag should be specified. This is useful when running dhcpd under a
155debugger, or when running it out of inittab on System V systems.
156.PP
157To have dhcpd log to the standard error descriptor, specify the
158.B -d
159flag. This can be useful for debugging, and also at sites where a
160complete log of all dhcp activity must be kept but syslogd is not
161reliable or otherwise cannot be used. Normally, dhcpd will log all
162output using the syslog(3) function with the log facility set to
163LOG_DAEMON.
e2ac5814
TL
164.PP
165Dhcpd can be made to use an alternate configuration file with the
166.B -cf
167flag, or an alternate lease file with the
168.B -lf
169flag. Because of the importance of using the same lease database at
170all times when running dhcpd in production, these options should be
171used \fBonly\fR for testing lease files or database files in a
172non-production environment.
ee0cda4d
TL
173.SH CONFIGURATION
174The syntax of the dhcpd.conf(8) file is discussed seperately. This
175section should be used as an overview of the configuration process,
176and the dhcpd.conf(8) documentation should be consulted for detailed
177reference information.
178.PP
179.SH Subnets
180dhcpd needs to know the subnet numbers and netmasks of all subnets for
181which it will be providing service. In addition, in order to
182dynamically allocate addresses, it must be assigned one or more ranges
183of addresses on each subnet which it can in turn assign to client
184hosts as they boot. Thus, a very simple configuration providing DHCP
08fe7cdb
TL
185support might look like this:
186.nf
187.sp 1
5e6b52dc 188 subnet 239.252.197.0 netmask 255.255.255.0 {
08fe7cdb 189 range 239.252.197.10 239.252.197.250;
5e6b52dc 190 }
08fe7cdb 191.fi
ee0cda4d 192.PP
08fe7cdb
TL
193Multiple address ranges may be specified like this:
194.nf
195.sp 1
5e6b52dc
TL
196 subnet 239.252.197.0 netmask 255.255.255.0 {
197 range 239.252.197.10 239.252.197.107;
08fe7cdb 198 range 239.252.197.113 239.252.197.250;
5e6b52dc 199 }
08fe7cdb 200.fi
ee0cda4d 201.PP
08fe7cdb
TL
202If a subnet will only be provided with BOOTP service and no dynamic
203address assignment, the range clause can be left out entirely, but the
204subnet statement must appear.
ee0cda4d
TL
205.PP
206.SH Lease Lengths
08fe7cdb
TL
207DHCP leases can be assigned almost any length from zero seconds to
208infinity. What lease length makes sense for any given subnet, or for
209any given installation, will vary depending on the kinds of hosts
210being served.
ee0cda4d 211.PP
08fe7cdb
TL
212For example, in an office environment where systems are added from
213time to time and removed from time to time, but move relatively
214infrequently, it might make sense to allow lease times of a month of
215more. In a final test environment on a manufacturing floor, it may
216make more sense to assign a maximum lease length of 30 minutes -
217enough time to go through a simple test procedure on a network
218appliance before packaging it up for delivery.
ee0cda4d 219.PP
08fe7cdb
TL
220It is possible to specify two lease lengths: the default length that
221will be assigned if a client doesn't ask for any particular lease
222length, and a maximum lease length. These are specified as clauses
223to the subnet command:
224.nf
225.sp 1
5e6b52dc
TL
226 subnet 239.252.197.0 netmask 255.255.255.0 {
227 range 239.252.197.10 239.252.197.107;
228 default-lease-time 600;
08fe7cdb 229 max-lease-time 7200;
5e6b52dc 230 |
08fe7cdb 231.fi
ee0cda4d 232.PP
08fe7cdb
TL
233This particular subnet declaration specifies a default lease time of
234600 seconds (ten minutes), and a maximum lease time of 7200 seconds
235(two hours). Other common values would be 86400 (one day), 604800
236(one week) and 2592000 (30 days).
ee0cda4d 237.PP
08fe7cdb
TL
238Each subnet need not have the same lease\(emin the case of an office
239environment and a manufacturing environment served by the same DHCP
240server, it might make sense to have widely disparate values for
241default and maximum lease times on each subnet.
ee0cda4d
TL
242.SH BOOTP Support
243Each BOOTP client must be explicitly declared in the dhcpd.conf
08fe7cdb
TL
244file. A very basic client declaration will specify the client
245network interface's hardware address and the IP address to assign to
246that client. If the client needs to be able to load a boot file from
247the server, that file's name must be specified. A simple bootp
248client declaration might look like this:
249.nf
250.sp 1
fc5aedc9
TL
251 host haagen {
252 hardware ethernet 08:00:2b:4c:59:23;
5e6b52dc 253 fixed-address 239.252.197.9;
08fe7cdb 254 filename "/tftpboot/haagen.boot";
5e6b52dc 255 }
08fe7cdb 256.fi
ee0cda4d 257.SH Options
08fe7cdb
TL
258DHCP (and also BOOTP with Vendor Extensions) provide a mechanism
259whereby the server can provide the client with information about how
260to configure its network interface (e.g., subnet mask), and also how
261the client can access various network services (e.g., DNS, IP routers,
262and so on).
ee0cda4d 263.PP
08fe7cdb
TL
264These options can be specified on a per-subnet basis, and, for BOOTP
265clients, also on a per-client basis. In the event that a BOOTP
266client declaration specifies options that are also specified in its
267subnet declaration, the options specified in the client declaration
268take precedence. An reasonably complete DHCP configuration might
269look something like this:
270.nf
271.sp 1
5e6b52dc
TL
272 subnet 239.252.197.0 netmask 255.255.255.0 {
273 range 239.252.197.10 239.252.197.250;
274 default-lease-time 600 max-lease-time 7200;
275 option subnet-mask 255.255.255.0;
276 option broadcast-address 239.252.197.255;
277 option routers 239.252.197.1;
278 option domain-name-servers 239.252.197.2, 239.252.197.3;
08fe7cdb 279 option domain-name "isc.org";
5e6b52dc 280 }
08fe7cdb 281.fi
ee0cda4d 282.PP
08fe7cdb
TL
283A bootp host on that subnet that needs to be in a different domain and
284use a different name server might be declared as follows:
285.nf
286.sp 1
5e6b52dc
TL
287 host haagen hardware ethernet 08:00:2b:4c:59:23 {
288 fixed-address 239.252.197.9;
289 filename "/tftpboot/haagen.boot";
290 option domain-name-servers 192.5.5.1;
08fe7cdb 291 option domain-name "vix.com";
5e6b52dc 292 }
08fe7cdb 293.fi
ee0cda4d 294.PP
5e6b52dc
TL
295A more complete description of the dhcpd.conf file syntax is provided
296in dhcpd.conf(5).
ee0cda4d
TL
297.SH FILES
298.B ETCDIR/dhcpd.conf, DBDIR/dhcpd.leases, RUNDIR/dhcpd.pid,
299.B DBDIR/dhcpd.leases~.
300.SH SEE ALSO
301dhcpd.conf(5), dhcpd.leases(5)
302.SH AUTHOR
303.B dhcpd(8)
304was written by Ted Lemon <mellon@vix.com>
08fe7cdb
TL
305under a contract with Vixie Labs. Funding
306for this project was provided by the Internet Software Corporation.
307Information about the Internet Software Consortium can be found at
ee0cda4d 308.B http://www.isc.org/isc.