]>
Commit | Line | Data |
---|---|---|
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 | |
40 | dhcpd - 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 |
57 | dhcpd(8) implements the Dynamic Host Configuration Protocol (DHCP) and | |
08fe7cdb TL |
58 | the Internet Bootstrap Protocol (BOOTP). DHCP allows hosts on a |
59 | TCP/IP network to request and be assigned IP addresses, and also to | |
60 | discover information about the network to which they are attached. | |
61 | BOOTP provides similar but much more limited functionality. | |
ee0cda4d TL |
62 | .SH OPERATION |
63 | .PP | |
08fe7cdb TL |
64 | The DHCP protocol allows a host which is unknown to the network |
65 | administrator to be automatically assigned a new IP address out of a | |
66 | pool of IP addresses for its network. In order for this to work, the | |
67 | network administrator allocates address pools in each subnet and | |
ee0cda4d TL |
68 | enters them into the dhcpd.conf(5) file. |
69 | .PP | |
08fe7cdb | 70 | On startup, dhcpd reads the |
ee0cda4d | 71 | .IR dhcpd.conf |
08fe7cdb TL |
72 | file and keeps the list of available addresses on each subnet in |
73 | memory. When a host requests an address using the DHCP protocol, | |
74 | dhcpd allocates an address for it. Each such host is assigned a | |
75 | lease, which expires after an amount of time chosen by the | |
76 | administrator (by default, one day). As leases expire, the hosts to | |
77 | which they are assigned are expected to renew the leases if they wish | |
78 | to continue to use the addresses. Once a lease has expired, the host | |
79 | to which that lease is assigned is no longer permitted to use the IP | |
80 | address assigned to it. | |
ee0cda4d | 81 | .PP |
08fe7cdb | 82 | In order to keep track of leases across system reboots and server |
ee0cda4d TL |
83 | restarts, dhcpd keeps a list of leases it has assigned in the |
84 | dhcpd.leases(5) file. Before dhcpd grants a lease to a host, it | |
85 | records the lease in this file and makes sure that the contents of the | |
86 | file are flushed to disk. This ensures that even in the event of a | |
87 | system crash, dhcpd will not forget about a lease that it has | |
88 | assigned. On startup, after reading the dhcpd.conf file, dhcpd | |
89 | reads the dhcpd.leases file to refresh its memory about what leases | |
90 | have been assigned. | |
91 | .PP | |
92 | New leases are appended to the end of the dhcpd.leases | |
08fe7cdb | 93 | file. In order to prevent the file from becoming arbitrarily large, |
ee0cda4d TL |
94 | from time to time dhcpd creates a new dhcpd.leases file from its |
95 | in-core lease database. Once this file has been written to disk, the | |
96 | old file is renamed | |
97 | .IR dhcpd.leases~ , | |
98 | and the new file is renamed dhcpd.leases. If the system crashes in | |
99 | the middle of this process, whichever dhcpd.leases file remains will | |
100 | contain all the lease information, so there is no need for a special | |
101 | crash recovery process. | |
102 | .PP | |
08fe7cdb TL |
103 | BOOTP support is also provided by this server. Unlike DHCP, the |
104 | BOOTP protocol requires that the server know the hardware address of | |
105 | the client that is to be booted. The network administrator must | |
106 | determine that address, allocate an IP address for the client, and | |
ee0cda4d TL |
107 | enter that information into the dhcpd.conf file. |
108 | .PP | |
109 | Whenever changes are made to the dhcpd.conf file, dhcpd must be | |
110 | restarted. To restart dhcpd, send a SIGTERM (signal 15) to the | |
111 | process ID contained in | |
112 | .IR /dhcpd.pid , | |
113 | and then re-invoke dhcpd. | |
08fe7cdb | 114 | |
d27562c7 TL |
115 | .SH COMMAND LINE |
116 | .PP | |
117 | dhcpd normally identifies all interfaces on the system which are up, | |
118 | and listens on each interface. If possible, point-to-point | |
119 | interfaces and the loopback interface are eliminated, but on some | |
120 | systems this is not possible. For this reason, the interfaces on | |
121 | which dhcp should listen may be explicitly specified on the command | |
122 | line. | |
123 | .PP | |
124 | dhcpd normally listens on port 67, which is the BOOTP Server Port | |
125 | (the DHCP and BOOTP protocols both use this port). If desired, dhcpd | |
126 | may be invoked with the | |
127 | .B -p | |
128 | flag, followed by a port number, so as to provide DHCP service on a | |
129 | different port. This is mostly useful for debugging purposes. | |
130 | .PP | |
131 | On 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 | |
134 | flag, which causes dhcpd to run in the foreground; otherwise, dhcpd | |
135 | automatically detaches itself from the process group that started it | |
136 | and runs in the background. | |
ee0cda4d TL |
137 | .SH CONFIGURATION |
138 | The syntax of the dhcpd.conf(8) file is discussed seperately. This | |
139 | section should be used as an overview of the configuration process, | |
140 | and the dhcpd.conf(8) documentation should be consulted for detailed | |
141 | reference information. | |
142 | .PP | |
143 | .SH Subnets | |
144 | dhcpd needs to know the subnet numbers and netmasks of all subnets for | |
145 | which it will be providing service. In addition, in order to | |
146 | dynamically allocate addresses, it must be assigned one or more ranges | |
147 | of addresses on each subnet which it can in turn assign to client | |
148 | hosts as they boot. Thus, a very simple configuration providing DHCP | |
08fe7cdb TL |
149 | support 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 |
156 | Multiple 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 |
164 | If a subnet will only be provided with BOOTP service and no dynamic |
165 | address assignment, the range clause can be left out entirely, but the | |
166 | subnet statement must appear. | |
ee0cda4d TL |
167 | .PP |
168 | .SH Lease Lengths | |
08fe7cdb TL |
169 | DHCP leases can be assigned almost any length from zero seconds to |
170 | infinity. What lease length makes sense for any given subnet, or for | |
171 | any given installation, will vary depending on the kinds of hosts | |
172 | being served. | |
ee0cda4d | 173 | .PP |
08fe7cdb TL |
174 | For example, in an office environment where systems are added from |
175 | time to time and removed from time to time, but move relatively | |
176 | infrequently, it might make sense to allow lease times of a month of | |
177 | more. In a final test environment on a manufacturing floor, it may | |
178 | make more sense to assign a maximum lease length of 30 minutes - | |
179 | enough time to go through a simple test procedure on a network | |
180 | appliance before packaging it up for delivery. | |
ee0cda4d | 181 | .PP |
08fe7cdb TL |
182 | It is possible to specify two lease lengths: the default length that |
183 | will be assigned if a client doesn't ask for any particular lease | |
184 | length, and a maximum lease length. These are specified as clauses | |
185 | to 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 |
194 | This particular subnet declaration specifies a default lease time of |
195 | 600 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 |
199 | Each subnet need not have the same lease\(emin the case of an office |
200 | environment and a manufacturing environment served by the same DHCP | |
201 | server, it might make sense to have widely disparate values for | |
202 | default and maximum lease times on each subnet. | |
ee0cda4d TL |
203 | .SH BOOTP Support |
204 | Each BOOTP client must be explicitly declared in the dhcpd.conf | |
08fe7cdb TL |
205 | file. A very basic client declaration will specify the client |
206 | network interface's hardware address and the IP address to assign to | |
207 | that client. If the client needs to be able to load a boot file from | |
208 | the server, that file's name must be specified. A simple bootp | |
209 | client 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 |
217 | DHCP (and also BOOTP with Vendor Extensions) provide a mechanism |
218 | whereby the server can provide the client with information about how | |
219 | to configure its network interface (e.g., subnet mask), and also how | |
220 | the client can access various network services (e.g., DNS, IP routers, | |
221 | and so on). | |
ee0cda4d | 222 | .PP |
08fe7cdb TL |
223 | These options can be specified on a per-subnet basis, and, for BOOTP |
224 | clients, also on a per-client basis. In the event that a BOOTP | |
225 | client declaration specifies options that are also specified in its | |
226 | subnet declaration, the options specified in the client declaration | |
227 | take precedence. An reasonably complete DHCP configuration might | |
228 | look 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 |
241 | A bootp host on that subnet that needs to be in a different domain and |
242 | use 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 | 252 | A complete list of DHCP Options and their syntaxes is provided in |
ee0cda4d TL |
253 | dhcpd.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 | |
258 | dhcpd.conf(5), dhcpd.leases(5) | |
259 | .SH AUTHOR | |
260 | .B dhcpd(8) | |
261 | was written by Ted Lemon <mellon@vix.com> | |
08fe7cdb TL |
262 | under a contract with Vixie Labs. Funding |
263 | for this project was provided by the Internet Software Corporation. | |
264 | Information about the Internet Software Consortium can be found at | |
ee0cda4d | 265 | .B http://www.isc.org/isc. |