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