summaryrefslogtreecommitdiff
path: root/usr.sbin/bootpd/bootpd.8
blob: 9f92cb1f856f3d66c4f68855ccb739f3f76dbb36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
.\"	$OpenBSD: bootpd.8,v 1.11 2003/05/29 18:31:53 jmc Exp $
.\"
.\" Copyright (c) 1988, 1989, 1991 Carnegie Mellon University
.\"
.Dd November 6, 1993
.Dt BOOTPD 8
.Os
.Sh NAME
.Nm bootpd , bootpgw
.Nd Internet Boot Protocol server/gateway
.Sh SYNOPSIS
.Nm bootpd
.Op Fl is
.Op Fl t Ar timeout
.Op Fl d Ar level
.Op Fl c Ar chdir-path
.Bk -words
.Op Ar bootptab Op Ar dumpfile
.Ek
.Nm bootpgw
.Op Fl is
.Op Fl t Ar timeout
.Op Fl d Ar level
.Ar server
.Sh DESCRIPTION
.Nm bootpd
implements an Internet Bootstrap Protocol (BOOTP) server as defined in
RFC 951, RFC 1532, and RFC 1533.
.Nm bootpgw
implements a simple BOOTP gateway which can be used to forward
requests and responses between clients on one subnet and a BOOTP server
(i.e.,
.Nm bootpd )
on another subnet.
While either
.Nm bootpd
or
.Nm bootpgw
will forward BOOTREPLY packets, only
.Nm bootpgw
will forward BOOTREQUEST packets.
.Pp
One host on each network segment is normally configured to run either
.Nm bootpd
or
.Nm bootpgw
from
.Xr inetd 8
by including one of the following lines in the file
.Pa /etc/inetd.conf :
.Pp
.Bd -literal
bootps dgram udp wait root /usr/sbin/bootpd bootpd bootptab
bootps dgram udp wait root /usr/sbin/bootpgw bootpgw server
.Ed
.Pp
This mode of operation is referred to as "inetd mode" and causes
.Nm bootpd
(or
.Nm bootpgw )
to be started only when a boot request arrives.
If it does not receive another packet within fifteen minutes of the last one
it received, it will exit to conserve system resources.
The
.Fl t
option controls this timeout (see
.Sx OPTIONS ) .
.Pp
It is also possible to run
.Nm bootpd
(or
.Nm bootpgw )
in "stand-alone mode" (without
.Xr inetd 8 )
by simply invoking it from a shell like any other regular command.
Stand-alone mode is particularly useful when
.Nm bootpd
is used with a large configuration database, where the start up
delay might otherwise prevent timely response to client requests.
(Automatic start up in stand-alone mode can be done by invoking
.Nm bootpd
from within
.Pa /etc/rc.local ,
for example.)
Stand-alone mode is less useful for
.Nm bootpgw
which
has very little start up delay because
it does not read a configuration file.
.Pp
Either program automatically detects whether it was invoked from
.Xr inetd 8
or from a shell and automatically selects the appropriate mode.
The
.Fl s
or
.Fl i
option may be used to force stand-alone or inetd mode, respectively (see
.Sx OPTIONS ) .
.Sh OPTIONS
.Bl -tag -width Ds
.It Fl t Ar timeout
Specifies the
.Ar timeout
value (in minutes) that a
.Nm bootpd
or
.Nm bootpgw
process will wait for a BOOTP packet before exiting.
If no packets are received for
.Ar timeout
minutes, then the program will exit.
A timeout value of zero means "run forever".
In stand-alone mode, this option is forced to zero.
.It Fl d Ar debug-level
Sets the
.Ar debug-level
variable that controls the amount of debugging messages generated.
For example, -d4 or -d 4 will set the debugging level to 4.
For compatibility with older versions of
.Nm bootpd ,
omitting the numeric parameter (i.e., just -d) will
simply increment the debug level by one.
.It Fl c Ar chdir-path
Sets the current directory used by
.Nm bootpd
while checking the existence and size of client boot files.
This is useful when client boot files are specified as relative pathnames, and
.Nm bootpd
needs to use the same current directory as the TFTP server
(typically
.Pa /tftpboot ) .
This option is not recognized by
.Nm bootpgw .
.It Fl i
Force inetd mode.
This option is obsolete, but remains for compatibility with older versions of
.Nm bootpd .
.It Fl s
Force stand-alone mode.
This option is obsolete, but remains for compatibility with older versions of
.Nm bootpd .
.It Ar bootptab
Specifies the name of the configuration file from which
.Nm bootpd
loads its database of known clients and client options
.Pf ( Nm bootpd
only).
.It Ar dumpfile
Specifies the name of the file that
.Nm bootpd
will dump its internal database into when it receives a
SIGUSR1 signal
.Pf ( Nm bootpd
only).
This option is only recognized if
.Nm bootpd
was compiled with the -DDEBUG flag.
.It Ar server
Specifies the name of a BOOTP server to which
.Nm bootpgw
will forward all BOOTREQUEST packets it receives
.Pf ( Nm bootpgw
only).
.El
.Sh OPERATION
Both
.Nm bootpd
and
.Nm bootpgw
operate similarly in that both listen for any packets sent to the
.Em bootps
port, and both simply forward any BOOTREPLY packets.
They differ in their handling of BOOTREQUEST packets.
.Pp
When
.Nm bootpgw
is started, it determines the address of a BOOTP server
whose name is provided as a command line parameter.
When
.Nm bootpgw
receives a BOOTREQUEST packet, it sets the "gateway address"
and "hop count" fields in the packet and forwards the packet
to the BOOTP server at the address determined earlier.
Requests are forwarded only if they indicate that
the client has been waiting for at least three seconds.
.Pp
When
.Nm bootpd
is started it reads a configuration file (normally
.Pa /etc/bootptab )
that initializes the internal database of known clients and client options.
This internal database is reloaded from the configuration file when
.Nm bootpd
receives a hangup signal (SIGHUP) or when it discovers that the
configuration file has changed.
.Pp
When
.Nm bootpd
receives a BOOTREQUEST packet, it
.\" checks the modification time of the
.\" configuration file and reloads the database if necessary.
.\" Then it
looks for a database entry matching the client request.
If the client is known,
.Nm bootpd
composes a BOOTREPLY packet using the database entry found above,
and sends the reply to the client (possibly using a gateway).
If the client is unknown, the request is discarded
(with a notice if debug \*[Gt] 0).
.Pp
If
.Nm bootpd
is compiled with the -DDEBUG option, receipt of a SIGUSR1 signal causes
it to dump its internal database to the file
.Pa /var/run/bootpd.dump
or the dumpfile specified as a command line parameter.
.Pp
During initialization, both programs determine the UDP port numbers to be used
by calling
.Xr getservbyname 3
(which normally uses
.Pa /etc/services ) .
Two service names (and port numbers) are used:
.Pp
.Bd -literal
	bootps - BOOTP Server listening port
	bootpc - BOOTP Client destination port
