System Administration Guide: IP Services

Part III DHCP

This part contains conceptual information about the Dynamic Host Configuration Protocol (DHCP), and tasks for planning, configuring, administering, and troubleshooting the Oracle Solaris DHCP service.

Chapter 12 About Oracle Solaris DHCP (Overview)

This chapter introduces the Dynamic Host Configuration Protocol (DHCP), and explains the concepts that underlie the protocol. This chapter also describes the advantages of using DHCP in your network.

This chapter contains the following information:

About the DHCP Protocol

The DHCP protocol enables host systems in a TCP/IP network to be configured automatically for the network as the systems boot. DHCP uses a client-server mechanism. Servers store and manage configuration information for clients and provide that information upon a client's request. The information includes the client's IP address and information about network services that are available to the client.

DHCP evolved from an earlier protocol, BOOTP, which was designed for booting over a TCP/IP network. DHCP uses the same format as BOOTP for messages between the client and server. However, unlike BOOTP messages, DHCP messages can include network configuration data for the client.

A primary benefit of DHCP is its ability to manage IP address assignments through leases. Leases allow IP addresses to be reclaimed when they are not in use. The reclaimed IP addresses can be reassigned to other clients. A site that uses DHCP can use a smaller pool of IP addresses than would be needed if all clients were assigned a permanent IP address.

Advantages of Using Oracle Solaris DHCP

DHCP relieves you of some of the time-consuming tasks involved in setting up a TCP/IP network and in the daily management of that network. Note that Oracle Solaris DHCP works only with IPv4.

Oracle Solaris DHCP offers the following advantages:

How DHCP Works

You must first install and configure the DHCP server. During configuration, you specify information about the network that clients need to operate on the network. After this information is in place, clients are able to request and receive network information.

The sequence of events for DHCP service is shown in the following diagram. The numbers in circles correlate to the numbered items in the description following the diagram.

Figure 12–1 Sequence of Events for DHCP Service

Diagram shows communication sequence between a DHCP client
and server. The description that follows the diagram explains the sequence.

The preceding diagram shows the following steps:

  1. The client discovers a DHCP server by broadcasting a discover message to the limited broadcast address (255.255.255.255) on the local subnet. If a router is present and configured to behave as a BOOTP relay agent, the request is passed to other DHCP servers on different subnets. The client's broadcast includes its unique ID, which, in the Oracle Solaris DHCP implementation, is derived from the client's Media Access Control (MAC) address. On an Ethernet network, the MAC address is the same as the Ethernet address.

    DHCP servers that receive the discover message can determine the client's network by looking at the following information:

    • Which network interface did the request come in on? The server determines either that the client is on the network to which the interface is connected, or that the client is using a BOOTP relay agent connected to that network.

    • Does the request include the IP address of a BOOTP relay agent? When a request passes through a relay agent, the relay agent inserts its address in the request header. When the server detects a relay agent address, the server knows that the network portion of the address indicates the client's network address because the relay agent must be connected to the client's network.

    • Is the client's network subnetted? The server consults the netmasks table to find the subnet mask used on the network indicated by the relay agent's address or by the address of the network interface that received the request. Once the server knows the subnet mask used, it can determine which portion of the network address is the host portion, and then it can select an IP address appropriate for the client. See the netmasks(4) man page for information on netmasks.

  2. After the DHCP servers determine the client's network, the servers select an appropriate IP address and verify that the address is not already in use. The DHCP servers then respond to the client by broadcasting an offer message. The offer message includes the selected IP address and information about services that can be configured for the client. Each server temporarily reserves the offered IP address until the client determines whether to use the IP address.

  3. The client selects the best offer, based on the number and type of services offered. The client broadcasts a request that specifies the IP address of the server that made the best offer. The broadcast ensures that all the responding DHCP servers know that the client has chosen a server. The servers that are not chosen can cancel the reservations for the IP addresses that they had offered.

  4. The selected server allocates the IP address for the client and stores the information in the DHCP data store. The server also sends an acknowledgement message (ACK) to the client. The acknowledgement message contains the network configuration parameters for the client. The client uses the ping utility to test the IP address to make sure no other system is using it. The client then continues booting to join the network.

  5. The client monitors the lease time. When a set period of time has elapsed, the client sends a new message to the chosen server to increase the lease time.

  6. The DHCP server that receives the request extends the lease time if the lease still adheres to the local lease policy set by the administrator. If the server does not respond within 20 seconds, the client broadcasts a request so that one of the other DHCP servers can extend the lease.

  7. When the client no longer needs the IP address, the client notifies the server that the IP address is released. This notification can happen during an orderly shutdown and can also be done manually.

Oracle Solaris DHCP Server

The Oracle Solaris DHCP server runs as a daemon in Oracle Solaris on a host system. The server has two basic functions:

The Oracle Solaris DHCP server can also be configured to perform the following additional functions:

DHCP Server Management

As superuser, you can start, stop, and configure the DHCP server with DHCP Manager or with command-line utilities described in DHCP Command-Line Utilities. Generally, the DHCP server is configured to start automatically when the system boots, and to stop when the system is shut down. You should not need to start and stop the server manually under normal conditions.

DHCP Data Store

All the data used by the Oracle Solaris DHCP server is maintained in a data store. The data store might consist of plain text files, NIS+ tables, or binary-format files. While configuring the DHCP service, you choose the type of data store to be used. The section Choosing the DHCP Data Store describes the differences between the types of data stores. You can convert a data store from one format to another by using DHCP Manager or the dhcpconfig command.

You can also move data from one DHCP server's data store to another server's data store. You can use export and import utilities that work with the data stores, even if the servers are using different data store formats. You can export and import the entire content of a data store, or just some of the data within it, using DHCP Manager or the dhcpconfig command.


Note –

Any database or file format can be used for DHCP data storage if you develop your own code module to provide an interface between Oracle Solaris DHCP (server and management tools) and the database. For more information, see the Solaris DHCP Service Developer’s Guide.


Within the Oracle Solaris DHCP data store are two types of tables. You can view and manage the contents if these tables by using either DHCP Manager or the command-line utilities. The data tables are as follows:

The dhcptab Table

The dhcptab table contains all the information that clients can obtain from the DHCP server. The DHCP server scans the dhcptab table each time it starts. The file name of the dhcptab table varies according to the data store used. For example, the dhcptab table created by the NIS+ data store SUNWnisplus is SUNWnisplus1_dhcptab.

The DHCP protocol defines a number of standard items of information that can be passed to clients. These items are referred to as parameters, symbols, or options. Options are defined in the DHCP protocol by numeric codes and text labels, but without values. Some commonly used standard options are shown in the following table.

Table 12–1 Sample DHCP Standard Options

Code 

Label 

Description 

Subnet

Subnet mask IP address 

Router

IP address for the router 

DNSserv

IP address for the DNS server 

12 

Hostname

Text string for the client host name 

15 

DNSdmain

DNS domain name 

Some options are automatically assigned values when you provide information during server configuration. You can also explicitly assign values to other options at a later time. Options and their values are passed to the client to provide configuration information. For example, the option/value pair, DNSdmain=Georgia.Peach.COM, sets the client's DNS domain name to Georgia.Peach.COM.

Options can be grouped with other options in containers known as macros, which makes it easier to pass information to a client. Some macros are created automatically during server configuration and contain options that were assigned values during configuration. Macros can also contain other macros.

The format of the dhcptab table is described in the dhcptab(4) man page. In DHCP Manager, all the information shown in the Options and Macros tabs comes from the dhcptab table. See About DHCP Options for more information about options. See About DHCP Macros for more information about macros.

Note that the dhcptab table should not be edited manually. You should use either the dhtadm command or DHCP Manager to create, delete, or modify options and macros.

DHCP Network Tables

A DHCP network table maps client identifiers to IP addresses and the configuration parameters associated with each address. The format of the network tables is described in the dhcp_network(4) man page. In DHCP Manager, all the information shown in the Addresses tab comes from the network tables.

DHCP Manager

DHCP Manager is a graphical user interface (GUI) tool you can use to perform all management duties associated with the DHCP service. You can use it to manage the server as well as the data the server uses. You must be superuser when you run DHCP Manager.

You can use DHCP Manager with the server in the following ways:

DHCP Manager enables you to manage the IP addresses, network configuration macros, and network configuration options in the following ways:

DHCP Manager allows you to manage the DHCP data stores in the following ways:

DHCP Manager includes extensive online help for procedures you can perform with the tool. For more information, see About DHCP Manager.

DHCP Command-Line Utilities

All DHCP management functions can be performed by using command-line utilities. You can run the utilities if you are logged in as superuser or as a user assigned to the DHCP Management profile. See Setting Up User Access to DHCP Commands.

The following table lists the utilities and describes the purpose of each utility.

Table 12–2 DHCP Command-Line Utilities

Command 

Description and Purpose 

Man Page Links 

in.dhcpd

The DHCP service daemon. Command-line arguments enable you to set several runtime options.

in.dhcpd(1M)

dhcpconfig

Used to configure and unconfigure a DHCP server. This utility enables you to perform many of the functions of DHCP Manager from the command line. This utility is primarily intended for use in scripts for sites that want to automate some configuration functions. dhcpconfig collects information from the server system's network topology files to create useful information for the initial configuration.

dhcpconfig(1M)

dhtadm

Used to add, delete, and modify configuration options and macros for DHCP clients. This utility lets you edit the dhcptab table indirectly, which ensures the correct format of the dhcptab table. You should not directly edit the dhcptab table.

dhtadm(1M)

pntadm

Used to manage the DHCP network tables. You can use this utility to perform the following tasks:

  • Add and remove IP addresses and networks under DHCP management.

  • Modify the network configuration for specified IP addresses.

  • Display information about IP addresses and networks under DHCP management.

pntadm(1M)

Role-Based Access Control for DHCP Commands

Security for the dhcpconfig, dhtadm, and pntadm commands is determined by role-based access control (RBAC) settings. By default, the commands can be run only by superuser. If you want to use the commands under another user name, you must assign the user name to the DHCP Management profile as described in Setting Up User Access to DHCP Commands.

DHCP Server Configuration

You configure the Oracle Solaris DHCP server the first time you run DHCP Manager on the system where you want to run the DHCP server.

DHCP Manager server configuration dialog boxes prompt you for essential information needed to enable and run the DHCP server on one network. Some default values are obtained from existing system files. If you have not configured the system for the network, there are no default values. DHCP Manager prompts for the following information:

You can also configure the DHCP server using the dhcpconfig command. This utility automatically gathers information from existing system files to provide a useful initial configuration. Therefore, you must ensure that the files are correct before running dhcpconfig. See the dhcpconfig(1M) man page for information about the files that dhcpconfig uses to obtain information.

IP Address Allocation

The Oracle Solaris DHCP server supports the following types of IP address allocation:

Network Configuration Information

You determine what information to provide to DHCP clients. When you configure the DHCP server, you provide essential information about the network. Later, you can add more information that you want to provide to clients.

The DHCP server stores network configuration information in the dhcptab table, in the form of option/value pairs and macros. Options are keywords for network data that you want to supply to clients. Values are assigned to options and passed to clients in DHCP messages. For example, the NIS server address is passed by way of an option called NISservs. The NISservs option has a value that is equal to a list of IP addresses, which is assigned by the DHCP server. Macros provide a convenient way to group together any number of options that you want to supply to clients. You can use DHCP Manager to create macros to group options and to assign values to the options. If you prefer a command-line tool, you can use dhtadm, the DHCP configuration table management utility, to work with options and macros.

About DHCP Options

In Oracle Solaris DHCP, an option is a piece of network information to be passed to a client. The DHCP literature also refers to options as symbols or tags. An option is defined by a numeric code and a text label. An option receives a value when it is used in the DHCP service.

The DHCP protocol defines a large number of standard options for commonly specified network data: Subnet, Router, Broadcst, NIS+dom, Hostname, and LeaseTim are a few examples. A complete list of standard options is shown in the dhcp_inittab(4) man page. You cannot modify the standard option keywords in any way. However, you can assign values to the options that are relevant to your network when you include the options in macros.

You can create new options for data that is not represented by the standard options. Options you create must be classified in one of three categories:

Chapter 15, Administering DHCP (Tasks) includes procedures for creating, modifying, and deleting DHCP options.

About DHCP Macros

In the Oracle Solaris DHCP service, a macro is a collection of network configuration options and the values that you assign to them. Macros are created to group options together to be passed to specific clients or types of clients. For example, a macro intended for all clients of a particular subnet might contain option/value pairs for subnet mask, router IP address, broadcast address, NIS+ domain, and lease time.

Macro Processing by the DHCP Server

When the DHCP server processes a macro, it places the network options and values defined in the macro in a DHCP message to a client. The server processes some macros automatically for clients of a particular type.

For the server to process a macro automatically, the name of the macro must comply with one of the categories shown in the following table.

Table 12–3 DHCP Macro Categories for Automatic Processing

Macro Category 

Description 

Client class 

The macro name matches a class of client, indicated by the client machine type, operating system, or both. For example, if a server has a macro named SUNW.Sun-Blade-100, any client whose hardware implementation is SUNW,Sun-Blade-100 automatically receives the values in the SUNW.Sun-Blade-100 macro.

Network address 

The macro name matches a DHCP-managed network IP address. For example, if a server has a macro named 10.53.224.0, any client connected to the 10.53.224.0 network automatically receives the values in the 10.53.224.0 macro.

Client ID 

The macro name matches some unique identifier for the client, usually derived from an Ethernet or MAC address. For example, if a server has a macro named 08002011DF32, the client with the client ID 08002011DF32 (derived from the Ethernet address 8:0:20:11:DF:32) automatically receives the values in the macro named 08002011DF32.

A macro with a name that does not use one of the categories listed in Table 12–3 can be processed only if one of the following is true:


Note –

When you configure a server, a macro that is named to match the server's name is created by default. This server macro is not processed automatically for any client because it is not named with one of the name types that cause automatic processing. When you later create IP addresses on the server, the IP addresses are mapped to use the server macro by default.


Order of Macro Processing

    When a DHCP client requests DHCP services, the DHCP server determines which macros match the client. The server processes the macros, using the macro categories to determine the order of processing. The most general category is processed first, and the most specific category is processed last. The macros are processed in the following order:

  1. Client class macros – The most general category

  2. Network address macros – More specific than Client class

  3. Macros mapped to IP addresses – More specific than Network address

  4. Client ID macros – The most specific category, pertaining to one client

A macro that is included in another macro is processed as part of the container macro.

If the same option is included in more than one macro, the value for that option in the macro with the most specific category is used because it is processed last. For example, if a Network address macro contains the lease time option with a value of 24 hours, and a Client ID macro contains the lease time option with a value of 8 hours, the client receives a lease time of 8 hours.

Size Limit for DHCP Macros

The sum total of the values assigned to all the options in a macro must not exceed 255 bytes, including the option codes and length information. This limit is dictated by the DHCP protocol.

The macros that are most likely to be impacted by this limit are macros that are used to pass paths to files on Oracle Solaris installation servers. Generally, you should pass the minimum amount of vendor information needed. You should use short path names in options that require path names. If you create symbolic links to long paths, you can pass the shorter link names.

Oracle Solaris DHCP Client

The term “client” is sometimes used to refer to a physical machine that is performing a client role on the network. However, the DHCP client described in this document is a software entity. The Oracle Solaris DHCP client is a daemon (dhcpagent) that runs in Oracle Solaris on a system that is configured to receive its network configuration from a DHCP server. DHCP clients from other vendors can also use the services of the Oracle Solaris DHCP server. However, this document describes only the Oracle Solaris DHCP client.

See Chapter 16, Configuring and Administering the DHCP Client for detailed information about the Oracle Solaris DHCP client.

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.

Task 

Description 

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 

10,000 

NIS+ 

40,000 

Binary files 

100,000 

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

Information 

Source 

Comments 

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 

/etc/resolv.conf

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.

Task 

Description 

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 

Performance 

Maintenance 

Sharing 

Environment 

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. 

NIS+  

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.

Task 

Description 

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

Feature 

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.

Chapter 14 Configuring the DHCP Service (Tasks)

When you configure the DHCP service on your network, you configure and start the first DHCP server. Other DHCP servers can be added later and can access the same data from a shared location if the data store supports shared data. This chapter describes tasks that enable you to configure the DHCP server and place networks and their associated IP addresses under DHCP management. This chapter also explains how to unconfigure a DHCP server.

Each task includes a procedure to help you perform the task in DHCP Manager and a procedure for the equivalent task with the dhcpconfig utility. This chapter contains the following information:

If you experience problems configuring the DHCP service, see Chapter 17, Troubleshooting DHCP (Reference).

After you configure the DHCP service, see Chapter 15, Administering DHCP (Tasks) for information about managing the DHCP service.

Configuring and Unconfiguring a DHCP Server Using DHCP Manager

This section includes procedures to help you configure and unconfigure a DHCP server with DHCP Manager. Note that you must be running an X Window system such as CDE or GNOME to use DHCP Manager.

DHCP Manager can be run as superuser with the /usr/sadm/admin/bin/dhcpmgr command. See About DHCP Manager for general information about the utility. See How to Start and Stop the DHCP Service (DHCP Manager) for more detailed information about running DHCP Manager.

When you run DHCP Manager on a server that is not configured for DHCP, the following screen is displayed. You can specify whether you want to configure a DHCP server or a BOOTP relay agent.

Figure 14–1 Choose Server Configuration Dialog Box in DHCP Manager

Dialog box shows options Configure as DHCP server and
Configure as BOOTP relay. Shows OK, Cancel, and Help buttons.

Configuring DHCP Servers

When you configure a DHCP server, DHCP Manager starts the DHCP Configuration Wizard, which prompts you for information that is needed to configure the server. The initial screen of the wizard is shown in the following figure.

Figure 14–2 DHCP Configuration Wizard's Initial Screen

Dialog box shows storage choices, back and forward arrows,
and Cancel and Help buttons.

When you finish answering the wizard prompts, DHCP Manager creates the items that are listed in the following table.

Table 14–1 Items Created During DHCP Server Configuration

Item 

Description 

Contents 

Service configuration file, /etc/inet/dhcpsvc.conf

Records keywords and values for server configuration options. 

Data store type and location, and options that are used with in.dhcpd to start the DHCP daemon when the system boots. Do not edit this file manually. You must use dhcpmgr or dhcpconfig to modify DHCP configuration information.

dhcptab table

DHCP Manager creates a dhcptab table if the table does not already exist.

Macros and options with assigned values. 

Locale macro (optional), which is named Locale

Contains the local time zone's offset in seconds from Universal time (UTC). 

UTCoffst option with assigned number of seconds.

Server macro, which is named to match the server's node name

Contains options whose values are determined by input from the administrator who configured the DHCP server. Options apply to all clients that use addresses owned by the server. 

The Locale macro, plus the following options:

  • Timeserv, set to point to the server's primary IP address.

  • LeaseTim, set to the number of seconds for the leases.

  • LeaseNeg, if you selected negotiable leases.

  • DNSdmain and DNSserv, if DNS is configured.

  • Hostname, which must not be assigned a value. The presence of this option indicates that the host name must be obtained from the name service.

Network address macro, whose name is the same as the network address of client's network

Contains options whose values are determined by input from the administrator who configured the DHCP server. Options apply to all clients that reside on the network specified by the macro name. 

The following options:  

  • Subnet, set to the subnet mask for the local subnet

  • Router, set to the IP address of a router, or RDiscvyF, to cause the client to use router discovery

  • Broadcst, set to the broadcast IP address. This option is present only if the network is not a Point-to-Point network.

  • MTU, for the maximum transmission unit

  • NISdmain and NISservs, if NIS is configured

  • NIS+dom and NIS+serv, if NIS+ is configured

Network table for the network

An empty table is created until you create IP addresses for the network. 

No content until you add IP addresses. 

ProcedureHow to Configure a DHCP Server (DHCP Manager)

Before You Begin

Make sure that you have read Chapter 13, Planning for DHCP Service (Tasks) before you configure your DHCP server. In particular, you should use the guidelines in Making Decisions for Your DHCP Server Configuration (Task Map) to help you perform the following tasks:

  1. Become superuser on the server system.

  2. Start DHCP Manager.


    #/usr/sadm/admin/bin/dhcpmgr &
    
  3. Choose the option Configure as DHCP Server.

    The DHCP Configuration Wizard starts, to help you configure your server.

  4. Select options, or type requested information, based on the decisions you made in the planning phase.

    If you have difficulty, click Help in the wizard window to open your web browser and display help for the DHCP Configuration Wizard.

  5. Click Finish to complete the server configuration when you have finished specifying the requested information.

  6. At the Start Address Wizard prompt, click Yes to configure IP addresses for the server.

    The Add Addresses to Network wizard enables you to specify which addresses to place under the control of DHCP.

  7. Answer the prompts according to decisions you made in the planning phase.

    See Making Decisions for IP Address Management (Task Map) for more information. If you have difficulty, click Help in the wizard window to open your web browser and display help for the Add Addresses to Network wizard.

  8. Review your selections, and then click Finish to add the IP addresses to the network table.

    The network table is updated with records for each address in the range you specified.

See Also

You can add more networks to the DHCP server with the Network Wizard, as explained in Adding DHCP Networks.

Configuring BOOTP Relay Agents

When you configure a BOOTP relay agent, DHCP Manager takes the following actions:

The following figure shows the screen displayed when you choose to configure a BOOTP relay agent.

Figure 14–3 Configure BOOTP Relay Dialog Box in DHCP Manager

Dialog box shows input field labeled DHCP Servers, with
an Add button. Shows an empty list, with up and down arrows and Delete button.

ProcedureHow to Configure a BOOTP Relay Agent (DHCP Manager)

Before You Begin

Make sure that you have read Chapter 13, Planning for DHCP Service (Tasks) before you configure your BOOTP relay agent. In particular, you should see Selecting a Host to Run the DHCP Service for help in selecting the system to use.

  1. Become superuser on the server system.

  2. Start the DHCP Manager.


    #/usr/sadm/admin/bin/dhcpmgr &
    

    If the system has not been configured as a DHCP server or BOOTP relay agent, the DHCP Configuration Wizard starts. If the system has already been configured as a DHCP server, you must first unconfigure the server. See Unconfiguring DHCP Servers and BOOTP Relay Agents.

  3. Select Configure as BOOTP Relay.

    The Configure BOOTP Relay dialog box opens.

  4. Type the IP address or host name of one or more DHCP servers, and click Add.

    The specified DHCP servers must be configured to handle BOOTP or DHCP requests received by this BOOTP relay agent.

  5. Click OK to exit the dialog box.

    Notice that DHCP Manager offers only the File menu to exit the application and the Service menu to manage the server. The disabled menu options are useful only on a DHCP server.

Unconfiguring DHCP Servers and BOOTP Relay Agents

When you unconfigure a DHCP server or a BOOTP relay agent, DHCP Manager takes the following actions:

The following figure shows the screen that is displayed when you choose to unconfigure a DHCP server.

Figure 14–4 Unconfigure Service Dialog Box in DHCP Manager

Dialog box shows choices for removing DHCP data. Shows
OK, Cancel, and Help buttons.

DHCP Data on an Unconfigured Server

When you unconfigure a DHCP server, you must decide what to do with the dhcptab table and the DHCP network tables. If the data is shared among servers, you should not remove the dhcptab and DHCP network tables. If the tables are removed, DHCP would become unusable across your network. Data can be shared through NIS+ or on exported local file systems. The file /etc/inet/dhcpsvc.conf records the data store used and its location.

You can unconfigure a DHCP server but leave the data intact by not selecting any of the options to remove data. If you unconfigure the server and leave the data intact, you disable the DHCP server.

If you want another DHCP server to take ownership of the IP addresses, you must move the DHCP data to the other DHCP server. You must move the data before you unconfigure the current server. See Moving Configuration Data Between DHCP Servers (Task Map) for more information.

If you are certain you want to remove the data, you can select an option to remove the dhcptab and network tables. If you had generated client names for the DHCP addresses, you can also elect to remove those entries from the hosts table. Client name entries can be removed from DNS, /etc/inet/hosts, or NIS+.

Before you unconfigure a BOOTP relay agent, be sure that no clients rely on this agent to forward requests to a DHCP server.

ProcedureHow to Unconfigure a DHCP Server or a BOOTP Relay Agent (DHCP Manager)

  1. Become superuser.

  2. Start DHCP Manager.


    #/usr/sadm/admin/bin/dhcpmgr &
    
  3. From the Service menu, choose Unconfigure.

    The Unconfigure Service dialog box is displayed. If the server is a BOOTP relay agent, the dialog box enables you to confirm your intention to unconfigure the relay agent. If the server is a DHCP server, you must decide what to do with the DHCP data and make selections in the dialog box. See Figure 14–4.

  4. (Optional) Select options to remove data.

    If the server uses shared data through NIS+ or in files shared through NFS, do not select any options to remove the data. If the server does not use shared data, select one option or both options to remove the data.

    See DHCP Data on an Unconfigured Server for more information about removing data.

  5. Click OK to unconfigure the server.

    The Unconfigure Service dialog box and DHCP Manager are closed.

Configuring and Unconfiguring a DHCP Server Using dhcpconfig Commands

This section includes procedures to help you configure and unconfigure a DHCP server or a BOOTP relay agent by using dhcpconfig with command-line options.

ProcedureHow to Configure a DHCP Server (dhcpconfig -D)

Before You Begin

