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