System Administration Guide: IP Services

Chapter 13 Planning for DHCP Service (Tasks)

You can use the DHCP service in a network that you are creating or in a network that exists. If you are setting up a network, see Chapter 2, Planning Your TCP/IP Network (Tasks) before you attempt to set up the DHCP service. If the network already exists, continue in this chapter.

This chapter describes what you need to do before you set up the DHCP service on your network. The information is intended for use with DHCP Manager, although you can also use the command-line utility dhcpconfig to set up the DHCP service.

This chapter contains the following information:

Preparing Your Network for the DHCP Service (Task Map)

Before you set up your network to use DHCP, you must collect information to help you make decisions for configuring one or more servers. Use the task map in the following table to identify the tasks for preparing your network for DHCP. The table lists the tasks, descriptions of what each task accomplishes, and the sections that detail the steps to perform the individual tasks.



For Instructions 

Map your network topology. 

Determine and locate the services that are available on the network. 

Mapping Your Network Topology

Determine the number of DHCP servers you need. 

Use the expected number of DHCP clients as a basis for determining the number of DHCP servers you need. 

Determining the Number of DHCP Servers

Update system files and netmasks table.

Reflect the network topology accurately. 

Updating System Files and Netmask Tables

Mapping Your Network Topology

If you have not already done so, you should map the physical structure of your network. Indicate the location of routers and clients, and the location of servers that provide network services. This map of your network topology can help you determine which server to use for the DHCP service. The map can also help you determine the configuration information that the DHCP server can provide to clients.

See Chapter 2, Planning Your TCP/IP Network (Tasks) for more information about planning your network.

The DHCP configuration process can gather some network information from the server's system and network files. Updating System Files and Netmask Tables discusses these files. However, you might want to give clients other service information, which you must enter into the server's macros. As you examine your network topology, record the IP addresses of any servers you want your clients to know about. The following servers, for example, might provide services on your network. The DHCP configuration does not discover these servers.

Network Topology to Avoid

In some IP network environments, several local area networks (LANs) share the same network hardware media. The networks may use multiple network hardware interfaces or multiple logical interfaces. DHCP does not work well in this kind of shared media network. When multiple LANs run across the same physical network, a DHCP client's request arrives on all network hardware interfaces. This effect makes the client appear to be attached to all of the IP networks simultaneously.

DHCP must be able to determine the address of a client's network in order to assign an appropriate IP address to the client. If more than one network is present on the hardware media, the server cannot determine the client's network. The server cannot assign an IP address without knowing the network number.

You can use DHCP on only one of the networks. If one network does not suit your DHCP needs, you must reconfigure the networks. You should consider the following suggestions:

Determining the Number of DHCP Servers

The data store option that you choose has a direct effect on the number of servers you must have to support your DHCP clients. The following table shows the maximum number of DHCP and BOOTP clients that can be supported by one DHCP server for each data store.

Table 13–1 Estimated Maximum Number of Clients Supported by One DHCP Server

Data Store Type 

Maximum Number of Clients Supported 

Text files 




Binary files 


This maximum number is a general guideline, not an absolute number. A DHCP server's client capacity depends greatly on the number of transactions per second that the server must process. Lease times and usage patterns have a significant impact on the transaction rate. For example, suppose leases are set to 12 hours and users turn their systems off at night. If many users turn on their systems at the same time in the morning, the server must handle transaction peaks as many clients request leases simultaneously. The DHCP server can support fewer clients in such an environment. The DHCP server can support more clients in an environment with longer leases, or an environment that consists of constantly connected devices such as cable modems.

The section Choosing the DHCP Data Store compares the types of data stores.

Updating System Files and Netmask Tables

During DHCP configuration, the DHCP tools scan various system files on your server for information that can be used to configure the server.

You must be sure the information in the system files is current before you run DHCP Manager or dhcpconfig to configure your server. If you notice errors after you configure the server, use DHCP Manager or dhtadm to modify the macros on the server.

The following table lists some of the information gathered during DHCP server configuration, and the sources for the information. Be sure this information is set correctly on the server before you configure DHCP on the server. If you make changes to the system files after you configure the server, you should reconfigure the service to reflect these changes.

Table 13–2 Information Used for DHCP Configuration




Time zone 

System date, time zone settings 

The date and time zone are initially set during Oracle Solaris installation. You can change the date by using the date command. You can change the time zone by editing the /etc/default/init file to set the TZ environment variable. See the TIMEZONE(4) man page for more information.

DNS parameters 


The DHCP server uses the /etc/resolv.conf file to obtain DNS parameters such as the DNS domain name and DNS server addresses. See System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP) or the resolv.conf(4) man page for more information about resolv.conf.