Make sure that you have read Chapter 13, Planning for DHCP Service (Tasks) before you configure your DHCP server. In particular, you should use the guidelines in Making Decisions for Your DHCP Server Configuration (Task Map) to help you perform the following tasks:

  1. Log in to the system on which you want to configure the DHCP server.

  2. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  3. Configure the DHCP server by typing a command of the following format:


    #/usr/sbin/dhcpconfig -D -r datastore -p location
    

    datastore is one of the following: SUNWfiles, SUNWbinfiles, or SUNWnisplus.

    location is the data-store-dependent location where you want to store the DHCP data. For SUNWfiles and SUNWbinfiles, the location must be an absolute path name. For SUNWnisplus, the location must be a fully specified NIS+ directory.

    For example, you might type a command similar to the following:


    dhcpconfig -D -r SUNWbinfiles -p /var/dhcp

    The dhcpconfig utility uses the host's system files and network files to determine values used to configure the DHCP server. See the dhcpconfig(1M) man page for information about additional options to the dhcpconfig command that enable you to override the default values.

  4. Add one or more networks to the DHCP service.

    See How to Add a DHCP Network (dhcpconfig) for the procedure to add a network.

ProcedureHow to Configure a BOOTP Relay Agent (dhcpconfig -R )

Before You Begin

Select the system that you want to use as a BOOTP relay agent, using the requirements listed in Selecting a Host to Run the DHCP Service.

  1. Log in to the server that you want to configure as a BOOTP relay agent.

  2. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  3. Configure the BOOTP relay agent by typing a command of the following format:


    # /usr/sbin/dhcpconfig -R server-addresses
    

    Specify one or more IP addresses of DHCP servers to which you want requests to be forwarded. If you specify more than one address, separate the addresses with commas.

    For example, you might type a command similar to the following:


    /usr/sbin/dhcpconfig -R 192.168.1.18,192.168.42.132

ProcedureHow to Unconfigure a DHCP Server or a BOOTP Relay Agent (dhcpconfig -U)

  1. Log in to the DHCP server or the BOOTP relay agent system that you want to unconfigure.

  2. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  3. Unconfigure the DHCP server or the BOOTP relay agent:


    # /usr/sbin/dhcpconfig -U
    

    If the server does not use shared data, you can also use the -x option to remove the dhcptab and network tables. If the server uses shared data, do not use the -x option. The -h option can be used to remove host names from the host table. See the dhcpconfig(1M) man page for more information about dhcpconfig options.

    See DHCP Data on an Unconfigured Server for more information about removing data.

Chapter 15 Administering DHCP (Tasks)

This chapter describes tasks that you might find useful when you administer the Oracle Solaris DHCP service. The chapter includes tasks for the server, BOOTP relay agent, and client. Each task includes a procedure to help you perform the task in DHCP Manager and a procedure for the equivalent task with DHCP command-line utilities. DHCP command-line utilities are more fully documented in man pages.

You should have already completed the initial configuration of your DHCP service and initial network before you use this chapter. Chapter 14, Configuring the DHCP Service (Tasks) discusses DHCP configuration.

This chapter contains the following information:

About DHCP Manager

DHCP Manager is a graphical user interface (GUI) tool that you can use to perform administration tasks on the DHCP service.

DHCP Manager Window

The DHCP Manager window's appearance depends on how the DHCP server is configured on the system on which DHCP Manager is running.

DHCP Manager uses a tab-based window when the system is configured as a DHCP server. You select a tab for the type of information you want to work with. DHCP Manager features the following tabs:

The following figure shows how the DHCP Manager window might look when you start DHCP Manager on a DHCP server.

Figure 15–1 DHCP Manager on a DHCP Server System

Shows Addresses tab with network numbers, client names,
and lease information.

When the server is configured as a BOOTP relay agent, the DHCP Manager window does not show these tabs. The BOOTP relay agent does not need the same information. You can only modify the BOOTP relay agent's properties and stop or start the DHCP daemon with DHCP Manager. The following figure shows how DHCP Manager might look on a system that is configured as a BOOTP relay agent.

Figure 15–2 DHCP Manager on a BOOTP Relay Agent

The window displays the BOOTP Relay tab, which tells
you to manage the relay service through the Service menu.

DHCP Manager Menus

DHCP Manager menus include the following items:

When DHCP Manager runs on a BOOTP relay agent, the Edit and View menus are disabled.

All DHCP management tasks are accomplished through the Edit and Service menus.

You use the commands in the Edit menu to create, delete, and modify items in the selected tab. Items can include networks, addresses, macros, and options. When the Addresses tab is selected, the Edit menu also lists wizards. Wizards are sets of dialogs that help you create networks and multiple IP addresses.

The Service menu lists commands that enable you to manage the DHCP daemon. From the Service menu, you can perform the following tasks:

Starting and Stopping DHCP Manager

You must run DHCP Manager on a DHCP server system as superuser. If you must run DHCP Manager remotely, you can send the display to your system by using the X Window remote display feature.

ProcedureHow to Start and Stop DHCP Manager

  1. Become superuser on the DHCP server system.

  2. (Optional) If you are logged in to the DHCP server system remotely, display DHCP Manager on your local system as follows.

    1. Type the following on the local system:


      # xhost +server-name
      
    2. Type the following on the remote DHCP server system:


      # DISPLAY=local-hostname;export DISPLAY
      
  3. Start DHCP Manager.


    # /usr/sadm/admin/bin/dhcpmgr &
    

    The DHCP Manager window opens. If the server is configured as a DHCP server, the window displays the Addresses tab. If the server is configured as a BOOTP relay agent, the window displays with no tabs.

  4. To stop DHCP Manager, choose Exit from the File menu.

    The DHCP Manager window closes.

Setting Up User Access to DHCP Commands

By default, only root or superuser can execute dhcpconfig, dhtadm, and pntadm commands. If you want non root users to use the commands, you can set up role-based access control (RBAC) for those commands.

Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

You might also find the following man pages helpful: rbac(5), exec_attr(4), and user_attr(4).

The following procedure explains how to assign the DHCP Management profile, which enables the user to execute the DHCP commands.

ProcedureHow to Grant Users Access to DHCP Commands

  1. Become superuser on the DHCP server system.

  2. Edit the file /etc/user_attr to add an entry of the following form. Add one entry for each user or role that should manage the DHCP service.


    username::::type=normal;profiles=DHCP Management

    For example, for user ram, you would add the following entry:

    ram::::type=normal;profiles=DHCP Management

Starting and Stopping the DHCP Service

This section describes starting and stopping the DHCP service by using DHCP Manager and the dhcpconfig command. The DHCP service can also be started and stopped by using the Service Management Facility (SMF) commands. See DHCP Service and the Service Management Facility for more information about using SMF commands with the DHCP service.

Starting and stopping the DHCP service encompasses several degrees of action you can take to affect the operation of the DHCP daemon. You must understand what each action means in order to select the correct procedure to obtain the result that you want. The terms for the actions are as follows:


Note –

If a server has multiple network interfaces but you do not want to provide DHCP services on all the networks, see Specifying Network Interfaces for DHCP Monitoring.


The following procedures help you start, stop, enable, and disable the DHCP service.

ProcedureHow to Start and Stop the DHCP Service (DHCP Manager)

  1. Become superuser on the DHCP server system.

  2. Start DHCP Manager.


    # /usr/sadm/admin/bin/dhcpmgr &
    
  3. Select one of the following:

    • Choose Start from the Service menu to start the DHCP service.

    • Choose Stop from the Service menu to stop the DHCP service.

      The DHCP daemon stops until it is restarted, or the system reboots.

    • Choose Restart from the Service menu to stop and immediately restart the DHCP service.

ProcedureHow to Enable and Disable the DHCP Service (DHCP Manager)

  1. In DHCP Manager, choose one of the following:

    • Choose Enable from the Service menu to configure the DHCP daemon for automatic startup when the system boots.

      The DHCP service starts immediately when it is enabled.

    • Choose Disable from the Service menu to prevent the DHCP daemon from automatically starting when the system boots.

      The DHCP service immediately stops when it is disabled.

ProcedureHow to Enable and Disable the DHCP Service (dhcpconfig -S)

  1. Log in to the DHCP server system.

  2. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  3. Choose one of the following:

    • To enable the DHCP service, type the following command:


      # /usr/sbin/dhcpconfig -S -e
      
    • To disable the DHCP service, type the following command:


      # /usr/sbin/dhcpconfig -S -d
      

DHCP Service and the Service Management Facility

The Service Management Facility (SMF) is described in Chapter 18, Managing Services (Overview), in System Administration Guide: Basic Administration. The SMF svcadm command can be used to enable and start the DHCP server, and disable and stop the DHCP server. However, you cannot use SMF commands to modify the DHCP service options that the DHCP tools allow you to set. In particular, service options that are stored in the /etc/dhcp/dhcpsvc.conf file cannot be set by using the SMF tools.

The following table maps DHCP commands to the equivalent SMF commands.

Table 15–1 SMF Commands For DHCP Server Tasks

Task 

DHCP Command 

SMF Command 

Enable DHCP service 

dhcpconfig -S -e

svcadm enable svc:/network/dhcp-server

Disable DHCP service 

dhcpconfig -S -d

svcadm disable svc:/network/dhcp-server

Start DHCP service for current session only 

None 

svcadm enable -t svc:/network/dhcp-server

Stop DHCP service for current session 

None 

svcadm disable -t svc:/network/dhcp-server

Restart DHCP service 

dhcpconfig -S -r

svcadm restart svc:/network/dhcp-server

Modifying DHCP Service Options (Task Map)

You can change values for some additional features of the DHCP service, which might not have been offered during the initial configuration with DHCP Manager. To change service options, you can use the Modify Service Options dialog box in DHCP Manager. Or you can specify options with the dhcpconfig command.

The following table is a map that describes tasks to modify DHCP service options. The table also includes links to the procedures to accomplish each task.

Task 

Description 

For Instructions 

Change logging options. 

Enable or disable logging, and select a syslog facility to use for logging DHCP transactions.

How to Generate Verbose DHCP Log Messages (DHCP Manager)

How to Generate Verbose DHCP Log Messages (Command Line)

How to Enable and Disable DHCP Transaction Logging (DHCP Manager)

How to Enable and Disable DHCP Transaction Logging (Command Line)

How to Log DHCP Transactions to a Separate syslog File

Change DNS update options. 

Enable or disable server's capability to dynamically add DNS entries for clients that supply a host name. Determine the maximum time the server should spend attempting to update DNS. 

How to Enable Dynamic DNS Updating for DHCP Clients

Enable or disable duplicate IP address detection. 

Enable or disable the DHCP server's capability to determine that an IP address is not already in use before offering the address to a client. 

How to Customize DHCP Performance Options (DHCP Manager)

How to Customize DHCP Performance Options (Command Line)

Change options for the DHCP server's reading of configuration information. 

Enable or disable the automatic reading of dhcptab at specified intervals, or change the interval between reads.

How to Customize DHCP Performance Options (DHCP Manager)

How to Customize DHCP Performance Options (Command Line)

Change the number of relay agent hops. 

Increase or decrease the number of networks a request can travel through before being dropped by the DHCP daemon. 

How to Customize DHCP Performance Options (DHCP Manager)

How to Customize DHCP Performance Options (Command Line)

Change the length of time an IP address offer is cached. 

Increase or decrease the number of seconds that the DHCP service reserves an offered IP address before offering the address to a new client. 

How to Customize DHCP Performance Options (DHCP Manager)

How to Customize DHCP Performance Options (Command Line)

The following figure shows DHCP Manager's Modify Service Options dialog box.

Figure 15–3 Modify Service Options Dialog Box in DHCP Manager

Dialog box shows the Options tab with many options fields
and check boxes. The context describes the purpose of the dialog box.

Changing DHCP Logging Options

The DHCP service can log DHCP service messages and DHCP transactions to syslog. See the syslogd(1M) and syslog.conf(4) man pages for more information about syslog.

DHCP service messages logged to syslog include the following:

You can increase the amount of information that is reported by using the verbose option for the DHCP daemon. Verbose message output can help you troubleshoot DHCP problems. See How to Generate Verbose DHCP Log Messages (DHCP Manager).

Another useful troubleshooting technique is transaction logging. Transactions provide information about every interchange between a DHCP server or BOOTP relay and clients. DHCP transactions include the following message types:

BOOTP relay transactions include the following message types:

DHCP transaction logging is disabled by default. When enabled, DHCP transaction logging uses the local0 facility in syslog by default. DHCP transaction messages are generated with a syslog severity level of notice. This security level causes DHCP transactions to be logged to the file where other system notices are logged. However, because the local facility is used, the DHCP transaction messages can be logged separately from other notices. To log the transaction messages separately, you must edit the syslog.conf file to specify a separate log file. See the syslog.conf(4) man page for more information about the syslog.conf file.

You can disable or enable transaction logging, and you can specify a different syslog facility, from local0 through local7, as explained in How to Enable and Disable DHCP Transaction Logging (DHCP Manager). In the server system's syslog.conf file, you can also instruct syslogd to store the DHCP transaction messages in a separate file. See How to Log DHCP Transactions to a Separate syslog File for more information.

ProcedureHow to Generate Verbose DHCP Log Messages (DHCP Manager)

  1. In DHCP Manager, choose Modify from the Service menu.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

    The Modify Service Options dialog box opens and displays the Options tab. See Figure 15–3.

  2. Select Verbose Log Messages.

  3. Select Restart Server.

    The Restart Server option is near the bottom of the dialog box.

  4. Click OK.

    The daemon runs in verbose mode for this session and each subsequent session until you reset this option. Verbose mode can reduce daemon efficiency because of the time that is taken to display messages.

ProcedureHow to Generate Verbose DHCP Log Messages (Command Line)

  1. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Type the following command to set verbose mode:


    # /usr/sbin/dhcpconfig -P VERBOSE=true
    

    The next time the DHCP server starts, the server runs in verbose mode until you turn off verbose mode.

    To turn off verbose mode, type the following command:


    # /usr/sbin/dhcpconfig -P VERBOSE=
    

    This command sets the VERBOSE keyword to no value, which causes the keyword to be removed from the server's configuration file.

    Verbose mode can reduce daemon efficiency because of the time that is taken to display messages.

ProcedureHow to Enable and Disable DHCP Transaction Logging (DHCP Manager)

This procedure enables and disables transaction logging for all subsequent DHCP server sessions.

  1. In DHCP Manager, choose Modify from the Service menu.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

  2. Select Log Transactions to Syslog Facility.

    To disable transaction logging, deselect this option.

  3. (Optional) Select a local facility from 0 to 7 to use for logging DHCP transactions.

    By default, DHCP transactions are logged to the location where system notices are logged, which depends on how syslogd is configured. If you want the DHCP transactions to be logged to a file separate from other system notices, see How to Log DHCP Transactions to a Separate syslog File.

    Message files can quickly become very large when transaction logging is enabled.

  4. Select Restart Server.

  5. Click OK.

    The daemon logs transactions to the selected syslog facility for this session and each subsequent session until you disable logging.

ProcedureHow to Enable and Disable DHCP Transaction Logging (Command Line)

  1. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Choose one of the following steps:

    • To enable DHCP transaction logging, type the following command:


      # /usr/sbin/dhcpconfig -P LOGGING_FACILITY=syslog-local-facility
      

      syslog-local-facility is a number from 0 through 7. If you omit this option, 0 is used.

      By default, DHCP transactions are logged to the location where system notices are logged, which depends on how syslogd is configured. If you want the DHCP transactions to be logged to a file separate from other system notices, see How to Log DHCP Transactions to a Separate syslog File.

      Message files can quickly become very large when transaction logging is enabled.

    • To disable DHCP transaction logging, type the following command:


      # /usr/sbin/dhcpconfig -P LOGGING_FACILITY=
      

      Note that you supply no value for the parameter.

ProcedureHow to Log DHCP Transactions to a Separate syslog File

  1. Become superuser or assume an equivalent role on the DHCP server system.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

    A role that is assigned to the DHCP Management profile might not be sufficient for this task. The role must have permission to edit syslog files.

  2. Edit the /etc/syslog.conf file on the server system to add a line of the following format:


    localn.notice     path-to-logfile
    

    n is the syslog facility number you specified for transaction logging, and path-to-logfile is the complete path to the file to use for logging transactions.

    For example, you might add the following line:

    local0.notice /var/log/dhcpsrvc

    See the syslog.conf(4) man page for more information about the syslog.conf file.

Enabling Dynamic DNS Updates by a DHCP Server

DNS provides name-to-address and address-to-name services for the Internet. Once a DNS mapping is made, a system can be reached through its host name or its IP address. The system is also reachable from outside its domain.

The DHCP service can use DNS in two ways:

You can enable the DHCP service to update the DNS service for DHCP clients that supply their own host names. For the DNS update feature to work, the DNS server, the DHCP server, and the DHCP client must be set up correctly. In addition, the requested host name must not be in use by another system in the domain.

The DHCP server's DNS update feature works if the following statements are true:

ProcedureHow to Enable Dynamic DNS Updating for DHCP Clients


Note –

Be aware that dynamic DNS updates are a security risk.

By default, the Oracle Solaris DNS daemon (in.named) does not allow dynamic updates. Authorization for dynamic DNS updates is granted in the named.conf configuration file on the DNS server system. No other security is provided. You must carefully weigh the convenience of this facility for users against the security risk created when you enable dynamic DNS updates.


  1. On the DNS server, edit the /etc/named.conf file as superuser.

  2. Find the zone section for the appropriate domain in the named.conf file.

  3. Add the DHCP server's IP addresses to the allow-update keyword.

    If the allow-update keyword does not exist, insert the keyword.

    For example, if the DHCP server resides at addresses 10.0.0.1 and 10.0.0.2, a named.conf file for the dhcp.domain.com zone should be modified as follows:


    zone "dhcp.domain.com" in {
                 type master;
                 file "db.dhcp";
                 allow-update { 10.0.0.1; 10.0.0.2; }; 
    };  
     
    zone "10.IN-ADDR.ARPA" in {
                 type master;
                 file "db.10"; 
                 allow-update { 10.0.0.1; 10.0.0.2; };
    }; 

    Note that allow-update for both zones must be enabled to allow the DHCP server to update both A and PTR records on the DNS server.

  4. On the DHCP server, start DHCP Manager.


    # /usr/sadm/admin/bin/dhcpmgr &
    

    See How to Start and Stop DHCP Manager for more detailed information.

  5. Choose Modify from the Service menu.

    The Modify Service Options dialog box opens.

  6. Select Update DNS Host Information Upon Client Request.

  7. Specify the number of seconds to wait for a response from the DNS server before timing out, then click OK.

    The default value of 15 seconds should be adequate. If you have time out problems, you can increase the value later.

  8. Click the Macros tab, and ensure that the correct DNS domain is specified.

    The DNSdmain option must be passed with the correct domain name to any client that expects dynamic DNS update support. By default, DNSdmain is specified in the server macro, which is used as the configuration macro bound to each IP address.

  9. Set up the DHCP client to specify its host name when requesting DHCP service.

    If you use the Oracle Solaris DHCP client, see How to Enable an Oracle Solaris DHCPv4 Client to Request a Specific Host Name. If your client is not a Oracle Solaris DHCP client, see the documentation for your DHCP client for information about how to specify a host name.

Client Host Name Registration

If you let the DHCP server generate host names for the IP addresses that you place in the DHCP service, the DHCP server can register those host names in NIS+, /etc/inet/hosts, or DNS name services. Host name registration cannot be done in NIS because NIS does not provide a protocol to allow programs to update and propagate NIS maps.


Note –

The DHCP server can update DNS with generated host names only if the DNS server and the DHCP server are running on the same system.


If a DHCP client provides its host name and the DNS server is configured to allow dynamic updates from the DHCP server, the DHCP server can update DNS on the client's behalf. Dynamic updates can be done even if the DNS and DHCP servers are running on different systems. See Enabling Dynamic DNS Updates by a DHCP Server for more information about enabling this feature.

The following table summarizes client host name registration for DHCP client systems with the various name services.

Table 15–2 Client Host Name Registration in Name Services
 

Who Registers Host Name 

Name Service 

DHCP-Generated Host Name 

DHCP Client-Supplied Host Name 

NIS 

NIS Administrator 

NIS Administrator 

NIS+ 

DHCP tools 

DHCP tools 

/etc/hosts

DHCP tools 

DHCP tools 

DNS 

DHCP tools, if the DNS server runs on the same system as the DHCP server 

DNS Administrator, if the DNS server runs on a different system 

DHCP server, if configured for dynamic DNS updates 

DNS Administrator, if DHCP server is not configured for dynamic DNS updates 

Oracle Solaris DHCP clients can request particular host names in DHCP requests if configured to do so as described in How to Enable an Oracle Solaris DHCPv4 Client to Request a Specific Host Name. Refer to the vendor documentation for other DHCP clients to determine if the capability is supported.

Customizing Performance Options for the DHCP Server

You can change options that affect the performance of the DHCP server. These options are described in the following table.

Table 15–3 Options Affecting DHCP Server Performance

Server Option 

Description 

Keyword 

Maximum number of BOOTP relay agent hops 

If a request has traveled through more than a given number of BOOTP relay agents, the request is dropped. The default maximum number of relay agent hops is four. This number is likely to be sufficient for most networks. A network might need more than four hops if DHCP requests pass through several BOOTP relay agents before reaching a DHCP server.

RELAY_HOPS=integer

Detect duplicate addresses 

By default, the server pings an IP address before offering the address to a client. A lack of response to the ping verifies that the address is not already in use. You can disable this feature to decrease the time that the server takes to make an offer. However, disabling the feature creates the risk of having duplicate IP addresses in use.

ICMP_VERIFY=TRUE/FALSE

Reload dhcptab automatically at specified intervals

The server can be set to automatically read the dhcptab at the interval, in minutes, that you specify. If your network configuration information does not change frequently, and you do not have multiple DHCP servers, you do not need to reload the dhcptab automatically. Also, note that DHCP Manager gives you the option to have the server reload the dhcptab after you make a change to the data.

RESCAN_INTERVAL=min

Cache offers of IP addresses for specified intervals 

After a server offers an IP address to a client, the offer is cached. While the offer is cached, the server does not offer the address again. You can change the number of seconds for which the offer is cached. The default is 10 seconds. On slow networks, you might need to increase the offer time.

OFFER_CACHE_TIMEOUT=sec

The following procedures describe how to change these options.

ProcedureHow to Customize DHCP Performance Options (DHCP Manager)

  1. In DHCP Manager, choose Modify from the Service menu.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

  2. Change the desired options.

    See Table 15–3 for information about the options.

  3. Select Restart Server.

  4. Click OK.

ProcedureHow to Customize DHCP Performance Options (Command Line)

If you change options with this procedure, the changed options are used only after the DHCP server is restarted.

  1. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Modify one or more performance options:


    # /usr/sbin/dhcpconfig -P keyword=value,keyword=value...
    

    keyword=value can be any of the following keywords:

    RELAY_HOPS=integer

    Specifies the maximum number of relay agent hops that can occur before the daemon drops the DHCP or BOOTP datagram.

    ICMP_VERIFY=TRUE/FALSE

    Enables or disables automatic duplicate IP address detection. Setting this keyword to FALSE is not recommended.

    RESCAN_INTERVAL=minutes

    Specifies the interval in minutes that the DHCP server should use to schedule the automatic rereading of the dhcptab information.

    OFFER_CACHE_TIMEOUT=seconds

    Specifies the number of seconds the DHCP server should cache the offers that are extended to discovering DHCP clients. The default setting is 10 seconds.


Example 15–1 Setting DHCP Performance Options

The following is an example of how to specify all the command options.


# dhcpconfig -P RELAY_HOPS=2,ICMP_VERIFY=TRUE,\
RESCAN_INTERVAL=30,OFFER_CACHE_TIMEOUT=20

Adding, Modifying, and Removing DHCP Networks (Task Map)

When you configure a DHCP server, you must also configure at least one network in order to use the DHCP service. You can add more networks at any time.

The following table is a map that describes additional tasks that you can perform when working with DHCP networks after their initial configuration. The task map includes links to procedures for carrying out the tasks.

Task 

Description 

For Instructions 

Enable or disable the DHCP service on server network interfaces 

The default behavior is to monitor all network interfaces for DHCP requests. If you do not want all interfaces to accept DHCP requests, you can remove an interface from the list of monitored interfaces. 

How to Specify Network Interfaces for DHCP Monitoring (DHCP Manager)

Add a new network to the DHCP service. 

Places a network under DHCP management, for the purpose of managing IP addresses on the network. 

How to Add a DHCP Network (DHCP Manager)

How to Add a DHCP Network (dhcpconfig)

Change parameters of a DHCP-managed network. 

Modifies the information that is passed to clients of a particular network. 

How to Modify the Configuration of a DHCP Network (DHCP Manager)

How to Modify the Configuration of a DHCP Network (dhtadm)

Delete a network from the DHCP service. 

Removes a network so that IP addresses on the network are no longer managed by DHCP. 

How to Remove a DHCP Network (DHCP Manager)

How to Remove a DHCP Network (pntadm)

Specifying Network Interfaces for DHCP Monitoring

By default, both dhcpconfig and DHCP Manager's Configuration Wizard configure the DHCP server to monitor all the server system's network interfaces. If you add a new network interface to the server system, the DHCP server automatically monitors the new interface when you boot the system. You can then add any networks to be monitored through the network interface.

However, you can also specify which network interfaces should be monitored, and which interfaces should be ignored. You might want to ignore an interface if you do not want to offer DHCP service on that network.

If you specify that any interface should be ignored, and then install a new interface, the DHCP server ignores the new interface. You must add the new interface to the server's list of monitored interfaces. You can specify interfaces with DHCP Manager or the dhcpconfig utility.

This section includes procedures that enable you to specify which network interfaces DHCP should monitor or ignore. The DHCP Manager procedure uses the Interfaces tab of the DHCP Manager's Modify Service Options dialog box, which is shown in the following figure.

Figure 15–4 Interfaces Tab of Modify Service Options Dialog Box in DHCP Manager

