]> git.ipfire.org Git - thirdparty/dhcp.git/blame - server/dhcpd.8
Remove unused variable
[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
40dhcpd - Dynamic Host Configuration Protocol server
41.SH SYNOPSIS
42.B dhcpd
43[
44.B -p
45.I port
46]
d27562c7
TL
47[
48.B -f
49]
50[
51.I if0
52[
53.I ...ifN
54]
55]
ee0cda4d
TL
56.SH DESCRIPTION
57dhcpd(8) implements the Dynamic Host Configuration Protocol (DHCP) and
08fe7cdb
TL
58the Internet Bootstrap Protocol (BOOTP). DHCP allows hosts on a
59TCP/IP network to request and be assigned IP addresses, and also to
60discover information about the network to which they are attached.
61BOOTP provides similar but much more limited functionality.
ee0cda4d
TL
62.SH OPERATION
63.PP
08fe7cdb
TL
64The DHCP protocol allows a host which is unknown to the network
65administrator to be automatically assigned a new IP address out of a
66pool of IP addresses for its network. In order for this to work, the
67network administrator allocates address pools in each subnet and
ee0cda4d
TL
68enters them into the dhcpd.conf(5) file.
69.PP
08fe7cdb 70On startup, dhcpd reads the
ee0cda4d 71.IR dhcpd.conf
08fe7cdb
TL
72file and keeps the list of available addresses on each subnet in
73memory. When a host requests an address using the DHCP protocol,
74dhcpd allocates an address for it. Each such host is assigned a
75lease, which expires after an amount of time chosen by the
76administrator (by default, one day). As leases expire, the hosts to
77which they are assigned are expected to renew the leases if they wish
78to continue to use the addresses. Once a lease has expired, the host
79to which that lease is assigned is no longer permitted to use the IP
80address assigned to it.
ee0cda4d 81.PP
08fe7cdb 82In order to keep track of leases across system reboots and server
ee0cda4d
TL
83restarts, dhcpd keeps a list of leases it has assigned in the
84dhcpd.leases(5) file. Before dhcpd grants a lease to a host, it
85records the lease in this file and makes sure that the contents of the
86file are flushed to disk. This ensures that even in the event of a
87system crash, dhcpd will not forget about a lease that it has
88assigned. On startup, after reading the dhcpd.conf file, dhcpd
89reads the dhcpd.leases file to refresh its memory about what leases
90have been assigned.
91.PP
92New leases are appended to the end of the dhcpd.leases
08fe7cdb 93file. In order to prevent the file from becoming arbitrarily large,
ee0cda4d
TL
94from time to time dhcpd creates a new dhcpd.leases file from its
95in-core lease database. Once this file has been written to disk, the
96old file is renamed
97.IR dhcpd.leases~ ,
98and the new file is renamed dhcpd.leases. If the system crashes in
99the middle of this process, whichever dhcpd.leases file remains will
100contain all the lease information, so there is no need for a special
101crash recovery process.
102.PP
08fe7cdb
TL
103BOOTP support is also provided by this server. Unlike DHCP, the
104BOOTP protocol requires that the server know the hardware address of
105the client that is to be booted. The network administrator must
106determine that address, allocate an IP address for the client, and
ee0cda4d
TL
107enter that information into the dhcpd.conf file.
108.PP
109Whenever changes are made to the dhcpd.conf file, dhcpd must be
110restarted. To restart dhcpd, send a SIGTERM (signal 15) to the
111process ID contained in
112.IR /dhcpd.pid ,
113and then re-invoke dhcpd.
08fe7cdb 114
d27562c7
TL
115.SH COMMAND LINE
116.PP
117dhcpd normally identifies all interfaces on the system which are up,
118and listens on each interface. If possible, point-to-point
119interfaces and the loopback interface are eliminated, but on some
120systems this is not possible. For this reason, the interfaces on
121which dhcp should listen may be explicitly specified on the command
122line.
123.PP
124dhcpd normally listens on port 67, which is the BOOTP Server Port
125(the DHCP and BOOTP protocols both use this port). If desired, dhcpd
126may be invoked with the
127.B -p
128flag, followed by a port number, so as to provide DHCP service on a
129different port. This is mostly useful for debugging purposes.
130.PP
131On some System-V systems, it may be desirable to run dhcp from
132/etc/inittab. If so, dhcpd should be invoked with the
133.B -f
134flag, which causes dhcpd to run in the foreground; otherwise, dhcpd
135automatically detaches itself from the process group that started it
136and runs in the background.
ee0cda4d
TL
137.SH CONFIGURATION
138The syntax of the dhcpd.conf(8) file is discussed seperately. This
139section should be used as an overview of the configuration process,
140and the dhcpd.conf(8) documentation should be consulted for detailed
141reference information.
142.PP
143.SH Subnets
144dhcpd needs to know the subnet numbers and netmasks of all subnets for
145which it will be providing service. In addition, in order to
146dynamically allocate addresses, it must be assigned one or more ranges
147of addresses on each subnet which it can in turn assign to client
148hosts as they boot. Thus, a very simple configuration providing DHCP
08fe7cdb
TL
149support might look like this:
150.nf
151.sp 1
152 subnet 239.252.197.0 netmask 255.255.255.0
153 range 239.252.197.10 239.252.197.250;
154.fi
ee0cda4d 155.PP
08fe7cdb
TL
156Multiple address ranges may be specified like this:
157.nf
158.sp 1
159 subnet 239.252.197.0 netmask 255.255.255.0
160 range 239.252.197.10 239.252.197.107
161 range 239.252.197.113 239.252.197.250;
162.fi
ee0cda4d 163.PP
08fe7cdb
TL
164If a subnet will only be provided with BOOTP service and no dynamic
165address assignment, the range clause can be left out entirely, but the
166subnet statement must appear.
ee0cda4d
TL
167.PP
168.SH Lease Lengths
08fe7cdb
TL
169DHCP leases can be assigned almost any length from zero seconds to
170infinity. What lease length makes sense for any given subnet, or for
171any given installation, will vary depending on the kinds of hosts
172being served.
ee0cda4d 173.PP
08fe7cdb
TL
174For example, in an office environment where systems are added from
175time to time and removed from time to time, but move relatively
176infrequently, it might make sense to allow lease times of a month of
177more. In a final test environment on a manufacturing floor, it may
178make more sense to assign a maximum lease length of 30 minutes -
179enough time to go through a simple test procedure on a network
180appliance before packaging it up for delivery.
ee0cda4d 181.PP
08fe7cdb
TL
182It is possible to specify two lease lengths: the default length that
183will be assigned if a client doesn't ask for any particular lease
184length, and a maximum lease length. These are specified as clauses
185to the subnet command:
186.nf
187.sp 1
188 subnet 239.252.197.0 netmask 255.255.255.0
189 range 239.252.197.10 239.252.197.107
190 default-lease-time 600
191 max-lease-time 7200;
192.fi
ee0cda4d 193.PP
08fe7cdb
TL
194This particular subnet declaration specifies a default lease time of
195600 seconds (ten minutes), and a maximum lease time of 7200 seconds
196(two hours). Other common values would be 86400 (one day), 604800
197(one week) and 2592000 (30 days).
ee0cda4d 198.PP
08fe7cdb
TL
199Each subnet need not have the same lease\(emin the case of an office
200environment and a manufacturing environment served by the same DHCP
201server, it might make sense to have widely disparate values for
202default and maximum lease times on each subnet.
ee0cda4d
TL
203.SH BOOTP Support
204Each BOOTP client must be explicitly declared in the dhcpd.conf
08fe7cdb
TL
205file. A very basic client declaration will specify the client
206network interface's hardware address and the IP address to assign to
207that client. If the client needs to be able to load a boot file from
208the server, that file's name must be specified. A simple bootp
209client declaration might look like this:
210.nf
211.sp 1
212 host haagen hardware ethernet 08:00:2b:4c:59:23
213 fixed-address 239.252.197.9
214 filename "/tftpboot/haagen.boot";
215.fi
ee0cda4d 216.SH Options
08fe7cdb
TL
217DHCP (and also BOOTP with Vendor Extensions) provide a mechanism
218whereby the server can provide the client with information about how
219to configure its network interface (e.g., subnet mask), and also how
220the client can access various network services (e.g., DNS, IP routers,
221and so on).
ee0cda4d 222.PP
08fe7cdb
TL
223These options can be specified on a per-subnet basis, and, for BOOTP
224clients, also on a per-client basis. In the event that a BOOTP
225client declaration specifies options that are also specified in its
226subnet declaration, the options specified in the client declaration
227take precedence. An reasonably complete DHCP configuration might
228look something like this:
229.nf
230.sp 1
231 subnet 239.252.197.0 netmask 255.255.255.0
232 range 239.252.197.10 239.252.197.250
233 default-lease-time 600 max-lease-time 7200
234 option subnet-mask 255.255.255.0
235 option broadcast-address 239.252.197.255
236 option routers 239.252.197.1
237 option domain-name-servers 239.252.197.2, 239.252.197.3
238 option domain-name "isc.org";
239.fi
ee0cda4d 240.PP
08fe7cdb
TL
241A bootp host on that subnet that needs to be in a different domain and
242use a different name server might be declared as follows:
243.nf
244.sp 1
245 host haagen hardware ethernet 08:00:2b:4c:59:23
246 fixed-address 239.252.197.9
247 filename "/tftpboot/haagen.boot"
248 option domain-name-servers 192.5.5.1
249 option domain-name "vix.com";
250.fi
ee0cda4d 251.PP
08fe7cdb 252A complete list of DHCP Options and their syntaxes is provided in
ee0cda4d
TL
253dhcpd.conf(5).
254.SH FILES
255.B ETCDIR/dhcpd.conf, DBDIR/dhcpd.leases, RUNDIR/dhcpd.pid,
256.B DBDIR/dhcpd.leases~.
257.SH SEE ALSO
258dhcpd.conf(5), dhcpd.leases(5)
259.SH AUTHOR
260.B dhcpd(8)
261was written by Ted Lemon <mellon@vix.com>
08fe7cdb
TL
262under a contract with Vixie Labs. Funding
263for this project was provided by the Internet Software Corporation.
264Information about the Internet Software Consortium can be found at
ee0cda4d 265.B http://www.isc.org/isc.