NIS or NIS+ parameters 

System domain name, nsswitch.conf, NIS or NIS+

The DHCP server uses the domainname command to obtain the domain name of the server system. The nsswitch.conf file tells the server where to look for domain-based information. If the server system is an NIS or NIS+ client, the DHCP server performs a query to get NIS or NIS+ server IP addresses. See the nsswitch.conf(4) man page for more information.

Default router 

System routing tables, user prompt 

The DHCP server searches the network routing tables to find the default router for clients that are attached to the local network. For clients not on the same network, the DHCP server must prompt you for the information. 

Subnet mask 

Network interface, netmasks table

The DHCP server looks to its own network interfaces to determine the netmask and broadcast address for local clients. If the request was forwarded by a relay agent, the server obtains the subnet mask in the netmasks table on the relay agent's network.

Broadcast address 

Network interface, netmasks table

For the local network, the DHCP server obtains the broadcast address by querying the network interface. For remote networks, the server uses the BOOTP relay agent's IP address and the remote network's netmask to calculate the broadcast address for the network. 

Making Decisions for Your DHCP Server Configuration (Task Map)

This section discusses some of the decisions to make before you configure the first DHCP server on your network. The following table guides you in the decisions you need to configure your network to use DHCP, and links each task to the section that describes the steps to perform each task.



For Instructions 

Select a server for DHCP. 

Determine if a server meets the system requirements to run the DHCP service. 

Selecting a Host to Run the DHCP Service

Choose a data store. 

Compare the data store types to determine the best data store for your site. 

Choosing the DHCP Data Store

Set a lease policy. 

Learn about IP address leases to help you determine appropriate lease policy for your site. 

Setting a Lease Policy

Select a router address or router discovery. 

Determine whether DHCP clients use router discovery or a specific router. 

Determining Routers for DHCP Clients

Selecting a Host to Run the DHCP Service

With your network topology in mind, you can use the following system requirements to select a host on which to set up a DHCP server.

The host must meet the following requirements:

Choosing the DHCP Data Store

You can choose to store the DHCP data in text files, binary files, or the NIS+ directory service. The following table summarizes the features of each type of data store, and indicates the environment in which to use each data store type.

Table 13–3 Comparison of DHCP Data Stores

Data Store Type 





Binary files 

High performance, high capacity 

Low maintenance, no database servers required. Contents must be viewed with DHCP Manager or dhtadm and pntadm. Regular file backups suggested.

Data stores cannot be shared among DHCP servers. 

Midsize to large environments with many networks with thousands of clients per network. Useful for small to medium ISPs. 


Moderate performance and capacity, dependent upon NIS+ service's performance and capacity 

DHCP server system must be configured as an NIS+ client. Requires NIS+ service maintenance. Contents must be viewed with DHCP Manager or dhtadm and pntadm. Regular backup with nisbackup is suggested.

DHCP data is distributed in NIS+, and multiple servers can access the same containers. 

Small to midsize environments with up to 5000 clients per network. 

Text files 

Moderate performance, low capacity 

Low maintenance, no database servers required. ASCII format is readable without DHCP Manager, dhtadm, or pntadm. Regular file backups suggested.

Data store can be shared among DHCP servers if DHCP data is stored on one file system that is exported through an NFS mount point. 

Small environments with less than 10,000 clients, with a few hundred to a thousand clients per network. 

Traditional NIS is not offered as a data store option because NIS does not support fast incremental updates. If your network uses NIS, you should use text files or binary files for your data store.

Setting a Lease Policy

A lease specifies the amount of time the DHCP server permits a DHCP client to use a particular IP address. During the initial server configuration, you must specify a site-wide lease policy. The lease policy indicates the lease time and specifies whether clients can renew their leases. The server uses the information that you supply to set option values in the default macros that the server creates during configuration. You can set different lease policies for specific clients or type of clients, by setting options in configuration macros you create.

The lease time is specified as a number of hours, days, or weeks for which the lease is valid. When a client is assigned an IP address, or renegotiates a lease on an IP address, the lease expiration date and time is calculated. The number of hours in the lease time is added to the timestamp on the client's DHCP acknowledgement. For example, suppose the timestamp of the DHCP acknowledgment is September 16, 2005 9:15 A.M., and the lease time is 24 hours. The lease expiration time in this example is September 17, 2005 9:15 A.M. The lease expiration time is stored in the client's DHCP network record, viewable in DHCP Manager or with the pntadmutility.

The lease time value should be relatively small so that expired addresses are reclaimed quickly. The lease time value also should be large enough to outlast DHCP service disruptions. Clients should be able to function while the system that runs the DHCP service is repaired. A general guideline is to specify a time that is two times the predicted downtime of a system. For example, if you need four hours to obtain and replace a defective part and reboot the system, specify a lease time of eight hours.