Dialog box lists Monitored and Ignored Interfaces on
left and right with selection arrows between lists. OK, Reset, Cancel, and
Help buttons shown.

ProcedureHow to Specify Network Interfaces for DHCP Monitoring (DHCP Manager)

  1. In DHCP Manager, choose Modify from the Service menu.

    The Modify Service Options dialog box is displayed.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

  2. Select the Interfaces tab.

  3. Select the appropriate network interface.

  4. Click the arrow buttons to move the interface to the appropriate list.

    For example, to ignore an interface, select the interface in the Monitored Interfaces list, and then click the right arrow button. The interface is then shown in the Ignored Interfaces list.

  5. Select Restart Server, and click OK.

    The changes you make persist across reboots.

ProcedureHow to Specify Network Interfaces for DHCP Monitoring (dhcpconfig)

  1. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Type the following command on the DHCP server system:


    # /usr/sbin/dhcpconfig -P INTERFACES=int,int,...
    

    int, int,... is a list of interfaces to monitor. The interface names must be separated by commas.

    For example, you would use the following command to monitor only ge0 and ge1:


    #/usr/sbin/dhcpconfig -P INTERFACES=ge0,ge1
    

    Interfaces that you want to ignore should be omitted from the dhcpconfig command line.

    The changes you make with this command persist across reboots.

Adding DHCP Networks

When you use DHCP Manager to configure the server, the first network is also configured at the same time. The first network is usually the local network on the server system's primary interface. If you want to configure additional networks, use the DHCP Network Wizard in DHCP Manager.

If you use the dhcpconfig -D command to configure the server, you must separately configure all networks that you want to use the DHCP service. See How to Add a DHCP Network (dhcpconfig) for more information.

The following figure shows the initial dialog box for the DHCP Network Wizard in DHCP Manager.

Figure 15–5 DHCP Manager's Network Wizard

Dialog box shows a Network Address pull-down list and
Subnet Mask field with a right selection arrow. Cancel and Help buttons are
also shown.

When you configure a new network, DHCP Manager creates the following components:

ProcedureHow to Add a DHCP Network (DHCP Manager)

  1. In DHCP Manager, click the Addresses tab.

    Any networks already configured for DHCP service are listed.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

  2. Choose Network Wizard from the Edit menu.

  3. Select options, or type requested information. Use the decisions that you made during the planning phase to determine what information to specify.

    Planning is described in Planning DHCP Configuration of Your Remote Networks.

    If you have difficulty with the wizard, click Help in the wizard window. Your web browser displays help for the DHCP Network Wizard.

  4. Click Finish to complete the network configuration when you have finished specifying the requested information.

    The Network Wizard creates an empty network table, which is listed in the left pane of the window.

    The Network Wizard also creates a network macro whose name matches the IP address of the network.

  5. (Optional) Select the Macros tab and select the network macro to view the macro's contents.

    You can confirm that the information that you provided in the wizard has been inserted as values for options in the network macro.

See Also

You must add addresses for the network before the network's IP addresses can be managed under DHCP. See Adding IP Addresses to the DHCP Service for more information.

If you leave the network table empty, the DHCP server can still provide configuration information to clients. See Setting Up DHCP Clients to Receive Information Only (Task Map) for more information.

ProcedureHow to Add a DHCP Network (dhcpconfig)

  1. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Type the following command on the DHCP server system:


    # /usr/sbin/dhcpconfig -N network-address
    

    network-address is the IP address of the network you want to add to the DHCP service. See the dhcpconfig(1M) man page for suboptions you can use with the -N option.

    If you do not use suboptions, dhcpconfig uses network files to obtain information about the network.

See Also

You must add addresses for the network before the network's IP addresses can be managed under DHCP. See Adding IP Addresses to the DHCP Service for more information.

If you leave the network table empty, the DHCP server can still provide configuration information to clients. See Setting Up DHCP Clients to Receive Information Only (Task Map) for more information.

Modifying DHCP Network Configurations

After you add a network to the DHCP service, you can modify the configuration information that you originally supplied. The configuration information is stored in the network macro used to pass information to clients on the network. You must modify the network macro to change the network configuration.

The following figure shows the Macros tab of DHCP Manager.

Figure 15–6 DHCP Manager's Macros Tab

Macros tab shows list of macros with one macro selected.
Option names and values contained in macro are shown.

ProcedureHow to Modify the Configuration of a DHCP Network (DHCP Manager)

  1. In DHCP Manager, select the Macros tab.

    All macros that are defined for this DHCP server are listed in the left pane.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

  2. Select the network macro whose name matches the network configuration that you are changing.

    The network macro name is the network IP address.

  3. Choose Properties from the Edit menu.

    The Macro Properties dialog box displays a table of the options included in the macro.

  4. Select the option that you want to modify.

    The option name and its value are displayed in text fields near the top of the dialog box.

  5. (Optional) Modify the option name, or choose the Select button to display a list of option names.

    The Select Option dialog box displays a list of all DHCP standard options, with a brief description of each option.

  6. (Optional) Select an option name in the Select Option dialog box, and click OK.

    The new option name is displayed in the Option Name field.

  7. Type the new value for the option, and click Modify.

  8. (Optional) You can also add options to the network macro by choosing Select in the dialog box.

    See Modifying DHCP Macros for more general information about modifying macros.

  9. Select Notify DHCP Server of Change, and click OK.

    This selection tells the DHCP server to reread the dhcptab table to put the change into effect immediately after you click OK.

ProcedureHow to Modify the Configuration of a DHCP Network (dhtadm)

  1. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Determine which macro includes information for all clients of the network.

    The network macro's name matches the network IP address.

    If you don't know which macro includes this information, you can display the dhcptab table to list all macros by using the command dhtadm -P.

  3. Type a command of the following format to change the value of the option you want to change:


    # dhtadm -M -m macro-name -e 'symbol=value' -g
    

    See the dhtadm(1M) man page for more information about dhtadm command-line options.


Example 15–2 Using the dhtadm Command to Modify a DHCP Macro

For example, to change the 10.25.62.0 macro's lease time to 57600 seconds and the NIS domain to sem.example.com, you would type the following commands:

# dhtadm -M -m 10.25.62.0 -e 'LeaseTim=57600' -g

# dhtadm -M -m 10.25.62.0 -e 'NISdmain=sem.example.com' -g

The -g option causes the DHCP daemon to reread the dhcptab table and put the changes into effect.


Removing DHCP Networks

DHCP Manager enables you to remove multiple networks at once. You have the option to automatically remove the hosts table entries associated with the DHCP-managed IP addresses on those networks as well. The following figure shows DHCP Manager's Delete Networks dialog box.

Figure 15–7 Delete Networks Dialog Box in DHCP Manager

Dialog box shows two lists, Keep Networks and Delete
Networks, with selection arrows between them. Check box for Delete host table
entries also shown.

The pntadm command requires you to delete each IP address entry from a network before you delete that network. You can delete only one network at a time.

ProcedureHow to Remove a DHCP Network (DHCP Manager)

  1. In DHCP Manager, select the Addresses tab.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

  2. Choose Delete Networks from the Edit menu.

    The Delete Networks dialog box opens.

  3. In the Keep Networks list, select the networks that you want to delete.

    Press the Control key while you click with the mouse to select multiple networks. Press the Shift key while you click to select a range of networks.

  4. Click the right arrow button to move the selected networks to the Delete Networks list.

  5. If you want to remove the host table entries for this network's DHCP addresses, select Delete Host Table Entries.

    Note that deleting host table entries does not delete the host registrations at the DNS server for these addresses. Entries are deleted only in the local name service.

  6. Click OK.

ProcedureHow to Remove a DHCP Network (pntadm)

Note that this procedure deletes the network's IP addresses from the DHCP network table before removing the network. The addresses are deleted to ensure that the host names are removed from the hosts file or database.

  1. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Type a command following this format to remove an IP address and its host name from the name service:


    # pntadm -D -y IP-address
    

    For example, to remove IP address 10.25.52.1, you would type the following command:

    # pntadm -D -y 10.25.52.1

    The -y option specifies to delete the host name.

  3. Repeat the pntadm -D -y command for each address in the network.

    You might want to create a script to run the pntadm command if you are deleting many addresses.

  4. After all addresses are deleted, type the following command to delete the network from the DHCP service.


    # pntadm -R network-IP-address
    

    For example, to remove network 10.25.52.0, you would type the following command:

    # pntadm -R 10.25.52.0

    See the pntadm(1M) man page for more information about using the pntadm utility.

Supporting BOOTP Clients With the DHCP Service (Task Map)

To support BOOTP clients on your DHCP server, you must set up your DHCP server to be BOOTP compatible. If you want to specify which BOOTP clients can use your DHCP, you can register BOOTP clients in the DHCP server's network table. Alternatively, you can reserve a number of IP addresses for automatic allocation to BOOTP clients.


Note –

BOOTP addresses are permanently assigned, whether or not you explicitly assign a permanent lease to the address.


The following table describes tasks that you might need to perform to support BOOTP clients. The task map contains links to the procedures used to carry out the tasks.

Task 

Description 

For Instructions 

Set up automatic BOOTP support. 

Provides IP address for any BOOTP client on a DHCP-managed network, or on a network connected by a relay agent to a DHCP-managed network.  

You must reserve a pool of addresses for exclusive use by BOOTP clients. This option might be more useful if the server must support a large number of BOOTP clients. 

How to Set Up Support of Any BOOTP Client (DHCP Manager)

Set up manual BOOTP support. 

Provides IP address for only those BOOTP clients that have been manually registered with the DHCP service.  

This option requires you to bind a client's ID to a particular IP address that has been marked for BOOTP clients. This option is useful for a small number of BOOTP clients, or when you want to restrict the BOOTP clients that can use the DHCP server. 

How to Set Up Support of Registered BOOTP Clients (DHCP Manager)

ProcedureHow to Set Up Support of Any BOOTP Client (DHCP Manager)

  1. In DHCP Manager, select Modify from the Service menu.

    The Modify Service Options dialog box opens.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

  2. In the BOOTP Compatibility section of the dialog box, select Automatic.

  3. Select Restart Server, and click OK.

  4. Select the Addresses tab.

  5. Select addresses that you want to reserve for BOOTP clients.

    Select a range of addresses by clicking the first address, pressing the Shift key, and clicking the last address. Select multiple nonconcurrent addresses by pressing the Control key while clicking each address.

  6. Select Properties from the Edit menu.

    The Modify Multiple Addresses dialog box opens.

  7. In the BOOTP section, select Assign All Addresses Only to BOOTP Clients.

    All other options should be set to Keep Current Settings.

  8. Click OK.

    Any BOOTP client can now obtain an address from this DHCP server.

ProcedureHow to Set Up Support of Registered BOOTP Clients (DHCP Manager)

  1. In DHCP Manager, select Modify from the Service menu.

    The Modify Service Options dialog box opens.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

  2. In the BOOTP Compatibility section of the dialog box, select Manual.

  3. Select Restart Server, and click OK.

  4. Select the Addresses tab.

  5. Select an address that you want to assign to a particular BOOTP client.

  6. Choose Properties from the Edit menu.

    The Address Properties dialog box opens.

  7. In the Address Properties dialog box, select the Lease tab.

  8. In the Client ID field, type the client's identifier.

    For a BOOTP Oracle Solaris client on an Ethernet network, the client ID is a string that is derived from the client's hexadecimal Ethernet address. The client ID includes a prefix that indicates the Address Resolution Protocol (ARP) type for Ethernet (01). For example, a BOOTP client with the Ethernet address 8:0:20:94:12:1e would use the client ID 0108002094121E.


    Tip –

    As superuser on an Oracle Solaris client system, type the following command to obtain the Ethernet address for the interface:

    # ifconfig -a


  9. Select Reserved to reserve the IP address for this client.

  10. Select Assign Only to BOOTP Clients, and click OK.

    In the Addresses tab, BOOTP is displayed in the Status field, and the client ID you specified is listed in the Client ID field.

Working With IP Addresses in the DHCP Service (Task Map)

You can use DHCP Manager or the pntadm command to add IP addresses, modify address properties, and remove addresses from the DHCP service. Before you work with IP addresses, you should refer to Table 15–4 to become familiar with IP address properties. The table provides information for users of DHCP Manager and pntadm.


Note –

Table 15–4 includes examples of using pntadm to specify IP address properties while adding and modifying IP addresses. Refer also to the pntadm(1M) man page for more information about pntadm.


The following task map lists tasks that you must perform to add, modify, or remove IP addresses. The task map also contains links to the procedures used to carry out the tasks.

Task 

Description 

For Instructions 

Add single or multiple IP addresses to the DHCP service. 

Adds IP addresses on networks that are already managed by the DHCP service by using DHCP Manager. 

How to Add a Single IP Address (DHCP Manager)

How to Duplicate an Existing IP Address (DHCP Manager)

How to Add Multiple IP Addresses (DHCP Manager)

How to Add IP Addresses (pntadm)

Change properties of an IP address. 

Changes any of the IP address properties described in Table 15–4.

How to Modify IP Address Properties (DHCP Manager)

How to Modify IP Address Properties (pntadm)

Remove IP addresses from the DHCP service. 

Prevents the use of specified IP addresses by DHCP. 

How to Mark IP Addresses as Unusable (DHCP Manager)

How to Mark IP Addresses as Unusable (pntadm)

How to Delete IP Addresses From DHCP Service (DHCP Manager)

How to Delete IP Addresses From the DHCP Service (pntadm)

Assign a consistent IP address to a DHCP client. 

Sets up a client to receive the same IP address each time the client requests its configuration. 

How to Assign a Consistent IP Address to a DHCP Client (DHCP Manager)

How to Assign a Consistent IP Address to a DHCP Client (pntadm)

The following table lists and describes the properties of IP addresses.

Table 15–4 IP Address Properties

Property 

Description 

How to Specify in pntadm Command

Network address 

The address of the network that contains the IP address that you are working with. 

The network address is displayed in the Networks list within the Addresses tab in DHCP Manager. 

The network address must be the last argument on the pntadm command line used to create, modify, or delete an IP address.

For example, to add an IP address to network 10.21.0.0, you would type:

pntadm -A ip-address options 10.21.0.0

IP address 

The address you are working with, whether you are creating, modifying, or deleting the address. 

The IP address is displayed in the first column of the DHCP Manager's Addresses tab. 

The IP address must accompany the -A, -M, and -D options to the pntadm command.

For example, to modify IP address 10.21.5.12, you would type:

pntadm -M 10.21.5.12 options 10.21.0.0

Client name 

The host name mapped to the IP address in the hosts table. This name can be automatically generated by DHCP Manager when addresses are created. If you create a single address, you can supply the name. 

Specify the client name with the -h option.

For example, to specify client name carrot12 for 10.21.5.12, you would type:

pntadm -M 10.21.5.12 -h carrot12 10.21.0.0

Owned by server 

The DHCP server that manages the IP address and responds to the DHCP client's request for IP address allocation. 

Specify the owning server name with the -s option.

For example to specify server blue2 to own 10.21.5.12, you would type:

pntadm -M 10.21.5.12 -s blue2 10.21.0.0

Configuration macro 

The macro that the DHCP server uses to obtain network configuration options from the dhcptab table. Several macros are created automatically when you configure a server, and when you add networks. See About DHCP Macros for more information about macros. When addresses are created, a server macro is also created. The server macro is assigned as the configuration macro for each address.

Specify the macro name with the -m option.

For example, to assign the server macro blue2 to address 10.21.5.12, you would type:

pntadm -M 10.21.5.12 -m blue2 10.21.0.0

Client ID 

A text string that is unique within the DHCP service.

If the client ID is listed as 00, the address is not allocated to any client. If you specify a client ID when modifying the properties of an IP address, the address is bound exclusively to that client. 

The client ID is determined by the vendor of the DHCP client. If your client is not an Oracle Solaris DHCP client, consult your DHCP client documentation for more information. 

Specify the client ID with the -i option.

For example, to assign client ID 08002094121E to address 10.21.5.12, you would type:

pntadm -M 10.21.5.12 -i 0108002094121E 10.21.0.0

 

For Oracle Solaris DHCP clients, the client ID is derived from the client's hexadecimal hardware address. The client ID includes a prefix that represents the ARP code for the type of network, such as 01 for Ethernet. The ARP codes are assigned by the Internet Assigned Numbers Authority (IANA) in the ARP Parameters section of the Assigned Numbers standard at http://www.iana.com/numbers.html

For example, an Oracle Solaris client with the hexadecimal Ethernet address 8:0:20:94:12:1e uses the client ID 0108002094121E. The client ID is listed in DHCP Manager and pntadm when a client is currently using an address.

Tip: As superuser on the Oracle Solaris client system, type the following command to obtain the Ethernet address for the interface: ifconfig -a

 

Reserved 

The setting that specifies the address is reserved exclusively for the client indicated by the client ID, and the DHCP server cannot reclaim the address. If you choose this option, you manually assign the address to the client.

Specify that the address is reserved, or manual, with the -f option.

For example, to specify that IP address 10.21.5.12 is reserved for a client, you would type:

pntadm -M 10.21.5.12 -f MANUAL 10.21.0.0

Lease type or policy 

The setting that determines how DHCP manages the use of IP addresses by clients. A lease is either dynamic or permanent. See Dynamic and Permanent Lease Types for a complete explanation.

Specify that the address is permanently assigned with the -f option. Addresses are dynamically leased by default.

For example, to specify that IP address 10.21.5.12 has a permanent lease, you would type:

pntadm -M 10.21.5.12 -f PERMANENT 10.21.0.0

Lease expiration date 

The date when the lease expires, applicable only when a dynamic lease is specified. The date is specified in mm/dd/yyyy format.

Specify a lease expiration date with the -e option.

For example, to specify an expiration date of January 1, 2006, you would type: 

pntadm -M 10.21.5.12 -e 01/01/2006 10.21.0.0

BOOTP setting 

The setting that marks the address as reserved for BOOTP clients. See Supporting BOOTP Clients With the DHCP Service (Task Map) for more information about supporting BOOTP clients.

Reserve an address for BOOTP clients with the -f option.

For example, to reserve IP address 10.21.5.12 for BOOTP clients, you would type:

pntadm -M 10.21.5.12 -f BOOTP 10.21.0.0

Unusable setting 

The setting that marks the address to prevent assignment of the address to any client.

Mark an address as unusable with the -f option.

For example, to mark IP address 10.21.5.12 as unusable, you would type:

pntadm -M 10.21.5.12 -f UNUSABLE 10.21.0.0

Adding IP Addresses to the DHCP Service

Before you add IP addresses, you must add the network that owns the addresses to the DHCP service. See Adding DHCP Networks for information about adding networks.

You can add addresses with DHCP Manager or the pntadm command.

On networks that are already managed by the DHCP service, you can add addresses in several ways with DHCP Manager:

The following figure shows the Create Address dialog box. The Duplicate Address dialog box is identical to the Create Address dialog box, except that the text fields display the values for an existing address.

Figure 15–8 Create Address Dialog Box in DHCP Manager

Dialog box shows Address tab, which includes fields IP
Address, Client Name, Comment. Shows pull-down list called Configuration Macro.

The following figure shows the first dialog of the Add Addresses to Network wizard, used to add a range of IP addresses.

Figure 15–9 Add Addresses to Network Wizard in DHCP Manager

The context describes the purpose of the graphic. Shows
Number of IP Addresses and Comment fields, back and forward arrows, Cancel,
and Help buttons.

ProcedureHow to Add a Single IP Address (DHCP Manager)

  1. In DHCP Manager, select the Addresses tab.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

  2. Select the network where the new IP address is to be added.

  3. Choose Create from the Edit menu.

    The Create Address dialog box opens.

  4. Select or type values for the address settings on the Address and Lease tabs.

    Select the Help button to open a web browser to display help for the dialog box. Also, see Table 15–4 for detailed information about the settings.

  5. Click OK.

ProcedureHow to Duplicate an Existing IP Address (DHCP Manager)

  1. In DHCP Manager, select the Addresses tab.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

  2. Select the network where the new IP address is located.

  3. Select the address with properties that you want to duplicate.

  4. Choose Duplicate from the Edit menu.

  5. Specify the new IP address in the IP Address field.

  6. (Optional) Specify a new client name for the address.

    You cannot use the same name that is used by the address that you are duplicating.

  7. (Optional) Modify other option values, if necessary.

    Most other option values should remain the same.

  8. Click OK.

ProcedureHow to Add Multiple IP Addresses (DHCP Manager)

  1. In DHCP Manager, select the Addresses tab.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

  2. Select the network where the new IP addresses are to be added.

  3. Choose Address Wizard from the Edit menu.

    The Add Addresses to Network dialog box prompts you to provide values for the IP address properties. See Table 15–4 for more information about the properties, or select the Help button in the dialog box. Making Decisions for IP Address Management (Task Map) includes more extensive information.

  4. Click the right arrow button as you finish each screen, and click Finish on the last screen.

    The Addresses tab is updated with the new addresses.

ProcedureHow to Add IP Addresses (pntadm)

  1. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Add IP addresses by typing a command of the following format:


    # pntadm -A ip-address options  network-address
    

    Refer to the pntadm(1M) man page for a list of options you can use with pntadm -A. In addition, Table 15–4 shows some sample pntadm commands that specify options.


    Note –

    You can write a script to add multiple addresses with pntadm. See Example 18–1 for an example.


Modifying IP Addresses in the DHCP Service

You can modify any of the address properties described in Table 15–4 by using DHCP Manager or the pntadm -M command. See the pntadm(1M) man page for more information about pntadm -M.

The following figure shows the Address Properties dialog box that you use to modify IP address properties.

Figure 15–10 Address Properties Dialog Box in DHCP Manager

Address tab with fields called IP Address, Client Name,
Owned by Server, and Comment. Also shows Configuration Macro with pull-down
list.

The following figure shows the Modify Multiple Addresses dialog box that you use to modify multiple IP addresses.

Figure 15–11 Modify Multiple Addresses Dialog Box in DHCP Manager

Dialog box shows pull-down lists labeled Managing Server
and Configuration Macro. Shows selections for BOOTP, Unusable addresses, and
Lease Type.

ProcedureHow to Modify IP Address Properties (DHCP Manager)

  1. In DHCP Manager, select the Addresses tab.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

  2. Select the IP address's network.

  3. Select one or more IP addresses to modify.

    If you want to modify more than one address, press the Control key while you click with the mouse to select multiple addresses. You can also press the Shift key while you click to select a block of addresses.

  4. Choose Properties from the Edit menu.

    The Address Properties dialog box or the Modify Multiple Address dialog box opens.

  5. Change the appropriate properties.

    Click the Help button, or refer to Table 15–4 for information about the properties.

  6. Click OK.

ProcedureHow to Modify IP Address Properties (pntadm)

  1. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Modify IP address properties by typing a command of the following format:


    # pntadm -M ip-address options network-address
    

    Many options can be used with the pntadm command, which are documented in the pntadm(1M) man page.

    Table 15–4 shows some sample pntadm commands that specify options.

Removing IP Addresses From the DHCP Service

At times, you might want the DHCP service to stop managing a particular IP address or group of addresses. The method that you use to remove an address from DHCP depends on whether you want the change to be temporary or permanent.

Marking IP Addresses as Unusable by the DHCP Service

You can use the pntadm -M command with the -f UNUSABLE option to mark addresses as unusable.

In DHCP Manager, you use the Address Properties dialog box, shown in Figure 15–10, to mark individual addresses. You use the Modify Multiple Addresses dialog box, show in Figure 15–11, to mark multiple addresses, as described in the following procedure.

ProcedureHow to Mark IP Addresses as Unusable (DHCP Manager)

  1. In DHCP Manager, select the Addresses tab.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

  2. Select the IP address's network.

  3. Select one or more IP addresses to mark as unusable.

    If you want to mark more than one address as unusable, press the Control key while you click with the mouse to select multiple addresses. You can also press the Shift key while you click to select a block of addresses.

  4. Choose Properties from the Edit menu.

    The Address Properties dialog box or the Modify Multiple Address dialog box opens.

  5. If you are modifying one address, select the Lease tab.

  6. Select Address is Unusable.

    If you are editing multiple addresses, select Mark All Addresses Unusable.

  7. Click OK.

ProcedureHow to Mark IP Addresses as Unusable (pntadm)

  1. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Mark IP addresses as unusable by typing a command of the following format:


    # pntadm -M ip-address -f UNUSABLE network-address
    

    For example, to mark address 10.64.3.3 as unusable, type:

    pntadm -M 10.64.3.3 -f UNUSABLE 10.64.3.0

Deleting IP Addresses From the DHCP Service

You should delete IP addresses from the DHCP network tables if you no longer want the address to be managed by DHCP. You can use the pntadm -D command or DHCP Manager's Delete Address dialog box.

The following figure shows the Delete Address dialog box.

Figure 15–12 Delete Address Dialog Box in DHCP Manager

Dialog box shows list of IP addresses to delete and a
check box labeled Delete from hosts table. Shows OK, Cancel, and Help buttons.

ProcedureHow to Delete IP Addresses From DHCP Service (DHCP Manager)

  1. In DHCP Manager, select the Addresses tab.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

  2. Select the IP address's network.

  3. Select one or more IP addresses to delete.

    If you want to delete more than one address, press the Control key while you click with the mouse to select multiple addresses. You can also press the Shift key while you click to select a block of addresses.

  4. Choose Delete from the Edit menu.

    The Delete Address dialog box lists the address that you selected so that you can confirm the deletion.

  5. If you want to delete the host names from the hosts table, select Delete From Hosts Table.

    If the host names were generated by DHCP Manager, you might want to delete the names from the hosts table.

  6. Click OK.

