BOOTPD(8) System Manager's Manual BOOTPD(8)

bootpdDHCP/BOOTP

bootpd [options]

bootpd implements a DHCP/BOOTP server as defined in RFC951, RFC1542, RFC2131, and RFC2132, as well as a BOOTP/DHCP relay agent.

bootpd understands and handles requests that arrive via a DHCP/BOOTP relay agent, allowing the server to be centrally located, and serve many remote subnets.

The server is normally invoked by launchd(8) when a request arrives, but can also be invoked manually. If it is invoked by launchd(8), bootpd continues to service requests until it is idle for a period of 5 minutes, after which it exits to conserve system resources. If invoked manually, bootpd continues to run indefinitely.

If bootpd receives a SIGHUP (-1) signal, it will re-read its configuration and client binding files.

When a request from a client arrives, the server logs an entry to /var/log/system.log indicating which client made the request, and logs another entry once a reply is sent. This feature can be turned off using the -q option described below.

bootpd reads its configuration from bootpd.plist, a plist that by default is expected to exist as /etc/bootpd.plist. An alternate path can be specified using the -f option. There are also a number of command-line options to change its behavior on the fly. Note in particular that options DrS can also be controlled via service-control properties. See Service Controls and Filters below.

Disable BOOTP service. BOOTP is now disabled by default, so specifying this option has no effect.
Only respond if the client's bootfile exists: for BOOTP clients only.
Enable DHCP service. By default, DHCP service is disabled.
Remain in the foreground and produce extra debugging output to stderr.
filename
Specify an alternate bootpd.plist configuration file instead of the default /etc/bootpd.plist.
Disable re-initialization on IP address changes. By default, changes to the server's configured IP addresses cause it to re-initialize.
interface
Enable service on the specified interface. This flag may appear multiple times to enable multiple interfaces. For example,
    bootpd -i en0 -i en1
forces bootpd to respond only to requests received on ethernet ports en0 and en1. By default, all interfaces are enabled.
hop_count
For relay agent operation, the maximum hop count, default is 4 hops.
Be quiet as possible. Only report serious errors to
server_ip
Relay packets to the specified server_ip, not exceeding the hop count. This option can be specified multiple times, one for each server to relay to.
Enable BOOTP service.
Be more verbose in messages logged to /var/log/system.log.

bootpd reads its configuration from bootpd.plist, an XML property list. The root of the property list is a dictionary. The property list has two main areas:

Root dictionary
Service Controls and Filters
Subnets
Subnet Entries

The root dictionary in bootpd.plist contains properties to control whether bootpd will respond to a particular request, There are MAC address filters, DHCP controls, as well as controls to enable services.

The MAC address filter properties are:

(Array of String) Enables servicing a list of MAC addresses.
(Array of String) Disables servicing a list of MAC addresses.

When a packet arrives, bootpd checks whether the client's MAC address is in the deny list. If it is, the packet is dropped. Otherwise, if the client's MAC address is in the allow list, the packet continues to be processed, otherwise it is dropped. If neither the allow nor the deny property is specified, the packet continues to be processed.

Allow/deny filtering can be disabled using the ignore_allow_deny property:

(Array of String) Disable allow/deny processing on the specified list of interfaces. When a packet arrives on an interface in this list, processing continues without consulting the allow/deny filters.

The service-control properties are:

Enables BOOTP on the specified list of interfaces.
Enables DHCP on the specified list of interfaces.
Enables the relay agent on the specified list of interfaces. Note that this option also requires the relay_ip_list property to be specified.

For each of the properties dhcp_enabled, bootp_enabled, and relay_enabled, the corresponding service can be enabled or disabled for all interfaces, or enabled for just a specific set of interfaces. To enable or disable globally, use a boolean value true or false respectively. To enable just for a specific set of interfaces, use either a string, for a single interface, or an array of strings, one element for each interface.

For example, to enable DHCP on interfaces en0 and en1, disable BOOTP on all interfaces, and enable relay agent on interface en1, bootpd.plist could contain:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>bootp_enabled</key>
        <false/>
        <key>dhcp_enabled</key>
        <array>
                <string>en0</string>
                <string>en1</string>
        </array>
        <key>relay_enabled</key>
        <array>
                <string>en1</string>
        </array>
</dict>
</plist>

Some additional properties are:

