This tutorial explains Linux “bootpd” command, options and its usage with examples.
bootpd implements an Internet Bootstrap Protocol (BOOTP) server as defined in RFC951, RFC1532, and RFC1533. This server also provides some extension to support the static part of Dynamic Host Configuration Protocol (DHCP) as specified in RFC1533. DHCP is used by Windows NT and 95.
One host on each network segment is normally configured to run either bootpd or bootpgw from inetd by including one of the following lines in the file /etc/inetd.conf:
bootps dgram udp wait root /usr/sbin/bootpd bootpd bootptab
bootps dgram udp wait root /usr/sbin/bootpgw bootpgw server
This mode of operation is referred to as “inetd mode” and causes bootpd (or 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 -t option controls this timeout (see OPTIONS below).
It is also possible to run bootpd (or bootpgw) in “standalone mode” (without inetd) by simply invoking it from a shell like any other regular command. Standalone mode is particularly useful when 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 standalone mode can be done by invoking bootpd from within /etc/rc.local, for example.) Standalone mode is less useful for bootgw which has very little start up delay because it does not read a configuration file.
Either program automatically detects whether it was invoked from inetd or from a shell and automatically selects the appropriate mode. The -s or -i option may be used to force standalone or inetd mode respectively.
bootpd [ -v ] [ -i -s -t timeout -d level -c chdir-path ] [ bootptab [ dumpfile ] }
Specifies the timeout value (in minutes) that a bootpd or bootpgw process will wait for a BOOTP packet before exiting. If no packets are received for timeout seconds, then the program will exit. A timeout value of zero means “run forever”. In standalone mode, this option is forced to zero.
Sets the 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 bootpd, omitting the numeric parameter (i.e. just -d) will simply increment the debug level by one.
Sets the current directory used by bootpd while checking the existence and size of client boot files. This is useful when client boot files are specified as relative pathnames, and bootpd needs to use the same current directory as the TFTP server (typically /tftpboot). This option is not recognized by bootpgw.
Force inetd mode. This option is obsolete, but remains for com‐patibility with older versions of bootpd.
Force standalone mode. This option is obsolete, but remains for compatibility with older versions of bootpd.
Print version and exit.
Specifies the name of the configuration file from which bootpd loads its database of known clients and client options (bootpd only). Default is /etc/bootptab.
Specifies the name of the file that bootpd will dump its inter‐nal database into when it receives a SIGUSR1 signal (bootpd only). This option is only recognized if bootpd was compiled with the -DDEBUG flag.
Specifies the name of a BOOTP server to which bootpgw will for‐ward all BOOTREQUEST packets it receives (bootpgw only).
Both bootpd and bootpgw operate similarly in that both listen for any packets sent to the bootps port, and both simply forward any BOOTREPLY packets. They differ in their handling of BOOTREQUEST packets.
When bootpd is started it reads a configuration file, (normally/etc/bootptab) that initializes the internal database of known clients and client options. This internal database is reloaded from the con figuration file when bootpd receives a hangup signal (SIGHUP) or when it discovers that the configuration file has changed. Note that any changes to the configuration file should be atomic to avoid race conditions.
When bootpd receives a BOOTREQUEST packet, it looks for a database entry matching the client request. If the client is known, bootpd com‐poses 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 > 0).
If bootpd is compiled with the -DDEBUG option, receipt of a SIGUSR1 signal causes it to dump its internal database to the file /tmp/bootpd.dump or the dumpfile specified as a command line parameter.
1. To start the bootpd daemon in a stand-alone mode, enter the following:
$ /usr/sbin/bootpd -s
2. To start the bootpd daemon in a stand-alone mode with a debug level of 3, with a configuration file of /etc/newconfig, and a dump file of /etc/newdumpfile, enter the following:
$ /usr/sbin/bootpd -s -d -d -d /etc/newconfig /etc/newdumpfile
Sanfoundry Global Education & Learning Series – 1000 Linux Tutorials.