ProcedureHow to Delete IP Addresses From the DHCP Service (pntadm)

  1. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Delete IP addresses by typing a command of the following format:


    # pntadm -D ip-address options network-address
    

    If you include the -y option, the host name is deleted from the name service that maintains the host name.

    For example, to delete address 10.64.3.3 from network 10.64.3.0, and delete the corresponding host name, type:

    pntadm -D 10.64.3.3 -y 10.64.3.0

Assigning a Reserved IP Address to a DHCP Client

The Oracle Solaris DHCP service attempts to provide the same IP address to a client that has previously obtained an address through DHCP. However, sometimes an address has already been reassigned to another client.

Routers, NIS or NIS+ servers, DNS servers, and other hosts that are critical to the network should not be DHCP clients. Hosts that provide services to the network should not rely on the network to obtain their IP addresses. Clients such as print servers or file servers should have consistent IP addresses as well. These clients can receive their network configurations and also be assigned a consistent IP address from the DHCP server.

You can set up the DHCP server to supply the same IP address to a client each time the client requests its configuration. You reserve the IP address for the client by manually assigning the client's ID to the address that you want the client to use. You can set up the reserved address to use either a dynamic lease or a permanent lease. If the client's address uses a dynamic lease, you can easily track the use of the address. A diskless client is an example of a client that should use a reserved address with a dynamic lease. If the client's address uses a permanent lease, you cannot track address use. Once a client obtains a permanent lease, the client does not contact the server again. The client can obtain updated configuration information only by releasing the IP address and restarting the DHCP lease negotiation.

You can use the pntadm -M command or DHCP Manager's Address Properties dialog box to set up lease properties.

The following figure shows the Lease tab of the Address Properties dialog box, which is used to modify the lease.

Figure 15–13 Address Properties Lease Tab in DHCP Manager

Dialog box shows Lease tab, which includes Client ID
field, Reserved check box, and settings for Lease Policy, BOOTP clients, and
Address is unusable.

ProcedureHow to Assign a Consistent IP Address to a DHCP Client (DHCP Manager)

  1. In DHCP Manager, select the Addresses tab.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

  2. Select the appropriate network.

  3. Double-click the IP address that you want to the client to use.

    The Address Properties window opens.

  4. Select the Lease tab.

  5. In the Client ID field, type the client ID.

    The client ID is derived from the client's hardware address. See the Client ID entry in Table 15–4 for more information.

  6. Select the Reserved option to prevent the IP address from being reclaimed by the server.

  7. In the Lease Policy area of the window, select Dynamic or Permanent assignment.

    Select Dynamic if you want the client to negotiate to renew leases, which enables you to track when the address is used. Because you selected Reserved, the address cannot be reclaimed even when a dynamic lease is assigned. You do not need to specify an expiration date for this lease. The DHCP server calculates the expiration date by using the lease time.

    If you select Permanent, you cannot track the use of the IP address unless you enable transaction logging.

  8. Click OK.

ProcedureHow to Assign a Consistent IP Address to a DHCP Client (pntadm)

  1. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Set the lease flags by typing a command of the following format:


    # pntadm -M ip-address -i client-id -f MANUAL+BOOTP network-address
    

    For example, to enable the Oracle Solaris DHCP client whose MAC address is 08:00:20:94:12:1E to always receive IP address 10.21.5.12, you would type:

    pntadm -M 10.21.5.12 -i 0108002094121E -f MANUAL+BOOTP 10.21.0.0


    Tip –

    Refer to the Client ID entry in Table 15–4 for more information about how to determine client identifiers.


Working With DHCP Macros (Task Map)

DHCP macros are containers of DHCP options. The Oracle Solaris DHCP service uses macros to gather options that should be passed to clients. DHCP Manager and the dhcpconfig utility create a number of macros automatically when you configure the server. See About DHCP Macros for background information about macros. See Chapter 14, Configuring the DHCP Service (Tasks) for information about macros created by default.

You might find that when changes occur on your network, you need to make changes to the configuration information that is passed to clients. To change configuration information, you need to work with DHCP macros. You can view, create, modify, duplicate, and delete DHCP macros.

When you work with macros, you must know about DHCP standard options, which are described in the dhcp_inittab(4) man page.

The following task map lists tasks to help you view, create, modify, and delete DHCP macros. The map also includes links to sections that detail how to accomplish each task.

Task 

Description 

For Instructions 

View DHCP macros. 

Display a list of all the macros that are defined on the DHCP server. 

How to View Macros Defined on a DHCP Server (DHCP Manager)

How to View Macros Defined on a DHCP Server (dhtadm)

Create DHCP macros. 

Create new macros to support DHCP clients. 

How to Create a DHCP Macro (DHCP Manager)

How to Create a DHCP Macro (dhtadm)

Modify values that are passed in macros to DHCP clients. 

Change macros by modifying existing options, adding options to macros, or removing options from macros. 

How to Change Values for Options in a DHCP Macro (DHCP Manager)

How to Change Values for Options in a DHCP Macro (dhtadm)

How to Add Options to a DHCP Macro (DHCP Manager)

How to Add Options to a DHCP Macro (dhtadm)

How to Delete Options From a DHCP Macro (DHCP Manager)

How to Delete Options From a DHCP Macro (dhtadm)

Delete DHCP macros. 

Remove DHCP macros that are no longer used. 

How to Delete a DHCP Macro (DHCP Manager)

How to Delete a DHCP Macro (dhtadm)

The following figure shows the Macros tab in the DHCP Manager window.

Figure 15–14 DHCP Manager's Macros Tab

Macros tab shows list of macros with one macro selected.
Option names and values contained in macro are shown. Find field and Next
button are shown.

ProcedureHow to View Macros Defined on a DHCP Server (DHCP Manager)

  1. In DHCP Manager, select the Macros tab.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

    The Macros area on the left side of the window displays, in alphabetical order, all the macros defined on the DHCP server. Macros preceded by a folder icon include references to other macros, whereas macros preceded by a document icon do not reference other macros.

  2. To open a macro folder, click the handle icon to the left of the folder icon.

    The macros that are included in the selected macro are listed.

  3. To view the content of a macro, click the macro name.

    Options and their assigned values are displayed.

ProcedureHow to View Macros Defined on a DHCP Server (dhtadm)

  1. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Display the macros by typing the following command:


    # dhtadm -P
    

    This command prints to standard output the formatted contents of the dhcptab table, including all macros and symbols defined on the DHCP server.

Modifying DHCP Macros

You might need to modify macros when some aspect of your network changes and one or more DHCP clients need to know about the change. For example, you might add a router or an NIS server, create a new subnet, or change the lease policy.

Before you modify a macro, determine the name of the DHCP option you want to change, add, or delete. The standard DHCP options are listed in the DHCP Manager help and in the dhcp_inittab(4) man page.

You can use the dhtadm -M -m command or DHCP Manager to modify macros. See the dhtadm(1M) man page for more information about dhtadm.

The following figure shows DHCP Manager's Macro Properties dialog box.

Figure 15–15 Macro Properties Dialog Box in DHCP Manager

Dialog box shows list of options and their values. Shows
Select, Add, Modify, up and down, and Delete buttons. Shows check box to notify
server.

ProcedureHow to Change Values for Options in a DHCP Macro (DHCP Manager)

  1. In DHCP Manager, select the Macros tab.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

  2. Select the macro that you want to change.

  3. Choose Properties from the Edit menu.

    The Macro Properties dialog box opens.

  4. In the table of Options, select the option that you want to change.

    The option's name and its value are displayed in the Option Name and Option Value fields.

  5. In the Option Value field, select the old value and type the new value for the option.

  6. Click Modify.

    The new value is displayed in the options table.

  7. Select Notify DHCP Server of Change.

    This selection tells the DHCP server to reread the dhcptab table to put the change into effect immediately after you click OK.

  8. Click OK.

ProcedureHow to Change Values for Options in a DHCP Macro (dhtadm)

  1. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Change option values by typing a command of the following format:


    # dhtadm -M -m macroname -e 'option=value:option=value' -g
    

    For example, to change the lease time and the Universal Time Offset in the macro bluenote, you would type:

    # dhtadm -M -m bluenote -e 'LeaseTim=43200:UTCOffst=28800' -g

ProcedureHow to Add Options to a DHCP Macro (DHCP Manager)

  1. In DHCP Manager, select the Macros tab.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

  2. Select the macro that you want to change.

  3. Choose Properties from the Edit menu.

    The Macro Properties dialog box opens.

  4. In the Option Name field, specify the name of an option by using one of the following methods:

    • Click the Select button next to the Option Name field to select an option to add to the macro.

      The Select Option dialog box displays an alphabetized list of names of standard category options and descriptions. If you want to add an option that is not in the standard category, use the Category list to select a category.

      See About DHCP Macros for more information about macro categories.

    • Type Include if you want to include a reference to an existing macro in the new macro.

  5. Type the value for the option in the Option Value field.

    If you typed Include as the option name, you must specify the name of an existing macro in the Option Value field.

  6. Click Add.

    The option is added to the bottom of the list of options in this macro. To change the option's position in the macro, select the option and click the arrow buttons to move the option up or down in the list.

  7. Select Notify DHCP Server of Change.

    This selection tells the DHCP server to reread the dhcptab table to put the change into effect immediately after you click OK.

  8. Click OK.

ProcedureHow to Add Options to a DHCP Macro (dhtadm)

  1. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Add options to a macro by typing a command of the following format:


    # dhtadm -M -m macroname -e 'option=value' -g
    

    For example, to add the ability to negotiate leases in the macro bluenote, you would type the following command:

    # dhtadm -M -m bluenote -e 'LeaseNeg=_NULL_VALUE' -g

    Note that if an option does not require a value, you must use _NULL_VALUE as the value for the option.

ProcedureHow to Delete Options From a DHCP Macro (DHCP Manager)

  1. In DHCP Manager, select the Macros tab.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

  2. Select the macro that you want to change.

  3. Choose Properties from the Edit menu.

    The Macro Properties dialog box opens.

  4. Select the option that you want to remove from the macro.

  5. Click Delete.

    The option is removed from the list of options for this macro.

  6. Select Notify DHCP Server of Change.

    This selection tells the DHCP server to reread the dhcptab table to put the change into effect immediately after you click OK.

  7. Click OK.

ProcedureHow to Delete Options From a DHCP Macro (dhtadm)

  1. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Delete an option from a macro by typing a command of the following format:


    # dhtadm -M -m macroname -e 'option=' -g
    

    For example, to remove the ability to negotiate leases in the macro bluenote, you would type the following command:

    # dhtadm -M -m bluenote -e 'LeaseNeg=' -g

    If an option is specified with no value, the option is removed from the macro.

Creating DHCP Macros

You might want to add new macros to your DHCP service to support clients with specific needs. You can use the dhtadm -A -m command or DHCP Manager's Create Macro dialog box to add macros. See the dhtadm(1M) man page for more information about the dhtadm command.

The following figure shows DHCP Manager's Create Macro dialog box.

Figure 15–16 Create Macro Dialog Box in DHCP Manager

Dialog box shows Name, Option Name, and Option Value
fields. Shows Select button, empty list of options, and check box to notify
the DHCP server.

ProcedureHow to Create a DHCP Macro (DHCP Manager)

  1. In DHCP Manager, select the Macros tab.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

  2. Choose Create from the Edit menu.

    The Create Macro dialog box opens.

  3. Type a unique name for the macro.

    The name can be up to 128 alphanumeric characters. If you use a name that matches a vendor class identifier, network address, or client ID, the macro is processed automatically for appropriate clients. If you use a different name, the macro is not processed automatically. The macro must be assigned to a specific IP address or included in another macro that is processed automatically. See Macro Processing by the DHCP Server for more detailed information.

  4. Click the Select button, which is next to the Option Name field.

    The Select Option dialog box displays an alphabetized list of names of standard category options and their descriptions. If you want to add an option that is not in the standard category, use the Category list. Select the category that you want from the Category list. See About DHCP Options for more information about option categories.

  5. Select the option to add to the macro, and click OK.

    The Macro Properties dialog box displays the selected option in the Option Name field.

  6. Type the value for the option in the Option Value field, and click Add.

    The option is added to the bottom of the list of options in this macro. To change the option's position in the macro, select the option and click the arrow buttons to move the option up or down in the list.

  7. Repeat Step 5 and Step 6 for each option you want to add to the macro.

  8. Select Notify DHCP Server of Change when you are finished adding options.

    This selection tells the DHCP server to reread the dhcptab table to put the change into effect immediately after you click OK.

  9. Click OK.

ProcedureHow to Create a DHCP Macro (dhtadm)

  1. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Create a macro by typing a command of the following format:


    # dhtadm -A -m macroname -d ':option=value:option=value:option=value:' -g
    

    There is no limit to the number of option=value pairs that can be included in the argument to -d. The argument must begin and end with colons, with colons between each option=value pair. The complete string must be enclosed in quotation marks.

    For example, to create the macro bluenote, type the following command:

    # dhtadm -A -m bluenote -d ':Router=10.63.6.121\
    :LeaseNeg=_NULL_VALUE:DNSserv=10.63.28.12:' -g
    

    Note that if an option does not require a value, you must use _NULL_VALUE as the value for the option.

Deleting DHCP Macros

You might want to delete a macro from the DHCP service. For example, if you delete a network from the DHCP service, you can also delete the associated network macro.

You can use the dhtadm -D -m command or DHCP Manager to delete macros.

ProcedureHow to Delete a DHCP Macro (DHCP Manager)

  1. In DHCP Manager, select the Macros tab.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

  2. Select the macro to delete.

    The Delete Macro dialog box prompts you to confirm that you want to delete the specified macro.

  3. Select Notify DHCP Server of Change.

    This selection tells the DHCP server to reread the dhcptab table to put the change into effect immediately after you click OK.

  4. Click OK.

ProcedureHow to Delete a DHCP Macro (dhtadm)

  1. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Delete a macro by typing a command of the following format:


    # dhtadm -D -m macroname -g
    

    For example, to delete the macro bluenote, you would type the following command:

    # dhtadm -D -m bluenote -g

Working With DHCP Options (Task Map)

Options are keywords for network configuration parameters that the DHCP server can pass to clients. In the Oracle Solaris DHCP service, you cannot create, delete, or modify the standard DHCP options. The standard options are defined by the DHCP protocol, so the options cannot change. You can only perform tasks on options that you create for your site. For this reason, when you first set up your DHCP service, the Options tab in DHCP Manager is empty until you create options for your site.

If you create options on the DHCP server, you must also add information about the options on the DHCP client. For the Oracle Solaris DHCP client, you must edit the /etc/dhcp/inittab file to add entries for the new options. See the dhcp_inittab(4) man page for more information about this file.

If you have DHCP clients that are not Oracle Solaris clients, refer to the documentation for those clients for information about adding options or symbols. See About DHCP Options for more information about options in Oracle Solaris DHCP.

You can use either DHCP Manager or the dhtadm command to create, modify, or delete options.


Tip –

Options are called symbols in the DHCP literature. The dhtadm command and its related man page also refer to options as symbols.


The following task map lists tasks that you must perform to create, modify, and delete DHCP options. The task map contains links to procedures for the tasks.

Task 

Description 

For Instructions 

Create DHCP options. 

Add new options for information not covered by a standard DHCP option. 

How to Create DHCP Options (DHCP Manager)

How to Create DHCP Options (dhtadm)

Modifying the Oracle Solaris DHCP Client's Option Information

Modify DHCP options. 

Change properties of DHCP options you have created. 

How to Modify DHCP Option Properties (DHCP Manager)

How to Modify DHCP Option Properties (dhtadm)

Delete DHCP options. 

Remove DHCP options that you have created. 

How to Delete DHCP Options (DHCP Manager)

How to Delete DHCP Options (dhtadm)

Before you create DHCP options, you should be familiar with the option properties listed in the following table.

Table 15–5 DHCP Option Properties

Option Property 

Description 

Category 

The category of an option must be one of the following:

  • Vendor – Options specific to a client's vendor platform, either hardware or software.

  • Site – Options specific to your site.

  • Extend – Newer options that have been added to the DHCP protocol, but not yet implemented as standard options in Oracle Solaris DHCP.

Code 

The code is a unique number that you assign to an option. The same code cannot be used for any other option within its option category. The code must be appropriate for the option category:

  • Vendor – Code values of 1–254 for each vendor class

  • Site – Code values of 128–254

  • Extend – Code values of 77–127

Data type 

The data type specifies what kind of data can be assigned as a value for the option. The valid data types are described in the following list.

  • ASCII – Text string value.

  • BOOLEAN – No value is associated with the Boolean data type. The presence of the option indicates that a condition is true, while the absence of the option indicates that a condition is false. For example, the Hostname option is Boolean. The presence of Hostname in a macro causes the DHCP server to look up the host name associated with the assigned address.

  • IP – One or more IP addresses, in dotted decimal format (xxx.xxx.xxx.xxx).

  • OCTET – Uninterpreted ASCII representation of binary data. For example, a client ID uses the octet data type. Valid characters are 0–9, A–F, and a–f. Two ASCII characters are needed to represent an 8-bit quantity.

  • UNUMBER8, UNUMBER16, UNUMBER32, UNUMBER64, SNUMBER8, SNUMBER16, SNUMBER32, or SNUMBER64 – Numeric value. An initial U or S indicates whether the number is unsigned or signed. The digits at the end indicate how many bits are in the number.

Granularity 

The granularity specifies how many “instances” of the data type are needed to represent a complete option value. For example, a data type of IP and a granularity of 2 would mean that the option value must contain two IP addresses.

Maximum 

The maximum number of values that can be specified for the option. For example, suppose the maximum is 2, the granularity is 2, and the data type is IP. In this case, the option value could contain a maximum of two pairs of IP addresses. 

Vendor client classes 

This option is available only when the option category is Vendor. Vendor client classes identify the client classes with which the Vendor option is associated. The class is an ASCII string that represents the client machine type or operating system. For example, the class string for some models of Sun workstations is SUNW.Sun-Blade-100. This type of option enables you to define configuration parameters that are passed to all clients of the same class, and only clients of that class.

You can specify multiple client classes. Only those DHCP clients with a client class value that matches a class that you specify receive the options scoped by that class. 

The client class is determined by the vendor of the DHCP client. For DHCP clients that are not Oracle Solaris clients, refer to the vendor documentation for the DHCP client for the client class. 

For Oracle Solaris clients, the Vendor client class can be obtained by typing the uname -i command on the client. To specify the Vendor client class, substitute periods for any commas in the string returned by the uname command. For example, if the string SUNW,Sun-Blade-100 is returned by the uname -i command, you should specify the Vendor client class as SUNW.Sun-Blade-100.

Creating DHCP Options

If you need to pass client information for which there is not already an existing option in the DHCP protocol, you can create an option. See the dhcp_inittab(4) man page for a list of all the options that are defined in Oracle Solaris DHCP before you create your own option.

You can use the dhtadm -A -s command or DHCP Manager's Create Option dialog box to create new options.

The following figure shows DHCP Manager's Create Option dialog box.

Figure 15–17 Create Option Dialog Box in DHCP Manager

Dialog box shows fields that define properties of a new
option. Shows Vendor Client Classes area and Notify DHCP server check box.

ProcedureHow to Create DHCP Options (DHCP Manager)

  1. In DHCP Manager, select the Options tab.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

  2. Choose Create from the Edit menu.

    The Create Options dialog box opens.

  3. Type a short descriptive name for the new option.

    The name can contain up to 128 alphanumeric characters and spaces.

  4. Type or select values for each setting in the dialog box.

    Refer to Table 15–5 for information about each setting, or view the DHCP Manager help.

  5. Select Notify DHCP Server of Change if you are finished creating options.

    This selection tells the DHCP server to reread the dhcptab table to put the change into effect immediately after you click OK.

  6. Click OK.

    You can now add the option to macros, and assign a value to the option to pass to clients.

ProcedureHow to Create DHCP Options (dhtadm)

  1. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Create a DHCP option by typing a command using the following format:


    # dhtadm -A -s option-name -d 'category,code,data-type,granularity,maximum' -g
    
    option-name

    Is an alphanumeric string of 128 characters of less.

    category

    Is one of the following: Site, Extend, or Vendor=list-of-classes. list-of-classes is a space-separated list of vendor client classes to which the option applies. See Table 15–5 for information about how to determine the vendor client class.

    code

    Is a numeric value that is appropriate to the option category, as explained in Table 15–5.

    data-type

    Is specified by a keyword that indicates the type of data that is passed with the option, as explained in Table 15–5.

    granularity

    Is specified as a nonnegative number, as explained in Table 15–5.

    maximum

    Is a nonnegative number, as explained in Table 15–5.


Example 15–3 Creating a DHCP Option With dhtadm

The following command would create an option called NewOpt, which is a Site category option. The option's code is 130. The option's value can be set to a single 8-bit unsigned integer.

# dhtadm -A -s NewOpt -d 'Site,130,UNUMBER8,1,1' -g

The following command would create an option called NewServ, which is a Vendor category option that applies to clients whose machine type is SUNW,Sun-Blade-100 or SUNW,Sun-Blade-1000. The option's code is 200. The option's value can be set to one IP address.

# dhtadm -A -s NewServ -d 'Vendor=SUNW.Sun-Blade-100 \ 
SUNW.Sun-Blade-1000,200,IP,1,1' -g

Modifying DHCP Options

If you have created options for your DHCP service, you can change the properties for these options. You can use the dhtadm -M -s command or DHCP Manager's Option Properties dialog box to modify options.

Note that you should modify the Oracle Solaris DHCP client's option information to reflect the same modification that you make to the DHCP service. See Modifying the Oracle Solaris DHCP Client's Option Information.

The following figure shows DHCP Manager's Option Properties dialog box.

Figure 15–18 Option Properties Dialog Box in DHCP Manager

Dialog box shows current properties of selected option.
Shows Vendor Client Classes and Notify DHCP server check box.

ProcedureHow to Modify DHCP Option Properties (DHCP Manager)

  1. In DHCP Manager, select the Options tab.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

  2. Select the option that you want to modify.

  3. Choose Properties from the Edit menu.

    The Option Properties dialog box opens.

  4. Edit the properties as needed.

    See Table 15–5 for information about the properties, or view the DHCP Manager help.

  5. Select Notify DHCP Server of Change when you are finished with options.

    The change is made to the dhcptab table. The DHCP server is signaled to reread the dhcptab table to put the changes into effect.

  6. Click OK.

ProcedureHow to Modify DHCP Option Properties (dhtadm)

  1. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Modify an option by typing a command using the following format:


    # dhtadm -M -s option-name -d 'category,code,data-type,granularity,maximum' -g
    
    option-name

    Specifies the name of the option that you want to change.

    category

    Can be Site, Extend, or Vendor=list-of-classes. list-of-classes is a space-separated list of vendor client classes to which the option applies. For example, SUNW.Sun-Blade-100 SUNW.Ultra-80 SUNWi86pc.

    code

    Specifies a numeric value that is appropriate to the option category, as explained in Table 15–5.

    data-type

    Specifies a keyword that indicates the type of data that is passed with the option, as explained in Table 15–5.

    granularity

    Is a nonnegative number, as explained in Table 15–5.

    maximum

    Is a nonnegative number, as explained in as explained in Table 15–5.

    Note that you must specify all of the DHCP option properties with the -d switch, not just the properties that you want to change.


Example 15–4 Modifying a DHCP Option With dhtadm

The following command would modify an option called NewOpt. The option is a Site category option. The option's code is 135. The option's value can be set to a single 8-bit unsigned integer.

# dhtadm -M -s NewOpt -d 'Site,135,UNUMBER8,1,1'

The following command would modify an option called NewServ, which is a Vendor category option. The option now applies to clients whose machine type is SUNW,Sun-Blade-100 or SUNW,i86pc. The option's code is 200. The option's value can be set to one IP address.

# dhtadm -M -s NewServ -d 'Vendor=SUNW.Sun-Blade-100 \
SUNW.i86pc,200,IP,1,1' -g

Deleting DHCP Options

You cannot delete standard DHCP options. However, if you have defined options for your DHCP service, you can delete these options by using DHCP Manager or the dhtadm command.

ProcedureHow to Delete DHCP Options (DHCP Manager)

  1. In DHCP Manager, select the Options tab.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

  2. Select the option that you want to delete.

  3. Choose Delete from the Edit menu.

    The Delete Option dialog box opens.

  4. Select Notify DHCP Server of Change if you are finished deleting options.

    This selection tells the DHCP server to reread the dhcptab table to put the change into effect immediately after you click OK.

  5. Click OK.

ProcedureHow to Delete DHCP Options (dhtadm)

  1. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Delete a DHCP option by typing a command using the following format:


    # dhtadm -D -s option-name -g
    

Modifying the Oracle Solaris DHCP Client's Option Information

If you add a new DHCP option to your DHCP server, you must add a complementary entry to each DHCP client's option information. If you have a DHCP client that is not a Oracle Solaris DHCP client, refer to that client's documentation for information about adding options or symbols.

On an Oracle Solaris DHCP client, you must edit the /etc/dhcp/inittab file and add an entry for each option that you add to the DHCP server. If you later modify the option on the server, you must also modify the entry in the client's /etc/dhcp/inittab file.

Refer to the dhcp_inittab(4) man page for detailed information about the syntax of the /etc/dhcp/inittab file.


Note –

If you added DHCP options to the dhcptags file in a previous Oracle Solaris release, you must add the options to the /etc/dhcp/inittab file. See DHCP Option Information for more information.


Supporting Oracle Solaris Network Installation With the DHCP Service

You can use DHCP to install Oracle Solaris on certain client systems on your network. Only sun4u-based systems and x86 systems that meet the hardware requirements for running Oracle Solaris can use this feature. For information about using DHCP to automatically configure client systems for the network as they boot, see Chapter 2, Preconfiguring System Configuration Information (Tasks), in Oracle Solaris 10 9/10 Installation Guide: Network-Based Installations.

