Configuring a Dynamic Host Configuration Protocol (DHCP) server

DHCP options

The DHCP server can configure a client with any of the options specified in RFC 2132. DHCP uses the same request and reply packet format as BOOTP so configuration options are carried in the portion of the BOOTP packet reserved for vendor extensions. DHCP terms this the ``options'' field and expands it from 64 bytes to 312 bytes.

Multiple sets of DHCP options can be specified in the DHCP configuration database. The following table shows the possible types of option sets and their precedence:

Option set type Precedence Description
Client Highest Generally used to specify a static IP address for an individual client. The DHCP server automatically assigns this address to the client rather than using one obtained from the address pool assigned to the subnet. You can also create a client entry without a static address, if you need to specify unique option values for the client but still want its IP address to be assigned dynamically. A DHCP client identifies itself to the server using its network hardware (MAC) address, or using an identifier if it is an opaque client. As many sets of client options can be created as are needed.
User class Offered to any client that specifies the user class identifier in the ``discover'' message. As many sets of user class options can be created as are needed.
Subnet Includes the name of the address pool from which the DHCP server draws IP addresses to allocate to clients, the default and maximum leases for these addresses, and lease renewal and rebind times, along with a set of DHCP options specific to the subnet. As many sets of subnet options can be created as are needed.
Global Lowest Applies to all DHCP clients. Only one set of global options can be created.

 -----------------------------------------------------------------------
| Option set type|  Precedence|  Description                           |
|----------------|------------|----------------------------------------|
| Client         |  Highest   |  Generally used to specify a static IP |
|                |            |  address for an individual client. The |
|                |            |  DHCP server automatically assigns this|
|                |            |  address to the client rather than     |
|                |            |  using one obtained from the address   |
|                |            |  pool assigned to the subnet.  You can |
|                |            |  also create a client entry without a  |
|                |            |  static address, if you need to specify|
|                |            |  unique option values for the client   |
|                |            |  but still want its IP address to be   |
|                |            |  assigned dynamically.  A DHCP client  |
|                |            |  identifies itself to the server using |
|                |            |  its network hardware (MAC) address, or|
|                |            |  using an identifier if it is an opaque|
|                |            |  client.  As many sets of client       |
|                |            |  options can be created as are needed. |
|----------------|------------|----------------------------------------|
| User class     |            |  Offered to any client that specifies  |
|                |            |  the user class identifier in the      |
|                |            |  ``discover'' message.  As many sets of|
|                |            |  user class options can be created as  |
|                |            |  are needed.                           |
|----------------|------------|----------------------------------------|
| Subnet         |            |  Includes the name of the address pool |
|                |            |  from which the DHCP server draws IP   |
|                |            |  addresses to allocate to clients, the |
|                |            |  default and maximum leases for these  |
|                |            |  addresses, and lease renewal and      |
|                |            |  rebind times, along with a set of DHCP|
|                |            |  options specific to the subnet.  As   |
|                |            |  many sets of subnet options can be    |
|                |            |  created as are needed.                |
|----------------|------------|----------------------------------------|
| Global         |  Lowest    |  Applies to all DHCP clients.  Only one|
|                |            |  set of global options can be created. |
|----------------|------------|----------------------------------------|

The set of global DHCP options, for example, applies to all clients, whereas a set of subnet options applies only to the clients on a specified subnet. If you configure the same option in more than one set of options, the precedence of the option type decides which the DHCP server offers to the client.

For example, if the ``LPR Servers'' option is specified in both the subnet set of options and the global set of options, the DHCP server configures the client with the LPR Servers information defined for the subnet.

An additional class of options is vendor class options. These are intended to provide information that is specific to a particular vendor's hardware. These options are offered to any client that specifies the vendor class identifier in the ``discover'' message. As many sets of vendor class options can be created as are needed for different types of client hardware. It is also possible to redefine a standard option (with codes in the range 1 through 254) for use by a vendor class. Such a redefined option is called a ``vendor-specific option'', and is only visible to the vendor class for which it is defined. Vendor class options are delivered ``encapsulated'' to the client and so are not affected by precedence rules that the server applies to other options.

Mapping sets of DHCP options to a network

``Mapping sets of DHCP options to a network'' shows an example of how the option sets defined on the DHCP server can be considered as creating a map of the configuration parameters needed by DHCP clients:

Option overload

Although the DHCP client can specify a larger response packet size, the practical limit for DHCP options is 274 bytes. (An additional 192 bytes can be provided if the option overload feature is enabled. Option overload is a server parameter.) Each option consists of a 2-byte header and the option data, such as an integer or an array of IP addresses. A single option cannot exceed 255 bytes of data.

If the server finds that the configured options exceed the allowable limit, it uses as many options as possible starting from the top of the configured options list and sends an error message to /var/adm/log/syslog. Clients can send a configured options list in the ``discover'' message. In the situation mentioned above, this ``Parameters Request List'' takes precedence over any other configured options.

Default option values

Some DHCP options have default values. If you configure an option that has a default value and do not configure a value for the option, the DHCP server sends the default value. The following table lists DHCP options that have default values.

Option name Default value
Broadcast address Network/subnet number with all 1's for the host
Router discovery 1 (enable)
IP forwarding 0 (disable)
Non-local source routing 0 (disallow)
TCP keepalive garbage 0 (disable)
Default IP time to live 64
Ethernet encapsulation 0 (RFC 894, Ethernet version 2)
Default TCP keepalive interval 0 (no keepalives)
Time offset Obtained from host
Boot file size Obtained from host

 -----------------------------------------------------------------------
| Option name                   |  Default value                       |
|-------------------------------|--------------------------------------|
| Broadcast address             |  Network/subnet number with all 1's  |
|                               |  for the host                        |
|-------------------------------|--------------------------------------|
| Router discovery              |  1 (enable)                          |
|-------------------------------|--------------------------------------|
| IP forwarding                 |  0 (disable)                         |
|-------------------------------|--------------------------------------|
| Non-local source routing      |  0 (disallow)                        |
|-------------------------------|--------------------------------------|
| TCP keepalive garbage         |  0 (disable)                         |
|-------------------------------|--------------------------------------|
| Default IP time to live       |  64                                  |
|-------------------------------|--------------------------------------|
| Ethernet encapsulation        |  0 (RFC 894, Ethernet version 2)     |
|-------------------------------|--------------------------------------|
| Default TCP keepalive interval|  0 (no keepalives)                   |
|-------------------------------|--------------------------------------|
| Time offset                   |  Obtained from host                  |
|-------------------------------|--------------------------------------|
| Boot file size                |  Obtained from host                  |
|-------------------------------|--------------------------------------|
See RFC 2132 for descriptions of these options.
© 1999 The Santa Cruz Operation, Inc. All rights reserved.
UnixWare 7 Release 7.1.1 - 5 November 1999