(Array of String) If relay agent functionality is enabled (see relay_enabled above), this property contains the list of IP addresses to relay the packet to.
(Boolean, Array of String) Enables detecting another DHCP server either globally (Boolean), or only on the specified list of interfaces (Array of String). When another DHCP server is detected on an interface, DHCP service is disabled on that interface until the next time bootpd receives a SIGHUP, or exits.
(Integer) bootpd won't respond to the request until the bp_secs field is at least reply_theshold_seconds. The default value is 0 (zero).
(Boolean) If this property is set to true, bootpd will look for static IP address to ethernet address bindings in Open Directory. The default value is false.
(Boolean) If this property is set to true, the DHCP server tries to ignore the DHCP client identifier option (code 61) in the client's DHCP packet. Instead, the DHCP server tries to use the hardware address fields (bp_htype, bp_hlen, bp_chaddr) of the DHCP packet to identify the client. The default value of this property is false.
(Boolean) If this property is set to true, the DHCP server supplies the bootfile specified in the static binding for a client in /etc/bootptab.
(Boolean) If this property is set to true, the DHCP server tries to use its own configuration to supply the subnet mask, router, DNS server addresses, DNS domain, and DNS domain search options, if those options are missing from the subnet description. If the property is false, the server only uses the information in the subnet description to supply these DHCP options. The default value of this property is true.

The "Subnets" property in bootpd.plist contains an array of dictionaries, each dictionary corresponds to a single subnet entry.

A subnet entry describes a range of IP addresses, and associated information, such as the subnet mask, router, DNS servers, and other option data. A subnet entry also indicates whether the range is an address pool from which to allocate vs. simply an informational range in order to fulfill requests for option information. The informational range is used when the client's IP address binding is static, or the client knows its own IP address and simply wants relevant option information.

A subnet entry is required to supply the DHCP service with pool(s) of IP address(es), and to inform the server of subnet-specific options and parameters. A subnet entry can also be used to convey network topology information via the supernet property described below.

Subnet entries may not overlap in the IP ranges the describe, nor specify values that are inconsistent. Specifically, applying the net_mask value to each of the values in the net_range must yield the net_address value.

Errors in configuration are logged to /var/log/system.log. There may be multiple entries for a given subnet, allowing different configuration values to be specified for a given sub-range of IP addresses within the subnet. For example, part of the range might be used for statically bound clients, and another for a dynamic address pool.

Each subnet entry is encoded as a dictionary with the following properties:

(String) A descriptive name for the subnet, e.g. "17.202.40/22".
(String) The network mask, e.g. "255.255.252.0". This property is required.
(String) The network address, e.g. "17.202.40.0". This property is required.
(Array of String) The network address range stored as two values: the first IP address and the last IP address. For example:
	<array>
		<string>17.202.40.2</string>
		<string>17.202.43.254</string>
	</array>
This property is required.
(Boolean) Indicates whether the DHCP service should allocate IP addresses from the range specified by net_range. A true value means allocate IP addresses, otherwise, the subnet entry is informational only.
(Integer) The minimum allowable lease time (in seconds). This property is ignored unless allocate specifies true. Default value is 3600 (one hour).
(Integer) The maximum allowable lease time (in seconds). This property is ignored unless allocate specifies true. Default value is 3600 (one hour).
(String) This property indicates that the subnet is on the same physical broadcast domain as other subnets with the same supernet value.

The server can also supply clients with the following DHCP option information:

The IP address of the default router (DHCP option code 3). If this property is not present, the server will attempt to provide its own default route for this option, if it is applicable.
The IP address(es) of the DNS server(s) (option code 6). If this property is not present, the server will supply its own DNS server configuration (if available).
The default DNS domain name (option code 15). If this property is not present, the server will supply its own default domain name (if available).
The domain search list (option code 119). If this property is not present, the server will supply its domain search list (if available).
The classless static route (option code 121). The list of static routes is specified using an array of strings. The array is interpreted as an array of string pairs, the first element of the pair describes the destination network using the notation "<destination_ip>/<prefix_length>", and the second element gives the gateway as "<gateway_ip". If "<gateway_ip>" is "0.0.0.0", the destination is the interface itself.

For example:

	<key>dhcp_classless_static_route</key>
	<array>
		<string>192.168.100.0/22</string>
		<string>0.0.0.0</string>
		<string>44.100.100.100/22</string>
		<string>192.168.100.1</string>
		<string>129.210.177.132/25</string>
		<string>1.1.1.1</string>
	</array>

The first route has destination 192.168.100.0/22 and gateway 0.0.0.0 which means 192.168.100.0/22 is directly reachable on the link. The second route has destination 44.100.100.100/22 and gateway 192.168.100.1. The third route has destination 129.210.177.132/25 and gateway 1.1.1.1.