DHCP also supports Oracle Solaris client systems that boot and install remotely from servers across a wide area network (WAN) using HTTP. This method of remote booting and installing is called the WAN boot installation method. Using WAN boot, you can install Oracle Solaris on SPARC based systems over a large public network where the network infrastructure might be untrustworthy. You can use WAN boot with security features to protect data confidentiality and installation image integrity.

Before you can use DHCP for booting and installing client systems remotely using WAN boot, the DHCP server must be configured to supply the following information to clients:

For details about configuring the DHCP server to provide this information, see Chapter 2, Preconfiguring System Configuration Information (Tasks), in Oracle Solaris 10 9/10 Installation Guide: Network-Based Installations. For information about booting and installing client systems with a DHCP server across a WAN, see Chapter 10, WAN Boot (Overview), in Oracle Solaris 10 9/10 Installation Guide: Network-Based Installations.

For information about supporting diskless clients, see Supporting Remote Boot and Diskless Boot Clients (Task Map).

Supporting Remote Boot and Diskless Boot Clients (Task Map)

The Oracle Solaris DHCP service can support Oracle Solaris client systems that mount their operating system files remotely from another machine (the OS server). Such clients are often called diskless clients. Diskless clients can be thought of as persistent remote boot clients. Each time a diskless client boots, the client must obtain the name and IP address of the server that hosts the client's operating system files. The diskless client can then boot remotely from those files.

Each diskless client has its own root partition on the OS server, which is shared to the client host name. The DHCP server must always return the same IP address to a diskless client. That address must remain mapped to the same host name in the name service, such as DNS. When a diskless client receives a consistent IP address, the client uses a consistent host name, and can access its root partition on the OS server.

In addition to providing the IP address and host name, the DHCP server can supply the location of the diskless client's operating system files. However, you must create options and macros to pass the information in a DHCP message packet.

The following task map lists the tasks required to support diskless clients or any other persistent remote boot clients. The task map also provides links to procedures to help you carry out the tasks.

Task 

Description 

For Instructions 

Set up OS services on an Oracle Solaris server. 

Use the smosservice command to create operating system files for clients.

Chapter 7, Managing Diskless Clients (Tasks), in System Administration Guide: Basic Administration

Also, see the smosservice(1M) man page.

Set up the DHCP service to support network boot clients. 

Use DHCP Manager or the dhtadm command to create new Vendor options and macros, which the DHCP server can use to pass booting information to the clients.

If you already created the options for network install clients, you need only to create macros for the Vendor client types of the diskless clients. 

Chapter 2, Preconfiguring System Configuration Information (Tasks), in Oracle Solaris 10 9/10 Installation Guide: Network-Based Installations

Assign reserved IP addresses to the diskless clients. 

Use DHCP Manager to mark address as reserved, or use the pntadm command to mark addresses as MANUAL for diskless clients.

Assigning a Reserved IP Address to a DHCP Client

Set up diskless clients for OS service. 

Use the smdiskless command to add operating system support on the OS server for each client. Specify the IP addresses that you reserved for each client.

Chapter 7, Managing Diskless Clients (Tasks), in System Administration Guide: Basic Administration

Also, see the smdiskless(1M) man page.

Setting Up DHCP Clients to Receive Information Only (Task Map)

In some networks, you might want the DHCP service to provide only configuration information to clients. Client systems that need information, not leases, can use the DHCP client to issue an INFORM message. The INFORM message asks the DHCP server to send the appropriate configuration information to the client.

You can set up the Oracle Solaris DHCP server to support clients that need information only. You need to create an empty network table that corresponds to the network that is hosting the clients. The table must exist so that the DHCP server can respond to clients from that network.

The following task map lists the tasks required to support information-only clients. The task map also includes links to procedures to help you carry out the tasks.

Task 

Description 

For Instructions 

Create an empty network table. 

Use DHCP Manager or the pntadm command to create a network table for the information-only clients' network.

Adding DHCP Networks

Create macros to contain information that is needed by clients. 

Use DHCP Manager or the dhtadm command to create macros to pass the required information to clients.

Creating DHCP Macros

Have the DHCP client issue an INFORM message.

Use the ifconfig int dhcp inform command to make the DHCP client issue an INFORM message.

DHCP Client Startup

ifconfig Command Options Used With the DHCP Client

ifconfig(1M)man page

Converting to a New DHCP Data Store

Oracle Solaris DHCP provides a utility to convert the DHCP configuration data from one data store to another data store. Several reasons might exist for converting to a new data store. For example, you might have more DHCP clients, requiring higher performance or higher capacity from the DHCP service. You also might want to share the DHCP server duties among multiple servers. See Choosing the DHCP Data Store for a comparison of the relative benefits and drawbacks of each type of data store.


Note –

If you upgraded from an Oracle Solaris release that is older than the Solaris 8 7/01 release, you should read this note.

When you run any Oracle Solaris DHCP tool after Oracle Solaris installation, you are prompted to convert to the new data store. The conversion is required because the format of the data stored in both files and NIS+ changed in the Solaris 8 7/01 release. If you do not convert to the new data store, the DHCP server continues to read the old data tables. However, the server can only extend leases for existing clients. You cannot register new DHCP clients or use DHCP management tools with the old data tables.


The conversion utility is also useful for sites that are converting from a Sun provided data store to a third-party data store. The conversion utility looks up entries in the existing data store and adds new entries that contain the same data to the new data store. Data store access is implemented in separate modules for each data store. This modular approach enables the conversion utility to convert DHCP data from any data store format to any other data store format. Each data store must have a module that the DHCP service can use. See Solaris DHCP Service Developer’s Guide for more information about how to write a module to support a third-party data store.

The data store conversion can be accomplished with DHCP Manager through the Data Store Conversion wizard, or with the dhcpconfig -C command.

The initial dialog box of the Data Store Conversion wizard is shown in the following figure.

Figure 15–19 Data Store Conversion Wizard Dialog Box in DHCP Manager

Dialog box lists steps to convert to a new data store.
Shows new data store options. Shows back and forward, Cancel, and Help buttons.

Before the conversion begins, you must specify whether to save the old data store's tables (dhcptab and network tables). The conversion utility then stops the DHCP server, converts the data store, and restarts the server when the conversion has completed successfully. If you did not specify to save the old tables, the utility deletes the tables after determining the conversion is successful. The process of converting can be time-consuming. The conversion runs in the background with a meter to inform you of its progress.

ProcedureHow to Convert the DHCP Data Store (DHCP Manager)

  1. In DHCP Manager, choose Convert Data Store from the Service menu.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

    The Data Store Conversion wizard opens.

  2. Answer the wizard's prompts.

    If you have trouble providing the requested information, click Help to view detailed information about each dialog box.

  3. Review your selections, and then click Finish to convert the data store.

    The DHCP server restarts when the conversion is complete. The server immediately uses the new data store.

ProcedureHow to Convert the DHCP Data Store (dhcpconfig -C)

  1. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Convert the data store by typing a command of the following format:


    # /usr/sbin/dhcpconfig -C -r resource -p path
    
    resource

    is the new data store type, such as SUNWbinfiles

    path

    is the path to the data, such as /var/dhcp

    Note that if you want to keep the original data in the old data store after the conversion, specify the -k option. For example, to convert your data store to SUNWbinfiles and save the old data store, you would type:


    # /usr/sbin/dhcpconfig -C -r SUNWbinfiles -p /var/dhcp -k

    See the dhcpconfig(1M) man page for more information about the dhcpconfig utility.

Moving Configuration Data Between DHCP Servers (Task Map)

DHCP Manager and the dhcpconfig utility enable you to move some or all the DHCP configuration data from one Oracle Solaris DHCP server to another server. You can move entire networks and all the IP addresses, macros, and options associated with the networks. Alternatively, you can select specific IP addresses, macros, and options to move. You can also copy macros and options without removing the macros and options from the first server.

You might want to move data if you are going to do any of the following tasks:

The following task map identifies the procedures that you must perform when you move DHCP configuration data. The map includes links to procedures to perform the tasks.

Task 

Description 

For Instructions 

1. Export the data from the first server. 

Select the data that you want to move to another server, and create a file of exported data. 

How to Export Data From a DHCP Server (DHCP Manager)

How to Export Data From a DHCP Server (dhcpconfig -X)

2. Import the data to the second server. 

Copy exported data to another DHCP server's data store. 

How to Import Data on a DHCP Server (DHCP Manager)

How to Import Data on a DHCP Server (dhcpconfig -I)

3. Modify the imported data for the new server environment. 

Change server-specific configuration data to match the new server's information. 

How to Modify Imported DHCP Data (DHCP Manager)

How to Modify Imported DHCP Data (pntadm, dhtadm)

In DHCP Manager, you use the Export Data wizard and the Import Data wizard to move the data from one server to the other server. You then modify macros in the Macros tab. The following figures show the initial dialog boxes for the wizards.

Figure 15–20 Export Data Wizard Dialog Box in DHCP Manager

Dialog box lists steps to export data to a file. Shows
two lists of networks, titled Do Not Export and Export. Shows arrow buttons
between the lists.

Figure 15–21 Import Data Wizard Dialog Box in DHCP Manager

Dialog box lists steps to import data from a file. Shows
Import File field and Overwrite existing data check box.

ProcedureHow to Export Data From a DHCP Server (DHCP Manager)

  1. Start DHCP Manager on the server from which you want to move or copy data.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

  2. Choose Export Data from the Service menu.

    The Export Data wizard opens as shown in Figure 15–20.

  3. Answer the wizard's prompts.

    If you have difficulty, click Help for detailed information about the prompts.

  4. Move the export file to a file system that is accessible to the DHCP server that must import the data.

See Also

Import the data as described in How to Import Data on a DHCP Server (DHCP Manager).

ProcedureHow to Export Data From a DHCP Server (dhcpconfig -X)

  1. Log in to the server from which you want to move or copy data.

  2. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  3. Export the data.

    You can export all of the DHCP data, or specific parts of the data.

    • To export specific addresses, macros, and options, type a command that uses the following format:


      # dhcpconfig -X filename -a network-addresses -m macros -o options
      

      filename is the full path name that you want to use to store the compressed exported data. You specify particular network addresses, DHCP macros, and DHCP options in comma-separated lists. The following example shows how to export specific networks, macros, and options.

      # dhcpconfig -X /var/dhcp/0dhcp1065_data \
      -a 10.63.0.0,10.62.0.0 \
      -m 10.63.0.0,10.62.0.0,SUNW.Sun-Blade-100 -o Sterm
      
    • To export all DHCP data, type a command that uses the ALL keyword.


      # dhcpconfig -X filename -a ALL -m ALL -o ALL
      

      filename is the full path name that you want to use to store the compressed exported data. The keyword ALL can be used with the command options to export all the network addresses, macros, or options. The following example shows how to use the ALL keyword.

      # dhcpconfig -X /var/dhcp/dhcp1065_data -a ALL -m ALL -o ALL
      

    Tip –

    You can omit the export of a particular kind of data by not specifying the dhcpconfig command option for that type of data. For example, if you do not specify the -m option, no DHCP macros are exported.


    See the dhcpconfig(1M) man page for more information about the dhcpconfig command.

  4. Move the export file to a location that is accessible to the server that must import the data.

See Also

Import the data as described in How to Import Data on a DHCP Server (dhcpconfig -I).

ProcedureHow to Import Data on a DHCP Server (DHCP Manager)

  1. Start DHCP Manager on the server to which you want to move data that you previously exported from a DHCP server.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

  2. Choose Import Data from the Service menu.

    The Import Data wizard opens, as shown in Figure 15–21.

  3. Answer the wizard's prompts.

    If you have difficulty, click Help for detailed information about the prompts.

  4. Modify the imported data, if necessary.

    See How to Modify Imported DHCP Data (DHCP Manager)

ProcedureHow to Import Data on a DHCP Server (dhcpconfig -I)

  1. Log in to the server to which you want to import the data.

  2. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  3. Import the data by typing a command of the following format:


    # dhcpconfig -I filename
    

    filename is the name of the file that contains the exported data.

  4. Modify the imported data, if necessary.

    See How to Modify Imported DHCP Data (pntadm, dhtadm).

ProcedureHow to Modify Imported DHCP Data (DHCP Manager)

  1. Start DHCP Manager on the server to which you imported data.

    See How to Start and Stop DHCP Manager for information about DHCP Manager.

  2. Examine imported data for network-specific information that needs modification.

    For example, if you moved networks, you must open the Addresses tab and change the owning server of addresses in the imported networks. You might also need to open the Macros tab to specify the correct domain names for NIS, NIS+ or DNS in some macros.

  3. Open the Addresses, tab and select a network that you imported.

  4. To select all the addresses, click the first address, press and hold the Shift key, and click the last address.

  5. From the Edit menu, choose Properties.

    The Modify Multiple Addresses dialog box opens.

  6. At the Managing Server prompt, select the new server's name.

  7. At the Configuration Macro prompt, select the macro that should be used for all clients on this network, and then click OK.

  8. Open the Macros tab.

  9. Use the Find button to locate the options that are likely to need modified values.

    The Find button is located at the bottom of the window.

    DNSdmain, DNSserv, NISservs, NIS+serv, and NISdmain are examples of options that might need modification on the new server.

  10. Change the options in the appropriate macros.

    See How to Modify DHCP Option Properties (DHCP Manager) for the procedure for changing options.

ProcedureHow to Modify Imported DHCP Data (pntadm, dhtadm)

  1. Log in to the server to which you imported data.

  2. Become superuser or assume a role or user name that is assigned to the DHCP Management profile.

    For more information about the DHCP Management profile, see Setting Up User Access to DHCP Commands.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  3. Examine the network tables for data that needs to be modified.

    If you moved networks, use the pntadm -P network-address command to print out the network tables for the networks you moved.

  4. Modify IP address information by using the pntadm command.

    You might need to change the owning server and the configuration macro for imported addresses. For example, to change the owning server (10.60.3.4) and macro (dhcpsrv-1060) for address 10.63.0.2, you would use the following command:

    pntadm -M 10.63.0.2 -s 10.60.3.4 -m dhcpsrv-1060 10.60.0.0

    If you have a large number of addresses, you should create a script file that contains commands to modify each address. Execute the script with the pntadm -B command, which runs pntadm in batch mode. See the pntadm(1M) man page.

  5. Examine the dhcptab macros for options with values that need modification.

    Use the dhtadm -P command to print the entire dhcptab table to your screen. Use grep or some other tool to search for options or values that you might want to change.

  6. Modify options in macros, if necessary, by using the dhtadm -M command.

    For example, you might need to modify some macros to specify the correct domain names and servers for NIS, NIS+ or DNS. For example, the following command changes the values of DNSdmain and DNSserv in the macro mymacro:

    dhtadm -M -m mymacro -e 'DNSserv=dnssrv2:DNSdmain=example.net' -g

Chapter 16 Configuring and Administering the DHCP Client

This chapter discusses the Dynamic Host Configuration Protocol (DHCP) client that is part of Oracle Solaris. The chapter explains how the client's DHCPv4 and DHCPv6 protocols work, and how you can affect the behavior of the client.

One protocol, DHCPv4, has long been part of Oracle Solaris, and enables DHCP servers to pass configuration parameters such as IPv4 network addresses to IPv4 nodes.

The other protocol, DHCPv6, enables DHCP servers to pass configuration parameters such as IPv6 network addresses to IPv6 nodes. DHCPv6 is a stateful counterpart to “IPv6 Stateless Address Autoconfiguration” (RFC 2462), and can be used separately or concurrently with the stateless to obtain configuration parameters.

This chapter contains the following information:

About the Oracle Solaris DHCP Client

The Oracle Solaris DHCP client is the dhcpagent daemon, part of Oracle Solaris. When you install Oracle Solaris, you are prompted to use DHCP to configure network interfaces. If you specify Yes for DHCPv4, then that protocol is enabled on your system during Oracle Solaris installation. There are no install time options specifically for DHCPv6. A related question, though, is about IPv6. If you enable IPv6, then DHCPv6 is also enabled on a local network that supports DHCPv6.

You do not need to do anything else with the Oracle Solaris client to use DHCP. The DHCP server's configuration determines what information is given to DHCP client systems that use the DHCP service.

If a client system is already running Oracle Solaris, but not using DHCP, you can reconfigure the client system to use DHCP. You can also reconfigure a DHCP client system so that it stops using DHCP and uses static network information that you provide. See Enabling and Disabling an Oracle Solaris DHCP Client for more information.

DHCPv6 Server

There is no DHCPv6 server available through Sun Microsystems for Oracle Solaris. Servers available from third parties are compatible with Sun's DHCPv6, and if there is a DHCPv6 server on the network, Sun's DHCPv6 client will use it.

See Oracle Solaris DHCP Serverfor information on the Sun DHCPv4 server.

Differences Between DHCPv4 and DHCPv6

The two major differences between DHCPv4 and DHCPv6 are the following:

The Administrative Model

DHCPv4 requires explicit client configuration. You must set up the DHCPv4 system for addressing when desired, and this is typically done during initial system installation or dynamically through the use of ifconfig(1M) options.

DHCPv6 does not require explicit client configuration. Instead, using DHCP is a property of the network, and the signal to use it is carried in Router Advertisement messages from local routers. The DHCP client automatically creates and destroys logical interfaces as needed.

The DHCPv6 mechanism is very similar administratively to the existing IPv6 stateless (automatic) address configuration. For stateless address configuration, you would set a flag on the local router to indicate that, for a given set of prefixes, each client should automatically configure an address on its own by using the advertised prefix plus a local interface token or random number. For DHCPv6, the same prefixes are required, but the addresses are acquired and managed through a DHCPv6 server instead of being assigned “randomly.”

MAC Address and Client ID

DHCPv4 uses the MAC address and an optional Client ID to identify the client for purposes of assigning an address. Each time the same client arrives on the network, it gets the same address, if possible.

DHCPv6 uses basically the same scheme, but makes the Client ID mandatory and imposes structure on it. The Client ID in DHCPv6 consists of two parts: a DHCP Unique Identifier (DUID) and an Identity Association Identifier (IAID). The DUID identifies the client system (rather than just an interface, as in DHCPv4), and the IAID identifies the interface on that system.

As described in RFC 3315, an identity association is the means used for a server and a client to identify, group, and manage a set of related IPv6 addresses. A client must associate at least one distinct IA with each of its network interfaces, and then uses the assigned IAs to obtain configuration information from a server for that interface. For additional information about IAs, see the next section, “Protocol Details.”

DUID+IAID can also be used with DHCPv4. These can be concatenated together unambiguously so that they can serve as the Client ID. For compatibility reasons, this is not done for regular IPv4 interfaces. However, for logical interfaces ("hme0:1"), DUID+IAID is used if no Client ID is configured.

Unlike IPv4 DHCP, DHCPv6 does not provide a “client name” option, so there is no way to name your systems based on DHCPv6 alone. Instead, if you need to know the DNS name that goes with an address provided by DHCPv6, use DNS reverse-resolution (address-to-name query via the getaddrinfo(3SOCKET) function) to find the corresponding name information. One implication of this is that if you are using only DHCPv6 and want a node to have a specific name, you must set /etc/nodename on your system.

Protocol Details

With DHCPv4, the DHCP server supplies the subnet mask to be used with the assigned address. With DHCPv6, the subnet mask (also known as “prefix length”) is assigned by the Router Advertisements, and is not controlled by the DHCP server.

DHCPv4 carries a Hostname option that is used to set the system-wide node name. DHCPv6 has no such option.

To configure a Client ID for DHCPv6 you must specify a DUID, rather than allowing the system to choose one automatically. You can do this globally for the daemon, or on a per-interface basis. Use the following format to set the global DUID (note the initial dot):

.v6.CLIENT_ID=<DUID>

To set a particular interface to use a given DUID (and make the system appear to be multiple independent clients to a DHCPv6 server):

hme0.v6.CLIENT ID=<DUID>

Each Identity Association (IA) holds one type of address. For example, an identity association for temporary addresses (IA_TA) holds temporary addresses, while an identity association for non-temporary addresses (IA_NA), carries assigned addresses that are permanent. The version of DHCPv6 described in this guide provides only IA_NA associations.

Oracle Solaris assigns exactly one IAID to each interface, on demand, and the IAID is stored in a file in the root file system so that it remains constant for the life of the machine.

Logical Interfaces

In the DHCPv4 client, each logical interface is independent and is an administrative unit. In addition to the zeroth logical interface (which defaults to the interface MAC address as an identifier), the user may configure specific logical interfaces to run DHCP by specifying a CLIENT_ID in the dhcpagent configuration file. For example:

hme0:1.CLIENT_ID=orangutan

DHCPv6 works differently. The zeroth logical interface on an IPv6 interface, unlike IPv4, is always a link-local. A link-local is used to automatically assign an IP address to a device in an IP network when there is no other assignment method available, such as a DHCP server. The zeroth logical interface cannot be under DHCP control, so although DHCPv6 is run on the zeroth logical interface (known, also, as the “physical” interface), it assigns addresses only on non-zero logical interfaces.

In response to a DHCPv6 client request, the DHCPv6 server returns a list of addresses for the client to configure.

Option Negotiation

In DHCPv6 there is an Option Request Option, which provides a hint to the server of what the client prefers to see. If all possible options were sent from the server to the client, so much information could be sent that some of it would have to be dropped on the way to the client. The server might use the hint to choose among the options to include in the reply. Alternatively, the server could ignore the hint and choose other items to include. On Oracle Solaris, for example, the preferred options might include the Oracle Solaris DNS address domain or the NIS address domain, but would probably not include the net bios server.

The same type of hint is also provided for DHCPv4, but without the special Option Request Option. Instead DHCPv4 uses the PARAM_REQUEST_LIST in /etc/default/dhcpagent.

Configuration Syntax

Configure the DHCPv6 client in much the same way as the existing DHCPv4 client, using /etc/default/dhcpagent.

The syntax is augmented with a “.v6” marker between the interface name (if any) and the parameter to be configured. For example, the global IPv4 option request list is set like this:

PARAM_REQUEST_LIST=1,3,6,12,15,28,43

An individual interface can be configured to omit the hostname option like this:

hme0.PARAM_REQUEST_LIST=1,3,6,15,28,43

To set a global request list for DHCPv6, note the leading dot:

.v6.PARAM_REQUEST_LIST=23,24

Or, to set an individual interface, follow this example:

hme0.v6.PARAM_REQUEST_LIST=21,22,23,24

For reference, here is an actual /etc/default/dhcpagent file for DHCPv6 configuration:


# The default DHCPv6 parameter request list has preference (7), unicast (12),
# DNS addresses (23), DNS search list (24), NIS addresses (27), and
# NIS domain (29).  This may be changed by altering the following parameter- 
# value pair.  The numbers correspond to the values defined in RFC 3315 and 
# the IANA dhcpv6-parameters registry. 
.v6.PARAM_REQUEST_LIST=7,12,23,24,27,29

DHCP Client Startup

In most cases, there is nothing you need to do for DHCPv6 client startup. The in.ndpd daemon starts up DHCPv6 automatically when it is needed. You might need to touch /etc/hostname6.$IFNAME to configure an interface to be plumbed for IPv6 at boot time. However, the installer already does this if you enable IPv6 on your system at install time.

For DHCPv4, however, you must request the client startup, if that was not done during Oracle Solaris installation. See How to Enable the Oracle Solaris DHCP Client.

The dhcpagent daemon obtains configuration information that is needed by other processes involved in booting the system. For this reason, the system startup scripts start dhcpagent early in the boot process and wait until the network configuration information from the DHCP server arrives.

Although the default is to run DHCPv6, you can choose to not have DHCPv6 run. After DHCPv6 starts running, you can stop it with the ifconfig command. You can also disable DHCPv6 so that it does not start on reboot, by modifying the /etc/inet/ndpd.conf file.

For example, to immediately shut down DHCPv6 on the interface named “hme0.”


ex# echo ifdefault StatefulAddrConf false >> /etc/inet/ndpd.conf  
ex# pkill -HUP -x in.ndpd   
ex# ifconfig hme0 inet6 dhcp release

The presence of the file /etc/dhcp.interface (for example, /etc/dhcp.ce0 on a Sun Fire 880 system) indicates to the startup scripts that DHCPv4 is to be used on the specified interface. Upon finding a dhcp.interface file, the startup scripts start dhcpagent.

After startup, dhcpagent waits until it receives instructions to configure a network interface. The startup scripts issue the ifconfig interface dhcp start command, which instructs dhcpagent to start DHCPv4 as described in How DHCP Works. If commands are contained within the dhcp.interface file, they are appended to the dhcp start option of ifconfig. See the ifconfig(1M) man page for more information about options used with the ifconfig interface dhcp command.

DHCPv6 Communication

Unlike DHCPv4, which is invoked by manual configuration, DHCPv6 is invoked by Router Advertisements (RAs). Depending on how the router is configured, the system automatically invokes DHCPv6 on the interface on which the Router Advertisement message was received and uses DHCP to get an address and other parameters, or the system requests only data other than an address (for example, DNS servers) with DHCPv6.

The in.ndpd daemon receives the Router Advertisement message. It does this automatically on all interfaces plumbed for IPv6 on the system. When in.ndpd sees an RA that specifies that DHCPv6 should run, it invokes it.

To prevent in.ndpd from starting up DHCPv6, you can change the /etc/inet/ndpd.conf file.

You can also stop DHCPv6 after it starts by using one of the following versions of ifconfig:

ifconfig <interface> inet6 dhcp drop

or:

ifconfig <interface> inet6 dhcp release

How DHCP Client Protocols Manage Network Configuration Information