.Ed
.Pp
If the port numbers cannot be determined using
.Xr getservbyname 3
then the values default to boopts=67 and bootpc=68.
.Sh FILES
.Bl -tag -width "/var/run/bootpd.dump" -compact
.It /etc/bootptab
Database file read by
.Nm bootpd .
.It /var/run/bootpd.dump
Debugging dump file created by
.Nm bootpd .
.It /etc/services
Internet service numbers.
.It /tftpboot
Current directory typically used by the TFTP server and
.Nm bootpd .
.El
.Sh BUGS
Individual host entries must not exceed 1024 characters.
.Sh CREDITS
This distribution is currently maintained by
.An Walter L. Wimer Aq walt+@cmu.edu .
.Pp
The original BOOTP server was created by
Bill Croft at Stanford University in January 1986.
.Pp
The current version of
.Nm bootpd
is primarily the work of David Kovar,
Drew D. Perkins, and Walter L. Wimer,
at Carnegie Mellon University.
.Pp
Enhancements and bug-fixes have been contributed by
(in alphabetical order):
.Pp
.Bl -tag -width Ds -compact
.It An Danny Backx Aq db@sunbim.be
.It An John Brezak Aq brezak@ch.hp.com
.It An Frank da Cruz Aq fdc@cc.columbia.edu
.It An David R. Linn Aq drl@vuse.vanderbilt.edu
.It An Jim McKim Aq mckim@lerc.nasa.gov
.It An Gordon W. Ross Aq gwr@mc.com
.It An Jason Zions Aq jazz@hal.com
.El
.Sh SEE ALSO
.Xr bootptab 5 ,
.Xr inetd 8 ,
.Xr tftpd 8
.Pp
DARPA Internet Request For Comments:
.Bd -literal
RFC  951 Bootstrap Protocol
RFC 1532 Clarifications and Extensions for the Bootstrap Protocol
RFC 1533 DHCP Options and BOOTP Vendor Extensions
.Ed