144099b7bSPaul Traina.\" Copyright (c) 1988, 1989, 1991 Carnegie Mellon University 244099b7bSPaul Traina.\" 3*35131b46SMark Johnston.Dd May 21, 2019 481389de0SPhilippe Charnier.Dt BOOTPD 8 5e22bb389SRuslan Ermilov.Os 681389de0SPhilippe Charnier.Sh NAME 781389de0SPhilippe Charnier.Nm bootpd , bootpgw 881389de0SPhilippe Charnier.Nd Internet Boot Protocol server/gateway 981389de0SPhilippe Charnier.Sh SYNOPSIS 1076081989SRuslan Ermilov.Nm 11caa40776SRuslan Ermilov.Op Fl i | s 1281389de0SPhilippe Charnier.Op Fl c Ar chdir-path 13f9566be8SPeter Pentchev.Op Fl d Ar level 14f9566be8SPeter Pentchev.Op Fl h Ar hostname 15f9566be8SPeter Pentchev.Op Fl t Ar timeout 1681389de0SPhilippe Charnier.Oo 1781389de0SPhilippe Charnier.Ar bootptab 1881389de0SPhilippe Charnier.Op Ar dumpfile 1981389de0SPhilippe Charnier.Oc 2081389de0SPhilippe Charnier.Nm bootpgw 21caa40776SRuslan Ermilov.Op Fl i | s 2281389de0SPhilippe Charnier.Op Fl d Ar level 23f9566be8SPeter Pentchev.Op Fl h Ar hostname 24f9566be8SPeter Pentchev.Op Fl t Ar timeout 2581389de0SPhilippe Charnier.Ar server 2681389de0SPhilippe Charnier.Sh DESCRIPTION 273f162cb8SPhilippe CharnierThe 283f162cb8SPhilippe Charnier.Nm 293f162cb8SPhilippe Charnierutility 3044099b7bSPaul Trainaimplements an Internet Bootstrap Protocol (BOOTP) server as defined in 3144099b7bSPaul TrainaRFC951, RFC1532, and RFC1533. 323f162cb8SPhilippe CharnierThe 333f162cb8SPhilippe Charnier.Nm bootpgw 343f162cb8SPhilippe Charnierutility implements a simple BOOTP gateway which can be used to forward 3544099b7bSPaul Trainarequests and responses between clients on one subnet and a 36d0353b83SRuslan ErmilovBOOTP server (i.e.\& 3776081989SRuslan Ermilov.Nm ) 38c481aa05SRuslan Ermilovon another subnet. 39c481aa05SRuslan ErmilovWhile either 4081389de0SPhilippe Charnier.Nm 4144099b7bSPaul Trainaor 4281389de0SPhilippe Charnier.Nm bootpgw 4344099b7bSPaul Trainawill forward BOOTREPLY packets, only 4481389de0SPhilippe Charnier.Nm bootpgw 4544099b7bSPaul Trainawill forward BOOTREQUEST packets. 4681389de0SPhilippe Charnier.Pp 4744099b7bSPaul TrainaOne host on each network segment is normally configured to run either 4881389de0SPhilippe Charnier.Nm 4944099b7bSPaul Trainaor 5081389de0SPhilippe Charnier.Nm bootpgw 5144099b7bSPaul Trainafrom 5281389de0SPhilippe Charnier.Xr inetd 8 5344099b7bSPaul Trainaby including one of the following lines in the file 5481389de0SPhilippe Charnier.Pa /etc/inetd.conf : 5581389de0SPhilippe Charnier.Pp 5681389de0SPhilippe Charnier.Dl bootps dgram udp wait root /usr/libexec/bootpd bootpd /etc/bootptab 5781389de0SPhilippe Charnier.Dl bootps dgram udp wait root /usr/libexec/bootpgw bootpgw server 5881389de0SPhilippe Charnier.Pp 5944099b7bSPaul TrainaThis mode of operation is referred to as "inetd mode" and causes 6081389de0SPhilippe Charnier.Nm 6144099b7bSPaul Traina(or 6281389de0SPhilippe Charnier.Nm bootpgw ) 63c481aa05SRuslan Ermilovto be started only when a boot request arrives. 64c481aa05SRuslan ErmilovIf it does not 6544099b7bSPaul Trainareceive another packet within fifteen minutes of the last one 66c481aa05SRuslan Ermilovit received, it will exit to conserve system resources. 67c481aa05SRuslan ErmilovThe 6881389de0SPhilippe Charnier.Fl t 6944099b7bSPaul Trainaoption controls this timeout (see OPTIONS). 7081389de0SPhilippe Charnier.Pp 7144099b7bSPaul TrainaIt is also possible to run 7281389de0SPhilippe Charnier.Nm 7344099b7bSPaul Traina(or 7481389de0SPhilippe Charnier.Nm bootpgw ) 7544099b7bSPaul Trainain "standalone mode" (without 7681389de0SPhilippe Charnier.Xr inetd 8 ) 7744099b7bSPaul Trainaby simply invoking it from a shell like any other regular command. 7844099b7bSPaul TrainaStandalone mode is particularly useful when 7981389de0SPhilippe Charnier.Nm 8044099b7bSPaul Trainais used with a large configuration database, where the start up 8144099b7bSPaul Trainadelay might otherwise prevent timely response to client requests. 8244099b7bSPaul Traina(Automatic start up in standalone mode can be done by invoking 8381389de0SPhilippe Charnier.Nm 8444099b7bSPaul Trainafrom within 8581389de0SPhilippe Charnier.Pa /etc/rc.local , 8644099b7bSPaul Trainafor example.) 8744099b7bSPaul TrainaStandalone mode is less useful for 8881389de0SPhilippe Charnier.Nm bootpgw 8944099b7bSPaul Trainawhich 9044099b7bSPaul Trainahas very little start up delay because 9144099b7bSPaul Trainait does not read a configuration file. 9281389de0SPhilippe Charnier.Pp 9344099b7bSPaul TrainaEither program automatically detects whether it was invoked from inetd 9444099b7bSPaul Trainaor from a shell and automatically selects the appropriate mode. 9544099b7bSPaul TrainaThe 9681389de0SPhilippe Charnier.Fl s 9744099b7bSPaul Trainaor 9881389de0SPhilippe Charnier.Fl i 9944099b7bSPaul Trainaoption may be used to force standalone or inetd mode respectively 10044099b7bSPaul Traina(see OPTIONS). 10181389de0SPhilippe Charnier.Sh OPTIONS 10281389de0SPhilippe CharnierThe following options are available: 10381389de0SPhilippe Charnier.Bl -tag -width indent 104*35131b46SMark Johnston.It Fl a 105*35131b46SMark JohnstonSkip ARP table modifications. 10681389de0SPhilippe Charnier.It Fl t Ar timeout 10781389de0SPhilippe CharnierSpecify the 10881389de0SPhilippe Charnier.Ar timeout 10944099b7bSPaul Trainavalue (in minutes) that a 11081389de0SPhilippe Charnier.Nm 11144099b7bSPaul Trainaor 11281389de0SPhilippe Charnier.Nm bootpgw 11344099b7bSPaul Trainaprocess will wait for a BOOTP packet before exiting. 1149595a75aSJoseph KoshyIf no packets are received for 11581389de0SPhilippe Charnier.Ar timeout 11671c97133SJoerg Wunschminutes, then the program will exit. 11744099b7bSPaul TrainaA timeout value of zero means "run forever". 11844099b7bSPaul TrainaIn standalone mode, this option is forced to zero. 11981389de0SPhilippe Charnier.It Fl d Ar debug-level 12081389de0SPhilippe CharnierSet the 12181389de0SPhilippe Charnier.Ar debug-level 12244099b7bSPaul Trainavariable that controls the amount of debugging messages generated. 12381389de0SPhilippe CharnierFor example, 12481389de0SPhilippe Charnier.Fl d Ns 4 12581389de0SPhilippe Charnieror 12681389de0SPhilippe Charnier.Fl d 12781389de0SPhilippe Charnier4 will set the debugging level to 4. 12844099b7bSPaul TrainaFor compatibility with older versions of 12976081989SRuslan Ermilov.Nm , 130c481aa05SRuslan Ermilovomitting the numeric parameter (i.e., just 131a654c53eSRuslan Ermilov.Fl d ) 13281389de0SPhilippe Charnierwill simply increment the debug level by one. 13381389de0SPhilippe Charnier.It Fl c Ar chdir-path 13481389de0SPhilippe CharnierSet the current directory used by 13581389de0SPhilippe Charnier.Nm 136c481aa05SRuslan Ermilovwhile checking the existence and size of client boot files. 137c481aa05SRuslan ErmilovThis is 13844099b7bSPaul Trainauseful when client boot files are specified as relative pathnames, and 13981389de0SPhilippe Charnier.Nm 14044099b7bSPaul Trainaneeds to use the same current directory as the TFTP server 14181389de0SPhilippe Charnier(typically 142d0353b83SRuslan Ermilov.Pa /tftpboot ) . 14381389de0SPhilippe CharnierThis option is not recognized by 14481389de0SPhilippe Charnier.Nm bootpgw . 145f9566be8SPeter Pentchev.It Fl h Ar hostname 146f9566be8SPeter PentchevSpecify the hostname corresponding to the IP address to listen on. 147f9566be8SPeter PentchevBy default, 148f9566be8SPeter Pentchev.Nm 149f9566be8SPeter Pentchevlistens on the IP address corresponding to the machine's hostname, as 150f9566be8SPeter Pentchevreturned by 151f9566be8SPeter Pentchev.Xr gethostname 3 . 15281389de0SPhilippe Charnier.It Fl i 153c481aa05SRuslan ErmilovForce inetd mode. 154c481aa05SRuslan ErmilovThis option is obsolete, but remains for 15544099b7bSPaul Trainacompatibility with older versions of 15676081989SRuslan Ermilov.Nm . 15781389de0SPhilippe Charnier.It Fl s 158c481aa05SRuslan ErmilovForce standalone mode. 159c481aa05SRuslan ErmilovThis option is obsolete, but remains for 16044099b7bSPaul Trainacompatibility with older versions of 16176081989SRuslan Ermilov.Nm . 16281389de0SPhilippe Charnier.It Ar bootptab 16381389de0SPhilippe CharnierSpecify the name of the configuration file from which 16481389de0SPhilippe Charnier.Nm 16544099b7bSPaul Trainaloads its database of known clients and client options 16676081989SRuslan Ermilov.No ( Nm 16744099b7bSPaul Trainaonly). 16881389de0SPhilippe Charnier.It Ar dumpfile 16981389de0SPhilippe CharnierSpecify the name of the file that 17081389de0SPhilippe Charnier.Nm 17144099b7bSPaul Trainawill dump its internal database into when it receives a 17244099b7bSPaul TrainaSIGUSR1 signal 17376081989SRuslan Ermilov.No ( Nm 174c481aa05SRuslan Ermilovonly). 175c481aa05SRuslan ErmilovThis option is only recognized if 17681389de0SPhilippe Charnier.Nm 17744099b7bSPaul Trainawas compiled with the -DDEBUG flag. 17881389de0SPhilippe Charnier.It Ar server 17981389de0SPhilippe CharnierSpecify the name of a BOOTP server to which 18081389de0SPhilippe Charnier.Nm bootpgw 18144099b7bSPaul Trainawill forward all BOOTREQUEST packets it receives 18281389de0SPhilippe Charnier.Pf ( Nm bootpgw 18344099b7bSPaul Trainaonly). 18481389de0SPhilippe Charnier.El 18581389de0SPhilippe Charnier.Sh OPERATION 18644099b7bSPaul TrainaBoth 18781389de0SPhilippe Charnier.Nm 18844099b7bSPaul Trainaand 18981389de0SPhilippe Charnier.Nm bootpgw 19044099b7bSPaul Trainaoperate similarly in that both listen for any packets sent to the 19181389de0SPhilippe Charnier.Em bootps 19244099b7bSPaul Trainaport, and both simply forward any BOOTREPLY packets. 19344099b7bSPaul TrainaThey differ in their handling of BOOTREQUEST packets. 19481389de0SPhilippe Charnier.Pp 19544099b7bSPaul TrainaWhen 19681389de0SPhilippe Charnier.Nm bootpgw 19744099b7bSPaul Trainais started, it determines the address of a BOOTP server 198c481aa05SRuslan Ermilovwhose name is provided as a command line parameter. 199c481aa05SRuslan ErmilovWhen 20081389de0SPhilippe Charnier.Nm bootpgw 20144099b7bSPaul Trainareceives a BOOTREQUEST packet, it sets the "gateway address" 20244099b7bSPaul Trainaand "hop count" fields in the packet and forwards the packet 20344099b7bSPaul Trainato the BOOTP server at the address determined earlier. 20444099b7bSPaul TrainaRequests are forwarded only if they indicate that 20544099b7bSPaul Trainathe client has been waiting for at least three seconds. 20681389de0SPhilippe Charnier.Pp 20744099b7bSPaul TrainaWhen 20881389de0SPhilippe Charnier.Nm 20944099b7bSPaul Trainais started it reads a configuration file, (normally 210d0353b83SRuslan Ermilov.Pa /etc/bootptab ) 21144099b7bSPaul Trainathat initializes the internal database of known clients and client 212c481aa05SRuslan Ermilovoptions. 213c481aa05SRuslan ErmilovThis internal database is reloaded 21444099b7bSPaul Trainafrom the configuration file when 21581389de0SPhilippe Charnier.Nm 21644099b7bSPaul Trainareceives a hangup signal (SIGHUP) or when it discovers that the 21744099b7bSPaul Trainaconfiguration file has changed. 21881389de0SPhilippe Charnier.Pp 21944099b7bSPaul TrainaWhen 22081389de0SPhilippe Charnier.Nm 22144099b7bSPaul Trainareceives a BOOTREQUEST packet, it 22244099b7bSPaul Traina.\" checks the modification time of the 22344099b7bSPaul Traina.\" configuration file and reloads the database if necessary. Then it 22444099b7bSPaul Trainalooks for a database entry matching the client request. 22544099b7bSPaul TrainaIf the client is known, 22681389de0SPhilippe Charnier.Nm 22744099b7bSPaul Trainacomposes a BOOTREPLY packet using the database entry found above, 22844099b7bSPaul Trainaand sends the reply to the client (possibly using a gateway). 22944099b7bSPaul TrainaIf the client is unknown, the request is discarded 23044099b7bSPaul Traina(with a notice if debug > 0). 23181389de0SPhilippe Charnier.Pp 23244099b7bSPaul TrainaIf 23381389de0SPhilippe Charnier.Nm 23444099b7bSPaul Trainais compiled with the -DDEBUG option, receipt of a SIGUSR1 signal causes 23544099b7bSPaul Trainait to dump its internal database to the file 23681389de0SPhilippe Charnier.Pa /tmp/bootpd.dump 23744099b7bSPaul Trainaor the dumpfile specified as a command line parameter. 23881389de0SPhilippe Charnier.Pp 23944099b7bSPaul TrainaDuring initialization, both programs 24044099b7bSPaul Trainadetermine the UDP port numbers to be used by calling 24181389de0SPhilippe Charnier.Xr getservbyname 3 2429595a75aSJoseph Koshy(which normally uses 243d0353b83SRuslan Ermilov.Pa /etc/services ) . 24444099b7bSPaul TrainaTwo service names (and port numbers) are used: 24581389de0SPhilippe Charnier.Pp 24681389de0SPhilippe Charnier.Dl bootps BOOTP Server listening port 24781389de0SPhilippe Charnier.Dl bootpc BOOTP Client destination port 24881389de0SPhilippe Charnier.Pp 24981389de0SPhilippe CharnierIf the port numbers cannot be determined using 25081389de0SPhilippe Charnier.Xr getservbyname 3 2519649260fSPoul-Henning Kampthen the values default to bootps=67 and bootpc=68. 25281389de0SPhilippe Charnier.Sh FILES 25381389de0SPhilippe Charnier.Bl -tag -width /tmp/bootpd.dump -compact 25481389de0SPhilippe Charnier.It Pa /etc/bootptab 25544099b7bSPaul TrainaDatabase file read by 25676081989SRuslan Ermilov.Nm . 25781389de0SPhilippe Charnier.It Pa /tmp/bootpd.dump 25844099b7bSPaul TrainaDebugging dump file created by 25976081989SRuslan Ermilov.Nm . 26081389de0SPhilippe Charnier.It Pa /etc/services 26144099b7bSPaul TrainaInternet service numbers. 26281389de0SPhilippe Charnier.It Pa /tftpboot 26344099b7bSPaul TrainaCurrent directory typically used by the TFTP server and 26476081989SRuslan Ermilov.Nm . 26581389de0SPhilippe Charnier.El 26612afe06cSJoel Dahl.Sh "SEE ALSO" 26712afe06cSJoel Dahl.Xr bootptab 5 , 26812afe06cSJoel Dahl.Xr inetd 8 , 26912afe06cSJoel Dahl.Xr tftpd 8 27012afe06cSJoel Dahl.Pp 27112afe06cSJoel DahlDARPA Internet Request For Comments: 27212afe06cSJoel Dahl.Bl -tag -width RFC1533 -compact 27312afe06cSJoel Dahl.It RFC951 27412afe06cSJoel DahlBootstrap Protocol 27512afe06cSJoel Dahl.It RFC1532 27612afe06cSJoel DahlClarifications and Extensions for the Bootstrap Protocol 27712afe06cSJoel Dahl.It RFC1533 27812afe06cSJoel DahlDHCP Options and BOOTP Vendor Extensions 27912afe06cSJoel Dahl.El 28012afe06cSJoel Dahl.Sh AUTHORS 28144099b7bSPaul TrainaThis distribution is currently maintained by 28201c2b8acSBaptiste Daroussin.An Walter L. Wimer Aq Mt walt+@cmu.edu . 28381389de0SPhilippe Charnier.Pp 28444099b7bSPaul TrainaThe original BOOTP server was created by 28581389de0SPhilippe Charnier.An Bill Croft 28681389de0SPhilippe Charnierat Stanford University in January 1986. 28781389de0SPhilippe Charnier.Pp 28844099b7bSPaul TrainaThe current version of 28981389de0SPhilippe Charnier.Nm 29081389de0SPhilippe Charnieris primarily the work of 29181389de0SPhilippe Charnier.An David Kovar , 29281389de0SPhilippe Charnier.An Drew D. Perkins , 29381389de0SPhilippe Charnierand 29481389de0SPhilippe Charnier.An Walter L. Wimer , 29544099b7bSPaul Trainaat Carnegie Mellon University. 29681389de0SPhilippe Charnier.Pp 29781389de0SPhilippe CharnierEnhancements and bug-fixes have been contributed by: 29881389de0SPhilippe Charnier.Pp 29944099b7bSPaul Traina(in alphabetical order) 30081389de0SPhilippe Charnier.Pp 301e22bb389SRuslan Ermilov.An -split 30201c2b8acSBaptiste Daroussin.An Danny Backx Aq Mt db@sunbim.be 30301c2b8acSBaptiste Daroussin.An John Brezak Aq Mt brezak@ch.hp.com 30401c2b8acSBaptiste Daroussin.An Frank da Cruz Aq Mt fdc@cc.columbia.edu 30501c2b8acSBaptiste Daroussin.An David R. Linn Aq Mt drl@vuse.vanderbilt.edu 30601c2b8acSBaptiste Daroussin.An Jim McKim Aq Mt mckim@lerc.nasa.gov 30701c2b8acSBaptiste Daroussin.An Gordon W. Ross Aq Mt gwr@mc.com 30801c2b8acSBaptiste Daroussin.An Jason Zions Aq Mt jazz@hal.com . 30912afe06cSJoel Dahl.Sh BUGS 31012afe06cSJoel DahlIndividual host entries must not exceed 1024 characters. 311