DHCPv4 and DHCPv6 client protocols manage network configuration information in different ways. The key difference is that with DHCPv4 the negotiation is for the lease of a single address and some options to go with it. With DHCPv6, the negotiation is over a batch of addresses and a batch of options.

For background information on the interaction between DHCPv4 client and server, see Chapter 12, About Oracle Solaris DHCP (Overview).

How the DHCPv4 Client Manages Network Configuration Information

After the information packet is obtained from a DHCP server, dhcpagent configures the network interface and brings up the interface. The daemon controls the interface for the duration of the lease time for the IP address, and maintains the configuration data in an internal table. The system startup scripts use the dhcpinfo command to extract configuration option values from the internal table. The values are used to configure the system and enable it to communicate on the network.

The dhcpagent daemon waits passively until a period of time elapses, usually half the lease time. The daemon then requests an extension of the lease from a DHCP server. If the system notifies dhcpagent that the interface is down or that the IP address has changed, the daemon does not control the interface until instructed by the ifconfig command to do so. If dhcpagent finds that the interface is up and the IP address has not changed, the daemon sends a request to the server for a lease renewal. If the lease cannot be renewed, dhcpagent takes down the interface at the end of the lease time.

Each time dhcpagent performs an action related to the lease, the daemon looks for an executable file called /etc/dhcp/eventhook. If an executable file with this name is found, dhcpagent invokes the executable. See DHCP Client Event Scripts for more information about using the event executable.

How the DHCPv6 Client Manages Network Configuration Information

DHCPv6 communication between client and server begins with the client sending out a Solicit message, to locate servers. In response, all servers available for DHCP service send an Advertise message. The server message contains multiple IA_NA (Identity Association Non-Temporary Address) records plus other options (such as DNS server addresses) that the server can supply.

A client can request particular addresses (and multiples of them) by setting up its own IA_NA/IAADDR records in its Request message. A client typically requests specific addresses if it has old addresses recorded and it would like the server to provide the same ones, if possible. Regardless of what the client does (even if it requests no addresses at all), the server can supply any number of addresses to the client for a single DHCPv6 transaction.

This is a the message dialog that takes place between the clients and servers.

If the preference value in the Advertise message is 255, the DHCPv6 client immediately selects that server. If the most preferred server does not respond, or fails to give a successful Reply to the Request message, then the client continues looking for less-preferred servers (in order) until there are no more Advertise messages on hand. At that point, the client starts over by again sending Solicit messages.

The chosen server sends a Reply message containing assigned addresses and configuration parameters in response to a Solicit or Request message.

DHCP Client Shutdown

At shutdown, the client sends a Release message to the server that assigned addresses to the client, to indicate that the client will no longer use one or more of the assigned addresses. When the DHCPv4 client system shuts down normally, dhcpagent writes the current configuration information to the file /etc/dhcp/interface.dhc, or for DHCPv6, to /etc/dhcp/interface.dh6. By default, the lease is saved rather than released, so the DHCP server does not know that the IP address is not in active use, which enables the client to easily regain the address on next boot. This default action is the same as the ifconfig <interface> dhcp drop command.

If the lease in that file is still valid when the system reboots, dhcpagent sends an abbreviated request to use the same IP address and network configuration information. For DHCPv4, this is the Request message. For DHCPv6, the message is Confirm.

If the DHCP server permits this request, dhcpagent can use the information that it wrote to disk when the system shut down. If the server does not permit the client to use the information, dhcpagent initiates the DHCP protocol sequence described in How DHCP Works. As a result, the client obtains new network configuration information.

Enabling and Disabling an Oracle Solaris DHCP Client

To enable the DHCP client on a system that is already running Oracle Solaris and is not using DHCP, you must first unconfigure the system. When the system boots, you must issue some commands to set up the system and enable the DHCP client.


Note –

In many deployments it is common practice to have crucial parts of the infrastructure set up with static IP addresses, rather than using DHCP. Determining which devices on your network, for example routers and certain servers, should be client and which should not, is beyond the scope of this guide.


ProcedureHow to Enable the Oracle Solaris DHCP Client

This procedure is necessary only if DHCPv4 was not enabled during Oracle Solaris installation. It is never necessary for DHCPv6.

  1. Become superuser on the client system.

  2. If this system uses preconfiguration instead of interactive configuration, edit the sysidcfg file. Add the dhcp subkey to the network_interface keyword in the sysidcfg file.

    For example, network_interface=hme0 {dhcp}. See the sysidcfg(4) man page for more information.

  3. Unconfigure and shut down the system.


    # sys-unconfig
    

    See the sys-unconfig(1M) man page for more information about the configuration information that is removed by this command.

  4. Reboot the system after shutdown is complete.

    If the system uses preconfiguration, the dhcp subkey in the sysidcfg file configures the system to use the DHCP client as the system boots.

    If the system does not use preconfiguration, you are prompted for system configuration information by sysidtool programs when the system reboots. See the sysidtool(1M) man page for more information.

  5. When prompted to use DHCP to configure network interfaces, specify Yes.

ProcedureHow to Disable an Oracle Solaris DHCP Client

  1. Become superuser on the client system.

  2. If you used a sysidcfg file to preconfigure the system, remove the dhcp subkey from the network_interface keyword.

  3. Unconfigure and shut down the system.


    # sys-unconfig
    

    See the sys-unconfig(1M) man page for more information about the configuration information that is removed by this command.

  4. Reboot the system after shutdown is complete.

    If the system uses preconfiguration, you are not prompted for configuration information, and the DHCP client is not configured.

    If the system does not use preconfiguration, you are prompted for system configuration information by sysidtool programs when the system reboots. See the sysidtool(1M) man page for more information.

  5. When prompted to use DHCP to configure network interfaces, specify No.

DHCP Client Administration

The Oracle Solaris DHCP client software does not require administration under normal system operation. The dhcpagent daemon automatically starts when the system boots, renegotiates leases, and stops when the system shuts down. You should not manually start and stop the dhcpagent daemon directly. Instead, as superuser on the client system, you can use the ifconfig command to affect dhcpagent's management of the network interface, if necessary.

ifconfig Command Options Used With the DHCP Client

This section summarizes the command options, which are documented in the ifconfig(1M) man page. The only difference between the DHCPv4 and the DHCPv6 versions of these commands is the “inet6” keyword. Include the “inet6” keyword for DHCPv6, but leave it out when running DHCPv4.

The ifconfig command enables you to do the following:

Setting DHCP Client Configuration Parameters

The /etc/default/dhcpagent file on the client system contains tunable parameters for the dhcpagent. You can use a text editor to change several parameters that affect client operation. The /etc/default/dhcpagent file is well documented, so for more information, you should refer to the file as well as to the dhcpagent(1M) man page.

The /etc/dhcp.interface file is another location in which parameters affecting the DHCP client are set. Parameters set in this file are used by system startup scripts with the ifconfig command. This, however, affects only DHCPv4. There is no DHCPv6 equivalent.

By default, the DHCP client is configured as follows:

For DHCPv4

For DHCPv4 and DHCPv6

DHCP Client Systems With Multiple Network Interfaces

The DHCP client can simultaneously manage several different interfaces on one system. The interfaces can be physical interfaces or logical interfaces. Each interface has its own IP address and lease time. If more than one network interface is configured for DHCP, the client issues separate requests to configure them. The client maintains a separate set of network configuration parameters for each interface. Although the parameters are stored separately, some of the parameters are global in nature. The global parameters apply to the system as a whole, rather than to a particular network interface.

The host name, NIS domain name, and time zone are examples of global parameters. Global parameters usually have different values for each interface. However, only one value can be used for each global parameter associated with each system. To be sure that there is only one answer to a query for a global parameter, only the parameters for the primary network interface are used. You can insert the word primary in the /etc/dhcp.interface file for the interface that you want to be treated as the primary interface. If the primary keyword is not used, the first interface in alphabetical order is considered to be the primary interface.

The DHCP client manages leases for logical interfaces and physical interfaces identically, except for the following limitation on logical interfaces:

DHCPv4 Client Host Names

By default, the Oracle Solaris DHCPv4 client does not supply its own host name, because the client expects the DHCP server to supply the host name. The Oracle Solaris DHCPv4 server is configured to supply host names to DHCPv4 clients by default. When you use the Oracle Solaris DHCPv4 client and server together, these defaults work well. However, when you use the Oracle Solaris DHCPv4 client with some third-party DHCP servers, the client might not receive a host name from the server. If the Oracle Solaris DHCP client does not receive a host name through DHCP, the client system looks at the /etc/nodename file for a name to use as the host name. If the file is empty, the host name is set to unknown.

If the DHCP server supplies a name in the DHCP Hostname option, the client uses that host name, even if a different value is placed in the /etc/nodename file. If you want the client to use a specific host name, you can enable the client to request that name. See the following procedure.


Note –

The following procedure does not work with all DHCP servers. Through this procedure you are requiring the client to send a specific host name to the DHCP server, and to expect the same name in return.

However, the DHCP server does not have to respect this request and many do not. They simply return a different name.


ProcedureHow to Enable an Oracle Solaris DHCPv4 Client to Request a Specific Host Name

  1. On the client system, edit the /etc/default/dhcpagent file as superuser.

  2. Find the REQUEST_HOSTNAME keyword in the /etc/default/dhcpagent file and modify the keyword as follows:


    REQUEST_HOSTNAME=yes

    If a comment sign (#) is in front of REQUEST_HOSTNAME, remove the #. If the REQUEST_HOSTNAME keyword is not present, insert the keyword.

  3. Edit the /etc/hostname.interface file on the client system to add the following line:

    inet hostname
    

    hostname is the name that you want the client to use.

  4. Type the following commands to have the client perform a full DHCP negotiation upon rebooting:


    # ifconfig interface dhcp release
    # reboot
    

    The DHCP data that is cached on the client is removed. The client restarts the protocol to request new configuration information, including a new host name. The DHCP server first makes sure that the host name is not in use by another system on the network. The server then assigns the host name to the client. If configured to do so, the DHCP server can update name services with the client's host name.

    If you want to change the host name later, repeat Step 3 and Step 4.

DHCP Client Systems and Name Services

Oracle Solaris systems support the following name services: DNS, NIS, NIS+, and a local file store (/etc/inet/hosts). Each name service requires some configuration before it is usable. The name service switch configuration file (see nsswitch.conf(4)) must also be set up appropriately to indicate the name services to be used.

Before a DHCP client system can use a name service, you must configure the system as a client of the name service. By default, and unless configured otherwise during system installation, only local files are used.

The following table summarizes issues that are related to each name service and DHCP. The table includes links to documentation that can help you set up clients for each name service.

Table 16–1 Name Service Client Setup Information for DHCP Client Systems

Name Service  

Client Setup Information 

NIS 

If you are using Oracle Solaris DHCP to send Oracle Solaris network install information to a client system, you can use a configuration macro that contains the NISservs and NISdmain options. These options pass the IP addresses of NIS servers and the NIS domain name to the client. The client then automatically becomes an NIS client.

If a DHCP client system is already running Oracle Solaris, the NIS client is not automatically configured on that system when the DHCP server sends NIS information to the client. 

If the DHCP server is configured to send NIS information to the DHCP client system, you can see the values given to the client if you use the dhcpinfo command on the client as follows:

# /sbin/dhcpinfo NISdmain

# /sbin/dhcpinfo NISservs


Note –

For DHCPv6, include -v6, and different protocol keywords in the command.

# /sbin/dhcpinfo -v6 NISDomain

# /sbin/dhcpinfo -v6 NISServers


Use the values returned for the NIS domain name and NIS servers when you set up the system as an NIS client. 

You set up an NIS client for an Oracle Solaris DHCP client system in the standard way, as documented in Chapter 5, Setting Up and Configuring NIS Service, in System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP).


Tip –

You can write a script that uses dhcpinfo and ypinit to automate NIS client configuration on DHCP client systems.


NIS+ 

If the NIS+ client for a DHCP client system is set up in the conventional way, then the DHCP server might give the client different addresses from time to time. This creates security issues, because NIS+ security includes IP address as part of the configuration. To assure that your client has the same address every time, set up the NIS+ client for a DHCP client system in a nonstandard way, which is documented in Setting Up DHCP Clients as NIS+ Clients.

If the DHCP client system has been manually assigned an IP address, the client's address is always the same. You can set up the NIS+ client in the standard way, which is documented in Setting Up NIS+ Client Machines in System Administration Guide: Naming and Directory Services (NIS+).

/etc/inet/hosts

You must set up the /etc/inet/hosts file for a DHCP client system that is to use /etc/inet/hosts for its name service.

The DHCP client system's host name is added to its own /etc/inet/hosts file by the DHCP tools. However, you must manually add the host name to the /etc/inet/hosts files of other systems in the network. If the DHCP server system uses /etc/inet/hosts for name resolution, you must also manually add the client's host name on the system.

DNS 

If the DHCP client system receives the DNS domain name through DHCP, the client system's /etc/resolv.conf file is configured automatically. The /etc/nsswitch.conf file is also automatically updated to append dns to the hosts line after any other name services in the search order. See System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP) for more information about DNS.

Setting Up DHCP Clients as NIS+ Clients

You can use the NIS+ name service on Oracle Solaris systems that are DHCP clients. However, if your DHCP server can provide different addresses at different times, this partially circumvents one of the security-enhancing features of NIS+, the creation of Data Encryption Standard (DES) credentials. For the sake of security, configure the DHCP server to provide the same address all the time. When you set up an NIS+ client that is not using DHCP, you add unique DES credentials for the client to the NIS+ server. There are several ways to create credentials, such as using the nisclient script or the nisaddcred command.

NIS+ credential generation requires a client to have a static host name to create and store the credentials. If you want to use NIS+ and DHCP, you must create identical credentials to be used for all the host names of DHCP clients. In this way, no matter what IP address and associated host name that a DHCP client receives, the client can use the same DES credentials.

The following procedure shows you how to create identical credentials for all DHCP host names. This procedure is valid only if you know the host names that DHCP clients use. For example, when the DHCP server generates the host names, you know the possible host names that a client can receive.

ProcedureHow to Set Up Oracle Solaris DHCP Clients as NIS+ Clients

A DHCP client system that is to be an NIS+ client must use credentials that belong to another NIS+ client system in the NIS+ domain. This procedure only produces credentials for the system, which apply only to the superuser logged in to the system. Other users who log in to the DHCP client system must have their own unique credentials in the NIS+ server. These credentials are created according to a procedure in the System Administration Guide: Naming and Directory Services (NIS+).

  1. Create the credentials for a client by typing the following command on the NIS+ server:


    # nisgrep nisplus-client-name cred.org_dir > /tmp/file
    

    This command writes the cred.org_dir table entry for the NIS+ client to a temporary file.

  2. Use the cat command to view the contents of the temporary file.

    Or, use a text editor.

  3. Copy the credentials to use for DHCP clients.

    You must copy the public key and private key, which are long strings of numbers and letters separated by colons. The credentials are to be pasted into the command issued in the next step.

  4. Add credentials for a DHCP client by typing the following command:


    # nistbladm -a cname=" dhcp-client-name@nisplus-domain" auth_type=DES \
    auth_name="unix.dhcp-client-name@nisplus-domain" \
    public_data=copied-public-key \ 
    private_data=copied-private-key
    

    For the copied-public-key, paste the public key information that you copied from the temporary file. For the copied-private-key, paste the private key information that you copied from the temporary file.

  5. Remote copy files from the NIS+ client system to the DHCP client system by typing the following commands on the DHCP client system:


    # rcp nisplus-client-name:/var/nis/NIS_COLD_START /var/nis
    # rcp nisplus-client-name:/etc/.rootkey /etc
    # rcp nisplus-client-name:/etc/defaultdomain /etc
    

    If you get a “permission denied” message, the systems might not be set up to allow remote copying. In this case, you can copy the files as a regular user to an intermediate location. As superuser, copy the files from the intermediate location to the proper location on the DHCP client system.

  6. Copy the correct name service switch file for NIS+ by typing the following command on the DHCP client system:


    # cp /etc/nsswitch.nisplus /etc/nsswitch.conf
    
  7. Reboot the DHCP client system.

    The DHCP client system should now be able to use NIS+ services.


Example 16–1 Setting up an Oracle Solaris DHCP Client System as an NIS+ Client

The following example assumes that you have one system nisei, which is an NIS+ client in the NIS+ domain dev.example.net. You also have one DHCP client system, dhow, and you want dhow to be an NIS+ client.


(First log in as superuser on the NIS+ server)
# nisgrep nisei cred.org_dir > /tmp/nisei-cred
# cat /tmp/nisei-cred
nisei.dev.example.net.:DES:unix.nisei@dev.example.net:46199279911a84045b8e0
c76822179138173a20edbd8eab4:90f2e2bb6ffe7e3547346dda624ec4c7f0fe1d5f37e21cff63830
c05bc1c724b
# nistbladm -a cname="dhow@dev.example.net." \
auth_type=DES auth_name="unix.dhow@dev.example.net" \
public_data=46199279911a84045b8e0c76822179138173a20edbd8eab4 \
private_data=90f2e2bb6ffe7e3547346dda624ec4c7f0fe1d5f37e21cff63830\
c05bc1c724b
# rlogin dhow
(Log in as superuser on dhow)
# rcp nisei:/var/nis/NIS_COLD_START /var/nis
# rcp nisei:/etc/.rootkey /etc
# rcp nisei:/etc/defaultdomain /etc
# cp /etc/nsswitch.nisplus /etc/nsswitch.conf
# reboot

The DHCP client system dhow should now be able to use NIS+ services.



Example 16–2 Adding Credentials With a Script

If you want to set up a large number of DHCP client systems as NIS+ clients, you can write a script. A script can quickly add the entries to the cred.org_dir NIS+ table. The following example shows a sample script.


#! /usr/bin/ksh  
# 
# Copyright (c) by Sun Microsystems, Inc. All rights reserved. 
# 
# Sample script for cloning a credential. Hosts file is already populated  
# with entries of the form dhcp-[0-9][0-9][0-9]. The entry we're cloning 
# is dhcp-001. 
#  
#  
PUBLIC_DATA=6e72878d8dc095a8b5aea951733d6ea91b4ec59e136bd3b3 
PRIVATE_DATA=3a86729b685e2b2320cd7e26d4f1519ee070a60620a93e48a8682c5031058df4
HOST="dhcp-" 
DOMAIN="mydomain.example.com"  
 
for 
i in 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019
do         
     print - ${HOST}${i}         
     #nistbladm -r [cname="${HOST}${i}.${DOMAIN}."]cred.org_dir         
     nistbladm -a cname="${HOST}${i}.${DOMAIN}." \
         auth_type=DES auth_name="unix.${HOST}${i}@${DOMAIN}" \
         public_data=${PUBLIC_DATA} private_data=${PRIVATE_DTA} cred.org_Dir
done  
 
exit 0

DHCP Client Event Scripts

You can set up the Oracle Solaris DHCP client to run an executable program or script that can perform any action that is appropriate for the client system. The program or script, which is called an event script, is automatically executed after certain DHCP lease events occur. The event script can be used to run other commands, programs, or scripts in response to specific lease events. You must provide your own event script to use this feature.

The following event keywords are used by dhcpagent to signify DHCP lease events:

Event Keyword

Description

BOUND and BOUND6

The interface is configured for DHCP. The client receives the acknowledgement message (DHCPv4 ACK) or (DHCPv6 Reply) from the DHCP server, which grants the lease request for an IP address. The event script is invoked immediately after the interface is configured successfully.

EXTEND and EXTEND6

The client successfully extends a lease. The event script is invoked immediately after the client receives the acknowledgement message from the DHCP server for the renew request.

EXPIRE and EXPIRE6

The lease expires when the lease time is up. For DHCPv4, the event script is invoked immediately before the leased address is removed from the interface and the interface is marked as down. For DHCPv6, the event script is invoked just before the last remaining leased addresses are removed from the interface.

DROP and DROP6

The client drops the lease to remove the interface from DHCP control. The event script is invoked immediately before the interface is removed from DHCP control.

RELEASE and RELEASE6

The client relinquishes the IP address. The event script is invoked immediately before the client releases the address on the interface and sends the DHCPv4 RELEASE or DHCPv6 Release packet to the DHCP server.

INFORM and INFORM6

An interface acquires new or updated configuration information from a DHCP server through the DHCPv4 INFORM or the DHCPv6 Information-Request message. These events occur when the DHCP client obtains only configuration parameters from the server and does not obtain an IP address lease.

LOSS6

During lease expiration, when one or more valid leases still remain, the event script is invoked just before expired addresses are removed. Those being removed are marked with the IFF_DEPRECATED flag.

With each of these events, dhcpagent invokes the following command:


/etc/dhcp/eventhook interface event

where interface is the interface that is using DHCP and event is one of the event keywords described previously. For example, when the ce0 interface is first configured for DHCP, the dhcpagent invokes the event script as follows:


/etc/dhcp/eventhook ce0 BOUND

To use the event script feature, you must do the following:

The event script inherits its program environment from dhcpagent, and runs with root privileges. The script can use the dhcpinfo utility to obtain more information about the interface, if necessary. See the dhcpinfo(1) man page for more information.

The dhcpagent daemon waits for the event script to exit on all events. If the event script does not exit after 55 seconds, dhcpagent sends a SIGTERM signal to the script process. If the process still does not exit after three additional seconds, the daemon sends a SIGKILL signal to kill the process.

The dhcpagent(1M) man page includes one example of an event script.

Example 16–3 shows how to use a DHCP event script to keep the content of the /etc/resolv.conf file up to date. When the BOUND and EXTEND events occur, the script replaces the names of the domain server and name server. When the EXPIRE, DROP and RELEASE events occur, the script removes the names of the domain server and name server from the file.


Note –

The example script assumes that DHCP is the authoritative source for the names of the domain server and the name server. The script also assumes that all interfaces under DHCP control return consistent and current information. These assumptions might not reflect conditions on your system.



Example 16–3 Event Script for Updating the /etc/resolv.conf File

#!/bin/ksh -p

PATH=/bin:/sbin export PATH
umask 0222

# Refresh the domain and name servers on /etc/resolv.conf

insert ()
{
	dnsservers=`dhcpinfo -i $1 DNSserv`
	if [ -n "$dnsservers" ]; then
		# remove the old domain and name servers
		if [ -f /etc/resolv.conf ]; then
			rm -f /tmp/resolv.conf.$$
			sed -e '/^domain/d' -e '/^nameserver/d' \
			    /etc/resolv.conf > /tmp/resolv.conf.$$
		fi

		# add the new domain
		dnsdomain=`dhcpinfo -i $1 DNSdmain`
		if [ -n "$dnsdomain" ]; then
			echo "domain $dnsdomain" >> /tmp/resolv.conf.$$
		fi

		# add new name servers
		for name in $dnsservers; do
			echo nameserver $name >> /tmp/resolv.conf.$$
		done
		mv -f /tmp/resolv.conf.$$ /etc/resolv.conf
	fi
}

# Remove the domain and name servers from /etc/resolv.conf

remove ()
{
	if [ -f /etc/resolv.conf ]; then
		rm -f /tmp/resolv.conf.$$
		sed -e '/^domain/d' -e '/^nameserver/d' \
		    /etc/resolv.conf > /tmp/resolv.conf.$$
		mv -f /tmp/resolv.conf.$$ /etc/resolv.conf
	fi
}

case $2 in
BOUND | EXTEND)
	insert $1
	exit 0
	;;
EXPIRE | DROP | RELEASE)
	remove
	exit 0
	;;
*)
	exit 0
	;;
esac

Chapter 17 Troubleshooting DHCP (Reference)

This chapter provides information to help you solve problems that you might encounter when you configure a DHCP server or client. The chapter also helps you with problems you might have in using DHCP after configuration is complete.

The chapter includes the following information:

See Chapter 14, Configuring the DHCP Service (Tasks) for information about configuring your DHCP server. SeeEnabling and Disabling an Oracle Solaris DHCP Client for information about configuring your DHCP client.

Troubleshooting DHCP Server Problems

The problems that you might encounter when you configure the server fall into the following categories:

NIS+ Problems and the DHCP Data Store

If you use NIS+ as the DHCP data store, problems that you might encounter can be categorized as follows:

Cannot Select NIS+ as the DHCP Data Store

If you try to use NIS+ as your data store, DHCP Manager might not offer NIS+ as a choice for the data store. If you use the dhcpconfig command, you might see a message stating that NIS+ does not appear to be installed and running. Both these symptoms mean that NIS+ has not been configured for this server, although NIS+ might be in use on the network. Before you can select NIS+ as a data store, the server system must be configured as an NIS+ client.

Before you set up the DHCP server system as an NIS+ client, the following statements must be true:

Setting Up NIS+ Client Machines in System Administration Guide: Naming and Directory Services (NIS+) provides detailed information about configuring an NIS+ client.

NIS+ Is Not Adequately Configured for DHCP Data Store

After you successfully use NIS+ with DHCP, you might encounter errors if changes are made to NIS+. The changes could introduce configuration problems. Use the following explanations of problems and solutions to help you determine the cause of configuration problems.

Problem:

Root object does not exist in the NIS+ domain.

Solution:

Type the following command:

/usr/lib/nis/nisstat

This command displays statistics for the domain. If the root object does not exist, no statistics are returned.

Set up the NIS+ domain using the System Administration Guide: Naming and Directory Services (NIS+).

Problem:

NIS+ is not used for passwd and publickey information.

Solution:

Type the following command to view the configuration file for the name service switch:

cat /etc/nsswitch.conf

Check the passwd and publickey entries for the “nisplus” keyword. Refer to the System Administration Guide: Naming and Directory Services (NIS+) for information about configuring the name service switch.

Problem:

The domain name is empty.

Solution:

Type the following command:

domainname

If the command lists an empty string, no domain name has been set for the domain. Use local files for your data store, or set up an NIS+ domain for your network. Refer to the System Administration Guide: Naming and Directory Services (NIS+).