The lease negotiation option determines whether a client can renegotiate its lease with the server before the lease expires. If lease negotiation is allowed, the client tracks the time that remains in its lease. When half of the lease time has passed, the client requests the DHCP server to extend its lease to the original lease time. You should disable lease negotiation in environments where there are more systems than IP addresses. The time limit is then enforced on the use of IP addresses. If there are enough IP addresses, you should enable lease negotiation to avoid forcing clients to take down their network interfaces when leases expire. If you make clients obtain new leases, the clients' TCP connections such as NFS and telnet sessions might be interrupted. You can enable lease negotiation for all clients during the server configuration. You can enable lease negotiation for particular clients or particular types of clients through the use of the LeaseNeg option in configuration macros.

Note –

Systems that provide services on the network should retain their IP addresses. Such systems should not be subject to short-term leases. You can use DHCP with such systems if you assign reserved manual IP addresses to those systems, rather than IP addresses with permanent leases. You can then detect when the system's IP address is no longer in use.

Determining Routers for DHCP Clients

Host systems use routers for any network communication beyond their local network. The hosts must know the IP addresses of these routers.

When you configure a DHCP server, you must provide DHCP clients with router addresses in one of two ways. One way is to provide specific IP addresses for routers. However, the preferred method is to specify that clients should find routers with the router discovery protocol.

If clients on your network can perform router discovery, you should use the router discovery protocol, even if there is only one router. Router discovery enables a client to adapt easily to router changes in the network. For example, suppose that a router fails and is replaced by a router with a new address. Clients can discover the new address automatically without having to obtain a new network configuration to get the new router address.

Making Decisions for IP Address Management (Task Map)

As part of the DHCP service setup, you determine several aspects of the IP addresses that the server is to manage. If your network needs more than one DHCP server, you can assign responsibility for some IP addresses to each server. You must decide how to divide responsibility for the addresses. The following table is a task map that describes tasks to manage IP addresses when you use DHCP on the network. The table also contains links to the appropriate sections that detail how to perform each task.



For Information 

Specify which addresses that the server should manage. 

Determine how many addresses you want the DHCP server to manage, and what those addresses are. 

Number and Ranges of IP Addresses

Decide if the server should automatically generate host names for clients. 

Learn how client host names are generated so that you can decide whether to generate host names. 

Client Host Name Generation

Determine what configuration macro to assign to clients. 

Learn about client configuration macros so that you can select an appropriate macro for clients. 

Default Client Configuration Macros

Determine lease types to use. 

Learn about lease types to help you determine what type is best for your DHCP clients. 

Dynamic and Permanent Lease Types

Number and Ranges of IP Addresses

During the initial server configuration, DHCP Manager allows you to add one block, or range, of IP addresses under DHCP management by specifying the total number of addresses and the first address in the block. DHCP Manager adds a list of contiguous addresses from this information. If you have several blocks of noncontiguous addresses, you can add the others by running DHCP Manager's Address Wizard again, after the initial configuration.

Before you configure your IP addresses, know how many addresses are in the initial block of addresses you want to add and the IP address of the first address in the range.

Client Host Name Generation

The dynamic nature of DHCP means that an IP address is not permanently associated with the host name of the system that is using it. The DHCP management tools can generate a client name to associate with each IP address if you select this option. The client names consist of a prefix, or root name, plus a dash and a number assigned by the server. For example, if the root name is charlie, the client names are charlie-1, charlie-2, charlie-3, and so on.

By default, generated client names begin with the name of the DHCP server that manages them. This strategy is useful in environments that have more than one DHCP server because you can quickly see in the DHCP network tables which clients any given DHCP server manages. However, you can change the root name to any name you choose.

Before you configure your IP addresses, decide if you want the DHCP management tools to generate client names, and if so, what root name to use for the names.

The generated client names can be mapped to IP addresses in /etc/inet/hosts, DNS, or NIS+ if you specify to register host names during DHCP configuration. See Client Host Name Registration for more information.

Default Client Configuration Macros

In Oracle Solaris DHCP, a macro is a collection of network configuration options and their assigned values. The DHCP server uses macros to determine what network configuration information to send to a DHCP client.

When you configure the DHCP server, the management tools gather information from system files and directly from you through prompts or command-line options you specify. With this information, the management tools create the following macros:

Clients receive the options contained in the network address macro before the options in the macro that is mapped to IP addresses. This processing order causes the options in the server macro to take precedence over any conflicting options in the network address macro. See Order of Macro Processing for more information about the order in which macros are processed.

Dynamic and Permanent Lease Types