The default LDAP URL (option code 95).
The NetInfo parent server IP address(es) (option code 112).
The NetInfo parent domain tag (option code 113).
The default URL to present in a web browser (option code 114).
The time offset from GMT in seconds (option code 2).
The network time protocol (NTP) server IP address(es) (option code 42).
The NetBIOS over TCP/IP name server IP address(es) (option code 44).
The NetBIOS over TCP/IP datagram distribution server IP address(es) (option code 45).
The NetBIOS over TCP/IP node type (option code 46).
The NetBIOS over TCP/IP scope string (option code 47).
The Simple Mail Transport Protocol (SMTP) server IP address(es) (option code 69).
The Post Office Protocol (POP3) server IP address(es) (option code 70).
The Network News Transport Protocol (NNTP) server IP address(es) (option code 71).
The default Web Proxy Auto Discovery URL (option code 252).

DHCP options may also be specified using the naming convention:

	dhcp_option_option_code
replacing option_code with a numeric value in the range of 1 through 254. For example, to specify option code 128, specify a property named dhcp_option_128.

bootpd has a built-in type conversion table for many more options, mostly those specified in RFC 2132, and will try to convert from whatever type the option appears in the property list to the binary, packet format. For example, if bootpd knows that the type of the option is an IP address or list of IP addresses, it converts from the string form of the IP address to the binary, network byte order numeric value.

If the type of the option is a numeric value, it converts from string, integer, or boolean, to the proper sized, network byte-order numeric value.

Regardless of whether bootpd knows the type of the option or not, you can always specify the DHCP option using the data property list type e.g.:

	<key>dhcp_option_128</key>
	<data>
	AAqV1Tzo
	</data>

Static IP address to ethernet address bindings are stored in the /etc/bootptab file and in Open Directory. Bindings specified in the /etc/bootptab file take precedence over those in Open Directory.

See bootptab(5) for more information about the /etc/bootptab file.

For Open Directory, bootpd looks at the /Computers records for the following properties:

(String) The ethernet MAC address(es) of the computer. Each address must be of the form xx:xx:xx:xx:xx:xx using only the characters 0123456789abcdef. Leading zeros must be specified.
(String) The IP address(es) of the computer.
(String) Pairs of IP and Ethernet MAC addresses of the computer. Each address pair consists of an single IP and MAC address separated by a slash character, e.g. "192.168.1.1/01:23:45:67:89:ab". This attribute should be provided when multiple addresses are provided because not all directories return attribute values in a guaranteed order.
(String) The bootfile to use for this computer.

If DHCP service is enabled for a client, the server processes the client's packet. The packet may be a request for an IP address and option information (DHCP Discover, DHCP Request) or for just option information (DHCP Inform). The packet might also tell the server that the address is in use by some other host (DHCP Decline), or that the client is done with the IP address (DHCP Release).

The server uses the DHCP client identifier (option 61) if it is present as the unique client identifier, otherwise it uses the htype/hlen/chaddr fields in the DHCP packet.

The DHCP server first tries to find a static binding for the client (see section BOOTP/DHCP STATIC BINDINGS above). If one exists, it uses it. If not, it tries to find an existing dynamic binding from its lease database, stored in /var/db/dhcpd_leases. If one exists and it is applicable to the subnet, the server uses it, otherwise, it tries to allocate an address from one of its address pools. If an address is available, the server uses it, otherwise the packet is discarded.

After a suitable IP address is found for the client, the server attempts to insert as many of the requested DHCP options from the client's request as it can into the reply.

When the server allocates an address dynamically, it automatically excludes addresses that appear in static host entries. For example, if the address range goes from 10.0.0.2 through 10.0.0.10, but there is a static entry that specifies 10.0.0.3, that address is automatically excluded from the pool.

The server tries to give the same address back to a client by remembering the binding even after it has expired. The server removes an expired lease entry only when it runs out of addresses, and needs to reclaim an address in order to fulfill a new request.

When the server receives a DHCP Release packet, it sets the expiration for that lease to now, so that it can immediately reclaim the address if needed.

When the server receives a DHCP Decline packet, it removes the client binding from the IP address, and sets the expiration on the "unbound" lease to 10 minutes from now. That allows the address to return to the address pool again without manual intervention and avoids handing out the same in-use IP address over and over. BOOTP/DHCP STATIC BINDINGS above), or the server must have an applicable dynamic pool of IP addresses, just as with DHCP.

bootptab(5), launchd(8), tftpd(8), exports(5)

February 2, 2023 Mac OS X