Problem:

The NIS_COLD_START file does not exist.

Solution:

Type the following command on the server system to determine if the file exists:

cat /var/nis/NIS_COLD_START

Use local files for your data store, or create an NIS+ client. Refer to the System Administration Guide: Naming and Directory Services (NIS+).

NIS+ Access Problems for the DHCP Data Store

NIS+ access problems might cause error messages about incorrect DES credentials, or inadequate permissions to update NIS+ objects or tables. Use the following explanations of problems and solutions to determine the cause of NIS+ access errors you receive.

Problem:

The DHCP server system does not have create access to the org_dir object in the NIS+ domain.

Solution:

Type the following command:


nisls -ld org_dir

The access rights are listed in the form r---rmcdrmcdr---, where the permissions apply respectively to nobody, owner, group, and world. The owner of the object is listed next.

Normally, the org_dir directory object provides full rights to both the owner and the group. Full rights consist of read, modify, create, and destroy. The org_dir directory object provides only read access to the world and nobody classes.

The DHCP server name must either be listed as the owner of the org_dir object, or be listed as a principal in the group. The group must have create access. List the group with the command:


nisls -ldg org_dir

Use the nischmod command to change the permissions for org_dir if necessary. For example, to add create access to the group, you would type the following command:


nischmod g+c org_dir

See the nischmod(1) man page for more information.

Problem:

The DHCP server does not have access rights to create a table under the org_dir object.

Usually, this problem means the server system's principal name is not a member of the owning group for the org_dir object, or no owning group exists.

Solution:

Type this command to find the owning group name:


niscat -o org_dir

Look for a line that is similar to:

Group : "admin.example.com."

List the principal names in the group using the command:


nisgrpadm -l groupname

For example, this command lists the principal names of the group admin.example.com:

nisgrpadm -l admin.example.com

The server system's name should be listed as an explicit member of the group or included as an implicit member of the group. If necessary, add the server system's name to the group using the nisgrpadm command.

For example, to add the server name pacific to the group admin.example.com, you would type the following command:


nisgrpadm -a admin.example.com pacific.example.com

See the nisgrpadm(1) man page for more information.

Problem:

The DHCP server does not have valid Data Encryption Standard (DES) credentials in the NIS+ cred table.

Solution:

If there is a credential problem, an error message states that the user does not have DES credentials in the NIS+ name service.

Use the nisaddcred command to add security credentials for the DHCP server system.

The following example shows how to add DES credentials for the system mercury in the domain example.com:


nisaddcred -p unix.mercury@example.com \
-P mercury.example.com. DES example.com.

The command prompts for the root password, which is required to generate an encrypted secret key.

See the nisaddcred(1M) man page for more information.

IP Address Allocation Errors in DHCP

When a client attempts to obtain or verify an IP address, you might see problems logged to syslog or in server debugging mode output. The following list of common error messages indicates the possible causes and solutions.


There is no n.n.n.n dhcp-network table for DHCP client's network

Cause:

A client is requesting a specific IP address or seeking to extend a lease on its current IP address. The DHCP server cannot find the DHCP network table for that address.

Solution:

The DHCP network table might have been deleted mistakenly. You can recreate the network table by adding the network again using DHCP Manager or the dhcpconfig command.


ICMP ECHO reply to OFFER candidate: n.n.n.n, disabling

Cause:

The IP address considered for offering to a DHCP client is already in use. This problem might occur if more than one DHCP server owns the address. The problem might also occur if an address was manually configured for a non-DHCP network client.

Solution:

Determine the proper ownership of the address. Correct either the DHCP server database or the host's network configuration.


ICMP ECHO reply to OFFER candidate: n.n.n.n. No corresponding dhcp network record.

Cause:

The IP address considered for offering to a DHCP client does not have a record in a network table. This error indicates that the IP address record was deleted from the DHCP network table after the address was selected. This error can only happen in the brief period before the duplicate address check is completed.

Solution:

Use DHCP Manager or the pntadm command to view the DHCP network table. If the IP address is missing, create the address with DHCP Manager by choosing Create from the Edit menu on the Address tab. You can also use pntadm to create the IP address.


DHCP network record for n.n.n.nis unavailable, ignoring request.

Cause:

The record for the requested IP address is not in the DHCP network table, so the server is dropping the request.

Solution:

Use DHCP Manager or the pntadm command to view the DHCP network table. If the IP address is missing, create the address with DHCP Manager by choosing Create from the Edit menu on the Address tab. You can also use pntadm to create the address.


n.n.n.n currently marked as unusable.

Cause:

The requested IP address cannot be offered because the address has been marked in the network table as unusable.

Solution:

You can use DHCP Manager or the pntadm command to make the address usable.


n.n.n.n was manually allocated. No dynamic address will be allocated.

Cause:

The client ID has been assigned a manually allocated address, and that address is marked as unusable. The server cannot allocate a different address to this client.

Solution:

You can use DHCP Manager or the pntadm command to make the address usable, or manually allocate a different address to the client.


Manual allocation (n.n.n.n, client ID) has n other records. Should have 0.

Cause:

The client that has the specified client ID has been manually assigned more than one IP address. A client should be assigned only one address. The server selects the last manually assigned address that is found in the network table.

Solution:

Use DHCP Manager or the pntadm command to modify IP addresses to remove the additional manual allocations.


No more IP addresses on n.n.n.nnetwork.

Cause:

All IP addresses currently managed by DHCP on the specified network have been allocated.

Solution:

Use DHCP Manager or the pntadm command to create new IP addresses for this network.


Client: clientid lease on n.n.n.n expired.

Cause:

The lease was not negotiable and timed out.

Solution:

The client should automatically restart the protocol to obtain a new lease.


Offer expired for client: n.n.n.n

Cause:

The server made an IP address offer to the client, but the client took too long to respond and the offer expired.

Solution:

The client should automatically issue another discover message. If this message also times out, increase the cache offer time out for the DHCP server. In DHCP Manager, choose Modify from the Service menu.


Client: clientid REQUEST is missing requested IP option.

Cause:

The client's request did not specify the offered IP address, so the DHCP server ignored the request. This problem might occur if you use a third-party DHCP client that is not compliant with the updated DHCP protocol, RFC 2131.

Solution:

Update the client software.


Client: clientid is trying to renew n.n.n.n, an IP address it has not leased.

Cause:

The IP address for this client in the DHCP network table does not match the IP address that the client specified in its renewal request. The DHCP server does not renew the lease. This problem might occur if you delete a client's record while the client is still using the IP address.

Solution:

Use DHCP Manager or the pntadm command to examine the network table, and correct the client's record, if necessary. The client ID should be bound to the specified IP address. If the client ID is not bound, edit the address properties to add the client ID.


Client: clientid is trying to verify unrecorded address: n.n.n.n, ignored.

Cause:

The specified client has not been registered in the DHCP network table with this address, so the request is ignored by this DHCP server.

Another DHCP server on the network might have assigned this client the address. However, you might also have deleted the client's record while the client was still using the IP address.

Solution:

Use DHCP Manager or the pntadm command to examine the network table on this server and any other DHCP servers on the network. Make corrections, if necessary.

You can also do nothing and allow the lease to expire. The client automatically requests a new address lease.

If you want the client to get a new lease immediately, restart the DHCP protocol on the client by typing the following commands:


ifconfig interface dhcp release
ifconfig interface dhcp start

Troubleshooting DHCP Client Configuration Problems

The problems that you might encounter with a DHCP client fall into the following categories:

Problems Communicating With the DHCP Server

This section describes problems that you might encounter as you add DHCP clients to the network.

After you enable the client software and reboot the system, the client tries to reach the DHCP server to obtain its network configuration. If the client fails to reach the server, you might see error messages such as the following:


DHCP or BOOTP server not responding 

    Before you can determine the problem, you must gather diagnostic information from both the client and the server. To gather information, you can perform the following tasks:

  1. How to Run the DHCP Client in Debugging Mode

  2. How to Run the DHCP Server in Debugging Mode

  3. How to Use snoop to Monitor DHCP Network Traffic

You can do these things separately or concurrently.

The information that you gather can help you determine if the problem is with the client, server, or a relay agent. Then, you can find a solution.

ProcedureHow to Run the DHCP Client in Debugging Mode

If the client is not an Oracle Solaris DHCP client, refer to the client's documentation for information about how to run the client in debugging mode.

If you have an Oracle Solaris DHCP client, use the following steps.

  1. Become superuser on the DHCP client system.

  2. Kill the DHCP client daemon.


    # pkill -x dhcpagent
    
  3. Restart the daemon in debugging mode.


    # /sbin/dhcpagent -d1 -f &
    

    The -d switch puts the DHCP client in debugging mode with level 1 verbosity. The -f switch causes output to be sent to the console instead of to syslog.

  4. Configure the interface to start DHCP negotiation.


    # ifconfig interface dhcp start
    

    Replace interface with the name of the network interface of the client, such as ge0.

    When run in debugging mode, the client daemon displays messages to your screen while performing DHCP requests. See Output from DHCP Client in Debugging Mode for information about client debugging mode output.

ProcedureHow to Run the DHCP Server in Debugging Mode

  1. Become superuser on the server system.

  2. Stop the DHCP server temporarily.


    # svcadm disable -t svc:/network/dhcp-server
    

    You can also use DHCP Manager or dhcpconfig to stop the server.

  3. Restart the daemon in debugging mode.


    # /usr/lib/inet/in.dhcpd -d -v
    

    You should also use any in.dhcpd command-line options that you normally use when you run the daemon. For example, if you run the daemon as a BOOTP relay agent, include the -r option with the in.dhcpd -d -v command.

    When run in debugging mode, the daemon displays messages to your screen while processing DHCP or BOOTP requests. See Output from the DHCP Server in Debugging Mode for information about server debugging mode output.

ProcedureHow to Use snoop to Monitor DHCP Network Traffic

  1. Become superuser on the DHCP server system.

  2. Start snoop to begin tracing network traffic across the server's network interface.


    # /usr/sbin/snoop -d interface -o snoop-output-filename udp port 67 or udp port 68
    

    For example, you might type the following command:


    #  /usr/sbin/snoop -d hme0 -o /tmp/snoop.output udp port 67 or udp port 68
    

    snoop continues to monitor the interface until you stop snoop by pressing Control-C after you have the information that you need.

  3. Boot the client system, or restart the dhcpagent on the client system.

    How to Run the DHCP Client in Debugging Mode describes how to restart dhcpagent.

  4. On the server system, use snoop to display the output file with the contents of network packets:


    # /usr/sbin/snoop -i snoop-output-filename -x0 -v
    

    For example, you might type the following command:

    # /usr/sbin/snoop -i /tmp/snoop.output -x0 -v
    
See Also

See DHCP snoop Output for information about interpreting the output.

Output from DHCP Client in Debugging Mode

The following example shows normal output when a DHCP client in debugging mode sends its DHCP request and receives its configuration information from a DHCP server.


Example 17–1 Normal Output from the DHCP Client in Debugging Mode


/sbin/dhcpagent: debug: set_packet_filter: set filter 0x27fc8 (DHCP filter) 
/sbin/dhcpagent: debug: init_ifs: initted interface hme0 
/sbin/dhcpagent: debug: insert_ifs: hme0: sdumax 1500, optmax 1260, hwtype 1, hwlen 6 
/sbin/dhcpagent: debug: insert_ifs: inserted interface hme0 
/sbin/dhcpagent: debug: register_acknak: registered acknak id 5 
/sbin/dhcpagent: debug: unregister_acknak: unregistered acknak id 5 
/sbin/dhcpagent: debug: set_packet_filter: set filter 0x26018 (ARP reply filter)
/sbin/dhcpagent: info: setting IP netmask on hme0 to 255.255.192.0 
/sbin/dhcpagent: info: setting IP address on hme0 to 10.23.3.233 
/sbin/dhcpagent: info: setting broadcast address on hme0 to 10.23.63.255 
/sbin/dhcpagent: info: added default router 10.23.0.1 on hme0 
/sbin/dhcpagent: debug: set_packet_filter: set filter 0x28054 (blackhole filter) 
/sbin/dhcpagent: debug: configure_if: bound ifsp->if_sock_ip_fd 
/sbin/dhcpagent: info: hme0 acquired lease, expires Tue Aug 10 16:18:33 2006 
/sbin/dhcpagent: info: hme0 begins renewal at Tue Aug 10 15:49:44 2006 
/sbin/dhcpagent: info: hme0 begins rebinding at Tue Aug 10 16:11:03 2006

If the client cannot reach the DHCP server, you might see debugging mode output that is similar to the output shown in the following example.


Example 17–2 Output Indicating a Problem from the DHCP Client in Debugging Mode


/sbin/dhcpagent: debug: set_packet_filter: set filter 0x27fc8 (DHCP filter)
/sbin/dhcpagent: debug: init_ifs: initted interface hme0 
/sbin/dhcpagent: debug: select_best: no valid OFFER/BOOTP reply
/sbin/dhcpagent: debug: select_best: no valid OFFER/BOOTP reply
/sbin/dhcpagent: debug: select_best: no valid OFFER/BOOTP reply
 

If you see this message, the client request never reached the server, or the server cannot send a response to the client. Run snoop on the server as described in How to Use snoop to Monitor DHCP Network Traffic to determine if packets from the client have reached the server.

Output from the DHCP Server in Debugging Mode

Normal server debugging mode output shows server configuration information followed by information about each network interface as the daemon starts. After daemon startup, the debugging mode output shows information about requests the daemon processes. Example 17–3 shows debugging mode output for a DHCP server that has just started. The server extends the lease for a client that is using an address owned by another DHCP server that is not responding.


Example 17–3 Normal Output for DHCP Server in Debugging Mode


Daemon Version: 3.1  
Maximum relay hops: 4  
Transaction logging to console enabled.  
Run mode is: DHCP Server Mode.  
Datastore: nisplus  
Path: org_dir.dhcp.test..:dhcp.test..:$ 
DHCP offer TTL: 10  
Ethers compatibility enabled.  
BOOTP compatibility enabled.  
ICMP validation timeout: 1000 milliseconds, Attempts: 2.  
Monitor (0005/hme0) started...  
Thread Id: 0005 - Monitoring Interface: hme0 *****  
MTU: 1500      Type: DLPI  
Broadcast: 10.21.255.255 
Netmask: 255.255.0.0  
Address: 10.21.0.2  
Monitor (0006/nf0) started...  
Thread Id: 0006 - Monitoring Interface: nf0 *****  
MTU: 4352      Type: DLPI  
Broadcast: 10.22.255.255  
Netmask: 255.255.0.0  
Address: 10.22.0.1  
Monitor (0007/qfe0) started...  
Thread Id: 0007 - Monitoring Interface: qfe0 *****  
MTU: 1500      Type: DLPI   
Broadcast: 10.23.63.255  
Netmask: 255.255.192.0  
Address: 10.23.0.1  
Read 33 entries from DHCP macro database on Tue Aug 10 15:10:27 2006 
Datagram received on network device: qfe0  
Client: 0800201DBA3A is requesting verification of address owned by 10.21.0.4 
Datagram received on network device: qfe0  
Client: 0800201DBA3A is requesting verification of address owned by 10.21.0.4  
Datagram received on network device: qfe0  
Client: 0800201DBA3A is requesting verification of address owned by 10.21.0.4  
Datagram received on network device: qfe0  
Client: 0800201DBA3A maps to IP: 10.23.3.233  
Unicasting datagram to 10.23.3.233 address.  
Adding ARP entry: 10.23.3.233 == 0800201DBA3A  
DHCP EXTEND 0934312543 0934316143 10.23.3.233 10.21.0.2 
          0800201DBA3A SUNW.Ultra-5_10 0800201DBA3A

Example 17–4 shows debugging mode output from a DHCP daemon that starts as a BOOTP relay agent. The agent relays requests from a client to a DHCP server, and relays the server's responses to the client.


Example 17–4 Normal Output from BOOTP Relay in Debugging Mode


Relay destination: 10.21.0.4 (blue-servr2)     network: 10.21.0.0  
Daemon Version: 3.1  
Maximum relay hops: 4  
Transaction logging to console enabled.  
Run mode is: Relay Agent Mode.  
Monitor (0005/hme0) started...  
Thread Id: 0005 - Monitoring Interface: hme0 *****  
MTU: 1500      Type: DLPI  
Broadcast: 10.21.255.255  
Netmask: 255.255.0.0  
Address: 10.21.0.2  
Monitor (0006/nf0) started...  
Thread Id: 0006 - Monitoring Interface: nf0 *****  
MTU: 4352      Type: DLPI  
Broadcast: 10.22.255.255  
Netmask: 255.255.0.0  
Address: 10.22.0.1  
Monitor (0007/qfe0) started...  
Thread Id: 0007 - Monitoring Interface: qfe0 *****  
MTU: 1500      Type: DLPI  
Broadcast: 10.23.63.255  
Netmask: 255.255.192.0  
Address: 10.23.0.1  
Relaying request 0800201DBA3A to 10.21.0.4, server port.  
BOOTP RELAY-SRVR 0934297685 0000000000 0.0.0.0 10.21.0.4 0800201DBA3A 
N/A 0800201DBA3A  
Packet received from relay agent: 10.23.0.1  
Relaying reply to client 0800201DBA3A  
Unicasting datagram to 10.23.3.233 address.  
Adding ARP entry: 10.23.3.233 == 0800201DBA3A  
BOOTP RELAY-CLNT 0934297688 0000000000 10.23.0.1 10.23.3.233 0800201DBA3A 
N/A 0800201DBA3A  
Relaying request 0800201DBA3A to 10.21.0.4, server port.  
BOOTP RELAY-SRVR 0934297689 0000000000 0.0.0.0 10.21.0.4 0800201DBA3A 
N/A 0800201DBA3A  
Packet received from relay agent: 10.23.0.1  
Relaying reply to client 0800201DBA3A  
Unicasting datagram to 10.23.3.233 address.  
Adding ARP entry: 10.23.3.233 == 0800201DBA3A 
 

If there is a problem with DHCP, the debugging mode output might display warnings or error messages. Use the following list of DHCP server error messages to find solutions.


ICMP ECHO reply to OFFER candidate: ip_address disabling

Cause:

Before the DHCP server offers an IP address to a client, the server pings the address to verify that the address is not in use. If a client replies, the address is in use.

Solution:

Make sure the addresses that you configured are not already in use. You can use the ping command. See the ping(1M) man page for more information.


No more IP addresses on network-address network.

Cause:

No IP addresses are available in the DHCP network table associated with the client's network.

Solution:

Create more IP addresses with DHCP Manager or the pntadm command. If the DHCP daemon is monitoring multiple subnets, be sure the additional addresses are for the subnet where the client is located. See Adding IP Addresses to the DHCP Service for more information.


No more IP addresses for network-address network when you are running the DHCP daemon in BOOTP compatibility mode.

Cause:

BOOTP does not use a lease time, so the DHCP server looks for free addresses with the BOOTP flag set to allocate to BOOTP clients.

Solution:

Use DHCP Manager to allocate BOOTP addresses. See Supporting BOOTP Clients With the DHCP Service (Task Map).


Request to access nonexistent per network database: database-name in datastore: datastore.

Cause:

During configuration of the DHCP server, a DHCP network table for a subnet was not created.

Solution:

Use DHCP Manager or the pntadm command to create the DHCP network table and new IP addresses. See Adding DHCP Networks.


There is no table-name dhcp-network table for DHCP client's network.

Cause:

During configuration of the DHCP server, a DHCP network table for a subnet was not created.

Solution:

Use DHCP Manager or the pntadm command to create the DHCP network table and new IP addresses. See Adding DHCP Networks.


Client using non_RFC1048 BOOTP cookie.

Cause:

A device on the network is trying to access an unsupported implementation of BOOTP.

Solution:

Ignore this message, unless you need to configure this device. If you want to support the device, see Supporting BOOTP Clients With the DHCP Service (Task Map) for more information.

DHCP snoop Output

In the snoop output, you should see that packets are exchanged between the DHCP client system and the DHCP server system. The IP address for each system is indicated in each packet. IP addresses for any routers or relay agents in the packet's path are also included. If the systems do not exchange packets, the client system might not be able to contact the server system at all. The problem is then at a lower level.

To evaluate snoop output, you must know what the expected behavior is. For example, you must know if the request should be going through a BOOTP relay agent. You must also know the MAC addresses and the IP address of the systems involved so that you can determine if those values are as expected. If there is more than one network interface, you must know the addresses of the network interfaces as well.

The following example shows normal snoop output for a DHCP acknowledgement message sent from the DHCP server on blue-servr2 to a client whose MAC address is 8:0:20:8e:f3:7e. In the message, the server assigns the client the IP address 192.168.252.6 and the host name white-6. The message also includes a number of standard network options and several vendor-specific options for the client.


Example 17–5 Sample snoop Output for One Packet


ETHER:  ----- Ether Header ----- 
ETHER:   
ETHER:  Packet 26 arrived at 14:43:19.14 
ETHER:  Packet size = 540 bytes 
ETHER:  Destination = 8:0:20:8e:f3:7e, Sun 
ETHER:  Source      = 8:0:20:1e:31:c1, Sun 
ETHER:  Ethertype = 0800 (IP) 
ETHER:  
IP:   ----- IP Header ----- 
IP:    
IP:   Version = 4 
IP:   Header length = 20 bytes 
IP:   Type of service = 0x00 
IP:         xxx. .... = 0 (precedence) 
IP:         ...0 .... = normal delay 
IP:         .... 0... = normal throughput 
IP:         .... .0.. = normal reliability 
IP:   Total length = 526 bytes 
IP:   Identification = 64667 
IP:   Flags = 0x4 IP:         .1.. .... = do not fragment 
IP:         ..0. .... = last fragment 
IP:   Fragment offset = 0 bytes 
IP:   Time to live = 254 seconds/hops 
IP:   Protocol = 17 (UDP) 
IP:   Header checksum = 157a 
IP:   Source address = 10.21.0.4, blue-servr2 
IP:   Destination address = 192.168.252.6, white-6 
IP:   No options 
IP:   UDP:  ----- UDP Header ----- 
UDP:   
UDP:  Source port = 67 
UDP:  Destination port = 68 (BOOTPC) 
UDP:  Length = 506  
UDP:  Checksum = 5D4C  
UDP:  
DHCP: ----- Dynamic Host Configuration Protocol ----- 
DHCP:  
DHCP: Hardware address type (htype) =  1 (Ethernet (10Mb)) 
DHCP: Hardware address length (hlen) = 6 octets 
DHCP: Relay agent hops = 0 
DHCP: Transaction ID = 0x2e210f17 
DHCP: Time since boot = 0 seconds 
DHCP: Flags = 0x0000 
DHCP: Client address (ciaddr) = 0.0.0.0 
DHCP: Your client address (yiaddr) = 192.168.252.6 
DHCP: Next server address (siaddr) = 10.21.0.2 
DHCP: Relay agent address (giaddr) = 0.0.0.0 
DHCP: Client hardware address (chaddr) = 08:00:20:11:E0:1B 
DHCP:  
DHCP: ----- (Options) field options ----- 
DHCP:  
DHCP: Message type = DHCPACK 
DHCP: DHCP Server Identifier = 10.21.0.4 
DHCP: Subnet Mask = 255.255.255.0 
DHCP: Router at = 192.168.252.1 
DHCP: Broadcast Address = 192.168.252.255 
DHCP: NISPLUS Domainname = dhcp.test 
DHCP: IP Address Lease Time = 3600 seconds 
DHCP: UTC Time Offset = -14400 seconds 
DHCP: RFC868 Time Servers at = 10.21.0.4 
DHCP: DNS Domain Name = sem.example.com 
DHCP: DNS Servers at = 10.21.0.1 
DHCP: Client Hostname = white-6 
DHCP: Vendor-specific Options (166 total octets): 
DHCP:   (02) 04 octets  0x8194AE1B (unprintable) 
DHCP:   (03) 08 octets  "pacific" 
DHCP:   (10) 04 octets  0x8194AE1B (unprintable) 
DHCP:   (11) 08 octets  "pacific" 
DHCP:   (15) 05 octets  "xterm" 
DHCP:   (04) 53 octets  "/export/s2/base.s2s/latest/Solaris_8/Tools/Boot" 
DHCP:   (12) 32 octets  "/export/s2/base.s2s/latest" 
DHCP:   (07) 27 octets  "/platform/sun4u/kernel/unix" 
DHCP:   (08) 07 octets  "EST5EDT" 
  0: 0800 208e f37e 0800 201e 31c1 0800 4500    .. .ó~.. .1...E.
 16: 020e fc9b 4000 fe11 157a ac15 0004 c0a8    ....@....z......           
 32: fc06 0043 0044 01fa 5d4c 0201 0600 2e21    ...C.D..]L.....!           
 48: 0f17 0000 0000 0000 0000 c0a8 fc06 ac15    ................           
 64: 0002 0000 0000 0800 2011 e01b 0000 0000    ........ .......           
 80: 0000 0000 0000 0000 0000 0000 0000 0000    ................           
 96: 0000 0000 0000 0000 0000 0000 0000 0000    ................          
