The Solaris DHCP server runs as a daemon in the Solaris operating environment on a host system. The server has two basic functions:
Managing IP addresses - The server controls a range of IP addresses, and allocates them to clients, either permanently or for a defined period of time. The DHCP server uses a lease mechanism to determine how long a client can use a non-permanent address. When the address is no longer in use, it is returned to the pool and can be reassigned. The server maintains information about the binding of IP addresses to clients in its DHCP network tables, ensuring that no address is used by more than one client.
Providing network configuration for clients - The server assigns an IP address and provides other information for network configuration, such as a hostname, broadcast address, network subnet mask, default gateway, name service, and potentially much more information. The network configuration information is obtained from the server's dhcptab database.
The Solaris DHCP server can also be configured to perform the following additional functions:
Responding to BOOTP client requests - The server listens for broadcasts from BOOTP clients discovering a BOOTP server and provides them with an IP address and boot parameters. The information must have been configured statically by an administrator. The DHCP server can perform as a BOOTP server and DHCP server simultaneously.
Relaying requests - The server relays BOOTP and DHCP requests to appropriate servers on other subnets. The server cannot provide DHCP or BOOTP service when configured as a BOOTP relay agent.
Providing network booting support for DHCP clients - The server can provide DHCP clients with information needed to boot over the network: IP address, boot parameters, and network configuration information.
As superuser, you can start, stop, and configure the DHCP server using the DHCP Manager, or by using command line utilities. Generally, the DHCP server is configured to start automatically when the system boots, and stop when the system is shutdown, so starting and stopping the server manually should be an infrequent occurence.
All the data used by the DHCP server is maintained in two data repositories, which you can view and manage using either the DHCP Manager or command-line utilities. The data repositories are:
dhcptab - A file containing configuration information that can be passed to clients.
DHCP network tables - Tables containing information about the DHCP and BOOTP clients residing on the network specified in the table name. For example, the network 134.20.0.0 would have a table named 134_20_0_0.
The DHCP data can be stored in files on a local directory, or in a NIS+ database. "Choosing the Data Store" discusses selecting a data storage method.
The dhcptab file contains all the information that clients can obtain from the DHCP server. The DHCP server scans the file each time it starts.
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. For example, some commonly used standard options are shown in the following table.
Table 8-1 Sample DHCP Standard Options
Code |
Label |
Description |
---|---|---|
1 |
Subnet |
Subnet mask IP address |
3 |
Router |
IP address for router |
6 |
DNSserv |
IP address for DNS server |
12 |
Hostname |
Text string for client hostname |
15 |
DNSdmain |
DNS domain name |
Some options are automatically assigned values when the administrator provides information during server configuration. The administrator 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 file is described in dhcptab(4). In DHCP Manager, all the information shown in the Options and Macros tabs comes from the dhcptab file. See "About Options" for more information about options, and "About Macros" for more information about macros.
Note that the dhcptab file is a text file, but should not be edited manually. You should use either dhtadm or DHCP Manager to create, delete, or modify options and macros.
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 dhcp_network(4). In DHCP Manager, all the information shown in the Addresses tab is acquired from the network tables.
DHCP Manager is a graphical tool you can use to perform all management duties associated with DHCP services. You can use it to manage the server itself as well as the data the server uses. You can use DHCP Manager with the server in the following ways:
Configure and unconfigure the DHCP server
Start, stop, and restart the DHCP server
Disable and enable DHCP services
Customize server settings
DHCP Manager also allows you to manage the IP addresses, network configuration macros, and network configuration options in the following ways:
View, add, modify, delete, and release IP addresses
View, add, modify, and delete network configuration macros
View, add, modify, and delete non-standard network configuration options
DHCP Manager includes extensive online help for procedures you can perform with the tool.
All DHCP management functions can be performed using command-line utilities. The following table lists the utilities and describes the purpose of each utility. See the man pages for the utilities for detailed information about using them by clicking on the command names in the table.
Table 8-2 DHCP Command-Line Utilities
You configure the DHCP server the first time you run DHCP Manager on the system where you want to run the DHCP server. DHCP Manager server configuration dialogs 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 will be no default values. DHCP Manager prompts for the following information:
Role of the server, either DHCP server or BOOTP relay agent
Data storage method, either local files or NIS+
Length of lease time and whether clients should be able to renew leases
DNS domain name and IP addresses of DNS servers
Network address and subnet mask for the first network you want to be configured for DHCP service
Network type, either LAN or point-to-point
Router discovery or the IP address of a particular router
NIS domain name and IP address of NIS servers
NIS+ domain name and IP address of NIS+ servers
You can also configure the DHCP server using the dhcpconfig command. This utility gathers information from existing system files automatically in order to provide a useful initial configuration. Therefore, you must ensure that the files are correct before running dhcpconfig. See dhcpconfig(1M) for information about the files dhcpconfig uses to obtain information. To make configuration changes after the initial configuration, you must make changes to the system files and rerun dhcpconfig so that it picks up the changes.
The Solaris DHCP server supports the following types of IP address allocation:
Manual allocation - The server provides a specific IP address chosen by the administrator for a specific DHCP client. The address cannot be reclaimed or assigned to any other client.
Automatic, or permanent, allocation - The server provides an IP address that has no expiration time, making it permanently associated with the client until the administrator changes the assignment or the client releases the address.
Dynamic allocation - The server provides an IP address to a requesting client, with a lease for a specific period of time. When the lease expires, the address is taken back by the server and can be assigned to another client. The period of time is determined by the lease time configured for the server.
The administrator determines what information is provided to DHCP clients. When you configure the DHCP server you provide essential information about the network; later, you can add more information you want to provide to clients.
The DHCP server stores network configuration information in the dhcptab database, in the form of option/value pairs and macros. Options are keywords for network data 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 using an option called NISservrs that has a value (a list of IP addresses) 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 the DHCP Manager to assign values to the options, and create macros to group the options. If you prefer a non-graphical tool, you can use dhtadm, the DHCP configuration table management utility, to work with options and macros.
In Solaris DHCP, an option is a piece of network information to be passed to a client. In the DHCP literature, options are also referred to as symbols or tags. An option is defined by a numeric code and a text label, and is then assigned a value.
The DHCP protocol defines a large number of standard options for commonly specified network data: Subnet, Router, Broadcast, NIS+dom, Hostname, and LeaseTim are a few examples. A complete list of standard options is included in the DHCP Manager help. You cannot modify the standard option keywords in any way, but you can assign values to the options that are relevant to your network, and include the option/value pairs 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:
Extended - Reserved for options that are more recent standard DHCP options, that might not yet be included in your DHCP server implementation. You might use this if you know of a standard option that you want to use, but do not want to upgrade your DHCP server.
Site - Reserved for options that are unique to your site. The system administrator creates these options.
Vendor - Reserved for options that should apply only to clients of a particular class, such as hardware or vendor platform. The Solaris DHCP implementation includes a number of vendor options for Solaris clients. For example, the option SrootIP4 is used for specifying the IP address of a server that a client booting from the network should use for its root file system.
Chapter 11, Administering DHCP includes procedures for creating, modifying, and deleting options.
In the Solaris DHCP service, a macro is a collection of network configuration options and the values assigned to them by the system administrator. 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.
When a macro is processed by the server, the network options and values defined in the macro are placed in a DHCP message to a client. Some macros are processed automatically by the server for clients of a particular type.
In order for a macro to be processed automatically, it must be named according to one of the categories shown in the following table.
Table 8-3 Macro Categories for Automatic Processing
Macro Category |
Description |
---|---|
Client class |
The macro name matches a class of client, indicated by the client machine type and/or operating system. For example, if a server has a macro named SUNW.Ultra-1, any client that is a SUNW,Ultra-1 machine automatically receives the values in the SUNW.Ultra-1 macro. |
Network address |
The macro name matches a DHCP-managed network IP address. For example, if a server has a macro named 125.53.224.0, any client connected to the 125.53.224.0 network automatically receives the values in the 125.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 having the client ID 08002011DF32 (derived from the Ethernet address 8:0:20:11:DF:32) automatically receives the values in a macro named 08002011DF32. |
A macro with a name that does not use one of the categories listed in Table 8-3 can be processed only if one of the following is true:
Macro is mapped to an IP address.
Macro is included in another macro that is processed automatically.
Macro is included in another macro that mapped to an IP address.
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.
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, from the more general to the specific. The macros are processed in the following order:
Client class macros - the most general category
Network address macros - more specific than Client class
Macros mapped to IP addresses - more specific than Network address
Client ID macros - the most specific category
A macro that is included in another macro is processed as part of the containing macro.
If the same option is included in more than one macro, the value set 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 contained the lease time option with a value of 24 hours, and a Client ID macro contained the lease time option with a value of 8 hours, the client would receive a lease time of 8 hours.