The lease type determines whether the lease policy applies to the IP addresses you are configuring. During initial server configuration, DHCP Manager allows you to select either dynamic or permanent leases for the addresses you are adding. If you configure the DHCP server with the dhcpconfig command, leases are dynamic.

When an IP address has a dynamic lease, the DHCP server can manage the address. The DHCP server can allocate the IP address to a client, extend the lease time, detect when the address is no longer in use, and reclaim the address. When an IP address has a permanent lease, the DHCP server can only allocate the address. The client then owns the address until explicitly releasing the address. When the address is released, the server can assign the address to another client. The address is not subject to the lease policy as long as the address is configured with a permanent lease type.

When you configure a range of IP addresses, the lease type you select applies to all the addresses in the range. To get the most benefit from DHCP, you should use dynamic leases for most of the addresses. You can later modify individual addresses to make them permanent, if necessary. However, the total number of permanent leases should be kept to a minimum.

Reserved IP Addresses and Lease Type

IP addresses can be reserved by manually assigning them to particular clients. A reserved address can be associated with a permanent lease or a dynamic lease. When a reserved address is assigned a permanent lease, the following statements are true:

If a reserved address is assigned a dynamic lease, the address can be allocated only to the client that is bound to the address. However, the client must track lease time and negotiate for a lease extension as if the address were not reserved. This strategy enables you to track when the client is using the address by looking at the network table.

You cannot create reserved addresses for all the IP addresses during the initial configuration. Reserved addresses are intended to be used sparingly for individual addresses.

Planning for Multiple DHCP Servers

If you want to configure more than one DHCP server to manage your IP addresses, consider the following guidelines:

Planning DHCP Configuration of Your Remote Networks

After the initial DHCP configuration, you can place IP addresses in remote networks under DHCP management. However, because the system files are not local to the server, DHCP Manager and dhcpconfig cannot look up information to provide default values, so you must provide the information. Before you try to configure a remote network, be sure you know the following information:

See Adding DHCP Networks for the procedure for adding DHCP networks.

Selecting the Tool for Configuring DHCP

After you gather information and plan for DHCP service, you are ready to configure a DHCP server. You can use the DHCP Manager or the command-line utility dhcpconfig to configure a server. DHCP Manager lets you select options and specify data that is then used to create the dhcptab and network tables used by the DHCP server. The dhcpconfig utility requires you to use command-line options to specify data.

DHCP Manager Features

DHCP Manager, a Java™ technology-based GUI tool, provides a DHCP Configuration Wizard. The configuration wizard starts automatically the first time you run DHCP Manager on a system that is not configured as a DHCP server. The DHCP Configuration Wizard provides a series of dialog boxes that prompt you for the essential information required to configure a server: data store format, lease policy, DNS/NIS/NIS+ servers and domains, and router addresses. Some of the information is obtained by the wizard from system files, and you only need to confirm that the information is correct, or to correct information, if necessary.

When you progress through the dialog boxes and approve the information, the DHCP server daemon starts on the server system. You are then prompted to start the Add Addresses Wizard to configure IP addresses for the network. Only the server's network is configured for DHCP initially, and other server options are given default values. You can run DHCP Manager again after the initial configuration is complete to add networks and modify other server options.

See Configuring and Unconfiguring a DHCP Server Using DHCP Manager for more information about the DHCP Configuration Wizard. See About DHCP Manager for more detailed information about DHCP Manager.

dhcpconfig Features

The dhcpconfig utility supports options that enable you to configure and unconfigure a DHCP server, as well as convert to a new data store and import/export data to and from other DHCP servers. When you use the dhcpconfig utility to configure a DHCP server, the utility obtains information from the system files discussed in Updating System Files and Netmask Tables. You cannot view and confirm the information obtained from system files as you can with DHCP Manager. So, it is important that the system files be updated before you run dhcpconfig. You can also use command-line options to override the values dhcpconfig would obtain by default from system files. The dhcpconfig command can be used in scripts. See the dhcpconfig(1M) man page for more information.

Comparison of DHCP Manager and dhcpconfig

The following table summarizes the differences between the two server configuration tools.

Table 13–4 Comparison of DHCP Manager and the dhcpconfig Command


DHCP Manager 

dhcpconfig With Options

Network information that is gathered from system. 

Enables you to view the information gathered from system files, and to change it if needed. 

You can specify the network information with command-line options. 

Speed of configuration. 

Speeds the configuration process by omitting prompts for nonessential server options, using default values instead. You can change nonessential options after initial configuration. 

Fastest configuration process, but you might need to specify values for many options. 

Chapter 14, Configuring the DHCP Service (Tasks) includes procedures you can use to configure your server with either DHCP Manager or the dhcpconfig utility.