112: 0000 0000 0000 0000 0000 0000 0000 0000    ................          
128: 0000 0000 0000 0000 0000 0000 0000 0000    ................          
144: 0000 0000 0000 0000 0000 0000 0000 0000    ................          
160: 0000 0000 0000 0000 0000 0000 0000 0000    ................          
176: 0000 0000 0000 0000 0000 0000 0000 0000    ................          
192: 0000 0000 0000 0000 0000 0000 0000 0000    ................          
208: 0000 0000 0000 0000 0000 0000 0000 0000    ................          
224: 0000 0000 0000 0000 0000 0000 0000 0000    ................          
240: 0000 0000 0000 0000 0000 0000 0000 0000    ................          
256: 0000 0000 0000 0000 0000 0000 0000 0000    ................          
272: 0000 0000 0000 6382 5363 3501 0536 04ac    ......c.Sc5..6..          
288: 1500 0401 04ff ffff 0003 04c0 a8fc 011c    ................          
304: 04c0 a8fc ff40 0964 6863 702e 7465 7374    .....@.dhcp.test          
320: 3304 0000 0e10 0204 ffff c7c0 0404 ac15    3...............          
336: 0004 0f10 736e 742e 6561 7374 2e73 756e    ....sem.example.          
352: 2e63 6f6d 0604 ac15 0001 0c07 7768 6974    com.........whit          
368: 652d 362b a602 0481 94ae 1b03 0861 746c    e-6+.........pac          
384: 616e 7469 630a 0481 94ae 1b0b 0861 746c    ific.........pac          
400: 616e 7469 630f 0578 7465 726d 0435 2f65    ific...xterm.5/e          
416: 7870 6f72 742f 7332 382f 6261 7365 2e73    xport/sx2/bcvf.s          
432: 3238 735f 776f 732f 6c61 7465 7374 2f53    2xs_btf/latest/S          
448: 6f6c 6172 6973 5f38 2f54 6f6f 6c73 2f42    olaris_x/Tools/B          
464: 6f6f 740c 202f 6578 706f 7274 2f73 3238    oot. /export/s2x          
480: 2f62 6173 652e 7332 3873 5f77 6f73 2f6c    /bcvf.s2xs_btf/l         
496: 6174 6573 7407 1b2f 706c 6174 666f 726d    atest../platform          
512: 2f73 756e 346d 2f6b 6572 6e65 6c2f 756e    /sun4u/kernel/un          
528: 6978 0807 4553 5435 4544 54ff              ix..EST5EDT.  

Problems With Inaccurate DHCP Configuration Information

If a DHCP client receives inaccurate information in its network configuration information, look at the DHCP server data. You must examine the option values in the macros that the DHCP server processes for this client. Examples of inaccurate information might be the wrong NIS domain name or router IP address.

Use the following general guidelines to help you determine the source of the inaccurate information:

Problems With the DHCP Client-Supplied Host Name

This section describes problems that you might experience with DHCP clients that supply their own host names to be registered with DNS.

DHCP Client Does Not Request a Host Name

If your client is not an Oracle Solaris DHCP client, consult the client's documentation to determine how to configure the client to request a host name. For Oracle Solaris DHCP clients, see How to Enable an Oracle Solaris DHCPv4 Client to Request a Specific Host Name.

DHCP Client Does Not Get Requested Host Name

The following list includes describes possible problems a client might have in getting its requested hostname, and suggested solutions.

Problem:

Client accepted an offer from a DHCP server that does not issue DNS updates.

Solution:

If two DHCP servers are available to the client, the servers should both be configured to provide DNS updates. See Enabling Dynamic DNS Updates by a DHCP Server for information about configuring the DHCP server and the DNS server.

To determine whether the DHCP server is configured to provide DNS updates:

  1. Determine the IP address of the client's DHCP server. On the client system, use snoop or another application for capturing network packets. See How to Use snoop to Monitor DHCP Network Traffic, and perform the procedure on the client instead of the server. In the snoop output, look for the DHCP Server Identifier to get the IP address of the server.

  2. Log in to the DHCP server system to verify that the system is configured to make DNS updates. Type the following command as superuser:

    dhcpconfig -P

    If UPDATE_TIMEOUT is listed as a server parameter, the DHCP server is configured to make DNS updates.

  3. On the DNS server, look at the /etc/named.conf file. Find the allow-update keyword in the zone section of the appropriate domain. If the server allows DNS updates by the DHCP server, the DHCP server's IP address is listed in the allow-update keyword.

Problem:

Client is using FQDN option to specify host name. Oracle Solaris DHCP does not currently support the FQDN option because the option is not officially in the DHCP protocol.

Solution:

On the server, use snoop or another application for capturing network packets. See How to Use snoop to Monitor DHCP Network Traffic. In the snoop output, look for the FQDN option in a packet from the client.

Configure the client to specify host name using Hostname option. Hostname is option code 12. Refer to client documentation for instructions.

For an Oracle Solaris client, see How to Enable an Oracle Solaris DHCPv4 Client to Request a Specific Host Name

Problem:

DHCP server that makes an address offer to the client does not know the client's DNS domain.

Solution:

On the DHCP server look for the DNSdmain option with a valid value. Set the DNSdmain option to the correct DNS domain name in a macro that is processed for this client. DNSdmain is usually contained in the network macro. See Modifying DHCP Macros for information about changing values of options in a macro.

Problem:

The host name requested by client corresponds to an IP address that is not managed by the DHCP server. The Oracle Solaris DHCP server does not perform DNS updates for IP addresses that the server does not manage.

Solution:

Check syslog for one of the following messages from the DHCP server:

Configure the client to request a different name. See How to Enable an Oracle Solaris DHCPv4 Client to Request a Specific Host Name. Choose a name that is mapped to an address managed by the DHCP server. You can see address mappings in DHCP Manager's Addresses tab. Alternatively, choose an address that is not mapped to any IP address.

Problem:

The host name requested by client corresponds to an IP address that is currently not available for use. The address might be in use, leased to another client, or under offer to another client.

Solution:

Check syslog for the following message from the DHCP server: ICMP ECHO reply to OFFER candidate: n.n.n.n.

Configure the client to choose a name corresponding to a different IP address. Alternatively, reclaim the address from the client that uses the address.

Problem:

DNS server is not configured to accept updates from the DHCP server.

Solution:

Examine the /etc/named.conf file on the DNS server. Look for the DHCP server's IP address with the allow-update keyword in the appropriate zone section for the DHCP server's domain. If the IP address is not present, the DNS server is not configured to accept updates from the DHCP server.

See How to Enable Dynamic DNS Updating for DHCP Clients for information about configuring the DNS server.

If the DHCP server has multiple interfaces, you might need to configure the DNS server to accept updates from all of the DHCP server's addresses. Enable debugging on the DNS server to see whether the updates are reaching the DNS server. If the DNS server received update requests, examine the debugging mode output to determine why the updates did not occur. See the in.named.1M man page for information about DNS debugging mode.

Problem:

DNS updates might not have completed in the allotted time. DHCP servers do not return host names to clients if the DNS updates have not completed by the configured time limit. However, attempts to complete the DNS updates continue.

Solution:

Use the nslookup command to determine whether the updates completed successfully. See the nslookup(1M) man page.

For example, suppose the DNS domain is hills.example.org, and the DNS server's IP address is 10.76.178.11. The host name that the client wants to register is cathedral. You could use the following command to determine if cathedral has been registered with that DNS server:

nslookup cathedral.hills.example.org 10.76.178.11

If the updates completed successfully, but not in the allotted time, you need to increase the time out value. See How to Enable Dynamic DNS Updating for DHCP Clients. In this procedure, you should increase the number of seconds to wait for a response from the DNS server before timing out.

Chapter 18 DHCP Commands and Files (Reference)

This chapter explains the relationships between the DHCP commands and the DHCP files. However, the chapter does not explain how to use the commands.

The chapter contains the following information:

DHCP Commands

The following table lists the commands that you can use to manage DHCP on your network.

Table 18–1 Commands Used in DHCP

Command 

Description 

Man Page 

dhtadm

Used to make changes to the options and macros in the dhcptab. This command is most useful in scripts that you create to automate changes to your DHCP information. Use dhtadm with the -P option, and pipe the output through the grep command for a quick way to search for particular option values in the dhcptab table.

dhtadm(1M)

pntadm

Used to make changes to the DHCP network tables that map client IDs to IP addresses and optionally associate configuration information with IP addresses.

pntadm(1M)

dhcpconfig

Used to configure and unconfigure DHCP servers and BOOTP relay agents. Also used to convert to a different data store format, and to import and export DHCP configuration data.

dhcpconfig(1M)

in.dhcpd

The DHCP server daemon. The daemon is started when the system is started. You should not start the server daemon directly. Use DHCP Manager, the svcadm command, or dhcpconfig to start and stop the daemon. The daemon should be invoked directly only to run the server in debug mode to troubleshoot problems.

in.dhcpd(1M)

dhcpmgr

The DHCP Manager, a graphical user interface (GUI) tool used to configure and manage the DHCP service. DHCP Manager is the recommended Oracle Solaris DHCP management tool.

dhcpmgr(1M)

ifconfig

Used at system boot to assign IP addresses to network interfaces, configure network interface parameters, or both. On an Oracle Solaris DHCP client, ifconfig starts DHCP to get the parameters (including the IP address) needed to configure a network interface.

ifconfig(1M)

dhcpinfo

Used by system startup scripts on Oracle Solaris client systems to obtain information (such as the host name) from the DHCP client daemon, dhcpagent. You can also use dhcpinfo in scripts or at the command line to obtain specified parameter values.

dhcpinfo(1)

snoop

Used to capture and display the contents of packets being passed across the network. snoop is useful for troubleshooting problems with the DHCP service.

snoop(1M)

dhcpagent

The DHCP client daemon, which implements the client side of the DHCP protocol. 

dhcpagent(1M)

Running DHCP Commands in Scripts

The dhcpconfig, dhtadm, and pntadm commands are optimized for use in scripts. In particular, the pntadm command is useful for creating a large number of IP address entries in a DHCP network table. The following sample script uses pntadm in batch mode to create IP addresses.


Example 18–1 addclient.ksh Script With the pntadm Command

#! /usr/bin/ksh
#
# This script utilizes the pntadm batch facility to add client entries
# to a DHCP network table. It assumes that the user has the rights to
# run pntadm to add entries to DHCP network tables.

#
# Based on the nsswitch setting, query the netmasks table for a netmask.
# Accepts one argument, a dotted IP address.
#
get_netmask()
{
	MTMP=`getent netmasks ${1} | awk '{ print $2 }'`
	if [ ! -z "${MTMP}" ]
	then
		print - ${MTMP}
	fi
}

#
# Based on the network specification, determine whether or not network is 
# subnetted or supernetted.
# Given a dotted IP network number, convert it to the default class
# network.(used to detect subnetting). Requires one argument, the
# network number. (e.g. 10.0.0.0) Echos the default network and default
# mask for success, null if error.
#
get_default_class()
{
	NN01=${1%%.*}
	tmp=${1#*.}
	NN02=${tmp%%.*}
	tmp=${tmp#*.}
	NN03=${tmp%%.*}
	tmp=${tmp#*.}
	NN04=${tmp%%.*}
	RETNET=""
	RETMASK=""

	typeset -i16 ONE=10#${1%%.*}
	typeset -i10 X=$((${ONE}&16#f0))
	if [ ${X} -eq 224 ]
	then
		# Multicast
		typeset -i10 TMP=$((${ONE}&16#f0))
		RETNET="${TMP}.0.0.0"
		RETMASK="240.0.0.0"
	fi
	typeset -i10 X=$((${ONE}&16#80))
	if [ -z "${RETNET}" -a ${X} -eq 0 ]
	then
		# Class A
		RETNET="${NN01}.0.0.0"
		RETMASK="255.0.0.0"
	fi
	typeset -i10 X=$((${ONE}&16#c0))
	if [ -z "${RETNET}" -a ${X} -eq 128 ]
	then
		# Class B
		RETNET="${NN01}.${NN02}.0.0"
		RETMASK="255.255.0.0"
	fi
	typeset -i10 X=$((${ONE}&16#e0))
	if [ -z "${RETNET}" -a ${X} -eq 192 ]
	then
		# Class C
		RETNET="${NN01}.${NN02}.${NN03}.0"
		RETMASK="255.255.255.0"
	fi
	print - ${RETNET} ${RETMASK}
	unset NNO1 NNO2 NNO3 NNO4 RETNET RETMASK X ONE
}

#
# Given a dotted form of an IP address, convert it to its hex equivalent.
#
convert_dotted_to_hex()
{
	typeset -i10 one=${1%%.*}
	typeset -i16 one=${one}
	typeset -Z2 one=${one}
	tmp=${1#*.}

	typeset -i10 two=${tmp%%.*}
	typeset -i16 two=${two}
	typeset -Z2 two=${two}
	tmp=${tmp#*.}

	typeset -i10 three=${tmp%%.*}
	typeset -i16 three=${three}
	typeset -Z2 three=${three}
	tmp=${tmp#*.}

	typeset -i10 four=${tmp%%.*}
	typeset -i16 four=${four}
	typeset -Z2 four=${four}

	 hex=`print - ${one}${two}${three}${four} | sed -e 's/#/0/g'`
	 print - 16#${hex}
	 unset one two three four tmp
}

#
# Generate an IP address given the network address, mask, increment.
# 
get_addr()
{
	typeset -i16 net=`convert_dotted_to_hex ${1}`
	typeset -i16 mask=`convert_dotted_to_hex ${2}`
	typeset -i16 incr=10#${3}

	# Maximum legal value - invert the mask, add to net.
	typeset -i16 mhosts=~${mask}
	typeset -i16 maxnet=${net}+${mhosts}

	# Add the incr value.
	let net=${net}+${incr}

	if [ $((${net} < ${maxnet})) -eq 1 ]
	then
		typeset -i16 a=${net}\&16#ff000000
		typeset -i10 a="${a}>>24"

		typeset -i16 b=${net}\&16#ff0000
		typeset -i10 b="${b}>>16"

		typeset -i16 c=${net}\&16#ff00
		typeset -i10 c="${c}>>8"

		typeset -i10 d=${net}\&16#ff
		print - "${a}.${b}.${c}.${d}"
	fi
	unset net mask incr mhosts maxnet a b c d
}

# Given a network address and client address, return the index.
client_index()
{
	typeset -i NNO1=${1%%.*}
	tmp=${1#*.}
	typeset -i NNO2=${tmp%%.*}
	tmp=${tmp#*.}
	typeset -i NNO3=${tmp%%.*}
	tmp=${tmp#*.}
	typeset -i NNO4=${tmp%%.*}

	typeset -i16 NNF1
	let NNF1=${NNO1}
	typeset -i16 NNF2
	let NNF2=${NNO2}
	typeset -i16 NNF3
	let NNF3=${NNO3}
	typeset -i16 NNF4
	let NNF4=${NNO4}
	typeset +i16 NNF1
	typeset +i16 NNF2
	typeset +i16 NNF3
	typeset +i16 NNF4
	NNF1=${NNF1#16\#}
	NNF2=${NNF2#16\#}
	NNF3=${NNF3#16\#}
	NNF4=${NNF4#16\#}
	if [ ${#NNF1} -eq 1 ]
	then
		NNF1="0${NNF1}"
	fi
	if [ ${#NNF2} -eq 1 ]
	then
		NNF2="0${NNF2}"
	fi
	if [ ${#NNF3} -eq 1 ]
	then
		NNF3="0${NNF3}"
	fi
	if [ ${#NNF4} -eq 1 ]
	then
		NNF4="0${NNF4}"
	fi
	typeset -i16 NN
	let NN=16#${NNF1}${NNF2}${NNF3}${NNF4}
	unset NNF1 NNF2 NNF3 NNF4

	typeset -i NNO1=${2%%.*}
	tmp=${2#*.}
	typeset -i NNO2=${tmp%%.*}
	tmp=${tmp#*.}
	typeset -i NNO3=${tmp%%.*}
	tmp=${tmp#*.}
	typeset -i NNO4=${tmp%%.*}
	typeset -i16 NNF1
	let NNF1=${NNO1}
	typeset -i16 NNF2
	let NNF2=${NNO2}
	typeset -i16 NNF3
	let NNF3=${NNO3}
	typeset -i16 NNF4
	let NNF4=${NNO4}
	typeset +i16 NNF1
	typeset +i16 NNF2
	typeset +i16 NNF3
	typeset +i16 NNF4
	NNF1=${NNF1#16\#}
	NNF2=${NNF2#16\#}
	NNF3=${NNF3#16\#}
	NNF4=${NNF4#16\#}
	if [ ${#NNF1} -eq 1 ]
	then
		NNF1="0${NNF1}"
	fi
	if [ ${#NNF2} -eq 1 ]
	then
		NNF2="0${NNF2}"
	fi
	if [ ${#NNF3} -eq 1 ]
	then
		NNF3="0${NNF3}"
	fi
	if [ ${#NNF4} -eq 1 ]
	then
		NNF4="0${NNF4}"
	fi
	typeset -i16 NC
	let NC=16#${NNF1}${NNF2}${NNF3}${NNF4}
	typeset -i10 ANS
	let ANS=${NC}-${NN}
	print - $ANS
}

#
# Check usage.
#
if [ "$#" != 3 ]
then
	print "This script is used to add client entries to a DHCP network"
	print "table by utilizing the pntadm batch facilty.\n"
	print "usage: $0 network start_ip entries\n"
	print "where: network is the IP address of the network"
        print "       start_ip is the starting IP address \n"
        print "       entries is the number of the entries to add\n"
	print "example: $0 10.148.174.0 10.148.174.1 254\n"
	return
fi

#
# Use input arguments to set script variables.
#
NETWORK=$1
START_IP=$2
typeset -i STRTNUM=`client_index ${NETWORK} ${START_IP}`
let ENDNUM=${STRTNUM}+$3
let ENTRYNUM=${STRTNUM}
BATCHFILE=/tmp/batchfile.$$
MACRO=`uname -n`

#
# Check if mask in netmasks table. First try
# for network address as given, in case VLSM
# is in use.
#
NETMASK=`get_netmask ${NETWORK}`
if [ -z "${NETMASK}" ]
then
	get_default_class ${NETWORK} | read DEFNET DEFMASK
	# use the default.
	if [ "${DEFNET}" != "${NETWORK}" ]
	then
		# likely subnetted/supernetted.
		print - "\n\n###\tWarning\t###\n"
		print - "Network ${NETWORK} is netmasked, but no entry was found  \n
              in the 'netmasks' table; please update the 'netmasks'  \n
              table in the appropriate nameservice before continuing. \n 
              (See /etc/nsswitch.conf.) \n" >&2
		return 1
	else
		# use the default.
		NETMASK="${DEFMASK}"
	fi
fi

#
# Create a batch file.
#
print -n "Creating batch file "
while [ ${ENTRYNUM} -lt ${ENDNUM} ]
do
	if [ $((${ENTRYNUM}-${STRTNUM}))%50 -eq 0 ]
	then
		print -n "."
	fi

	CLIENTIP=`get_addr ${NETWORK} ${NETMASK} ${ENTRYNUM}`
	print "pntadm -A ${CLIENTIP} -m ${MACRO} ${NETWORK}" >> ${BATCHFILE}
	let ENTRYNUM=${ENTRYNUM}+1
done
print " done.\n"

#
# Run pntadm in batch mode and redirect output to a temporary file.
# Progress can be monitored by using the output file.
#
print "Batch processing output redirected to ${BATCHFILE}"
print "Batch processing started."

pntadm -B ${BATCHFILE} -v > /tmp/batch.out 2 >&1

print "Batch processing completed."

Files Used by the DHCP Service

The following table lists files associated with Oracle Solaris DHCP.

Table 18–2 Files and Tables Used by DHCP Daemons and Commands

File or Table Name 

Description 

Man Page 

dhcptab

A generic term for the table of DHCP configuration information that is recorded as options with assigned values, which are then grouped into macros. The name of the dhcptab table and its location is determined by the data store you use for DHCP information.

dhcptab(4)

DHCP network table 

Maps IP addresses to client IDs and configuration options. DHCP network tables are named according to the IP address of the network, such as 10.21.32.0. There is no file that is called dhcp_network. The name and location of DHCP network tables is determined by the data store you use for DHCP information.

dhcp_network(4)

dhcpsvc.conf

Stores startup options for the DHCP daemon and data store information. This file must not be edited manually. Use the dhcpconfig command to change startup options.

dhcpsvc.conf(4)

nsswitch.conf

Specifies the location of name service databases and the order in which to search name services for various kinds of information. The nsswitch.conf file is read to obtain accurate configuration information when you configure a DHCP server. The file is located in the /etc directory.

nsswitch.conf(4)

resolv.conf

Contains information used to resolve DNS queries. During DHCP server configuration, this file is consulted for information about the DNS domain and DNS server. The file is located in the /etc directory.

resolv.conf(4)

dhcp.interface

Indicates that DHCP is to be used on the client's network interface that is specified in the dhcp.interface file name. For example, the existence of a file named dhcp.qe0 indicates that DHCP is to be used on the qe0 interface. The dhcp.interface file might contain commands that are passed as options to the ifconfig command, which is used to start DHCP on the client. The file is located in the /etc directory on Oracle Solaris DHCP client systems.

No specific man page, see dhcp(5)

interface.dhc

Contains the configuration parameters that are obtained from DHCP for the given network interface. The client caches the current configuration information in /etc/dhcp/interface.dhc when the interface's IP address lease is dropped. For example, if DHCP is used on the qe0 interface, the dhcpagent caches the configuration information in /etc/dhcp/qe0.dhc. The next time DHCP starts on the interface, the client requests to use the cached configuration if the lease has not expired. If the DHCP server denies the request, the client begins the standard process for DHCP lease negotiation.

No specific man page, see dhcpagent(1M)

dhcpagent

Sets parameter values for the dhcpagent client daemon. The path to the file is /etc/default/dhcpagent. See the /etc/default/dhcpagent file or the dhcpagent(1M) man page for information about the parameters.

dhcpagent(1M)

DHCP inittab

Defines aspects of DHCP option codes, such as the data type, and assigns mnemonic labels. See the dhcp_inittab(4) man page for more information about the file syntax.

On the client, the information in the /etc/dhcp/inittab file is used by dhcpinfo to provide more meaningful information to human readers of the information. On the DHCP server system, this file is used by the DHCP daemon and management tools to obtain DHCP option information.

The /etc/dhcp/inittab file replaces the /etc/dhcp/dhcptags file that was used in previous releases. DHCP Option Information provides more information about this replacement.

dhcp_inittab(4)

DHCP Option Information

Historically, DHCP option information has been stored in several places, including the server's dhcptab table, the client's dhcptags file, and internal tables of various programs. In the Solaris 8 release and later releases, the option information is consolidated in the /etc/dhcp/inittab file. See the dhcp_inittab(4) man page for detailed information about the file.

The Oracle Solaris DHCP client uses the DHCP inittab file as a replacement for the dhcptags file. The client uses the file to obtain information about option codes that were received in a DHCP packet. The in.dhcpd, snoop, and dhcpmgr programs on the DHCP server use the inittab file as well.

Determining if Your Site Is Affected

Most sites that use Oracle Solaris DHCP are not affected by the switch to the /etc/dhcp/inittab file. Your site is affected if you meet all of the following criteria:

When you upgrade, the upgrade log notifies you that your dhcptags file had been modified and that you should make changes to the DHCP inittab file.

Differences Between dhcptags and inittab Files

The inittab file contains more information than the dhcptags file. The inittab file also uses a different syntax.

A sample dhcptags entry is as follows:

33 StaticRt - IPList Static_Routes

33 is the numeric code that is passed in the DHCP packet. StaticRt is the option name. IPList indicates that the data type for StaticRt must be a list of IP addresses. Static_Routes is a more descriptive name.

The inittab file consists of one-line records that describe each option. The format is similar to the format that defines symbols in dhcptab. The following table describes the syntax of the inittab file.

Option

Description

option-name

Name of the option. The option name must be unique within its option category, and not overlap with other option names in the Standard, Site, and Vendor categories. For example, you cannot have two Site options with the same name, and you should not create a Site option with the same name as a Standard option.

category

Identifies the namespace in which the option belongs. Must be one of the following: Standard, Site, Vendor, Field, or Internal.

code

Identifies the option when sent over the network. In most cases, the code uniquely identifies the option, without a category. However, in the case of internal categories such as Field or Internal, a code might be used for other purposes. The code might not be globally unique. The code should be unique within the option's category, and not overlap with codes in the Standard and Site fields.

type

Describes the data that is associated with this option. Valid types are IP, ASCII, Octet, Boolean, Unumber8, Unumber16, Unumber32, Unumber64, Snumber8, Snumber16, Snumber32, and Snumber64. For numbers, an initial U or S indicates that the number is unsigned or signed. The digits at the end indicate how many bits are in the number. For example, Unumber8 is an unsigned 8-bit number. The type is not case sensitive.

granularity

Describes how many units of data make up a whole value for this option.

maximum

Describes how many whole values are allowed for this option. 0 indicates an infinite number.

consumers

Describes which programs can use this information. Consumers should be set to sdmi, where:

s

snoop

d

in.dhcpd

m

dhcpmgr

i

dhcpinfo

A sample inittab entry is as follows:

StaticRt - Standard, 33, IP, 2, 0, sdmi

This entry describes an option that is named StaticRt. The option is in the Standard category, and is option code 33. The expected data is a potentially infinite number of pairs of IP addresses because the type is IP, the granularity is 2, and the maximum is infinite (0). The consumers of this option are sdmi: snoop, in.dhcpd, dhcpmgr, and dhcpinfo.

Converting dhcptags Entries to inittab Entries

If you previously added entries to your dhcptags file, you must add corresponding entries to the new inittab file if you want to continue using the options you added to your site. The following example shows how a sample dhcptags entry might be expressed in inittab format.

Suppose you had added the following dhcptags entry for fax machines that are connected to the network:

128 FaxMchn - IP Fax_Machine

The code 128 means that the option must be in the Site category. The option name is FaxMchn, and the data type is IP.

The corresponding inittab entry might be:

FaxMchn SITE, 128, IP, 1, 1, sdmi

The granularity of 1 and the maximum of 1 indicate that one IP address is expected for this option.