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