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 Solaris DHCP server supports the following types of IP address allocation:
Manual allocation - The server provides a specific IP address that you choose for a specific DHCP client. The address cannot be reclaimed or assigned to another client.
Automatic, or permanent, allocation - The server provides an IP address that has no expiration time, making it permanently associated with the client until you change 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.
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 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:
Extended - Reserved for options that have become standard DHCP options but are not yet included in the DHCP server implementation. You might use an extended option if you know of a standard option that you want to use, but you do not want to upgrade your DHCP server.
Site - Reserved for options that are unique to your site. You create these options.
Vendor - Reserved for options that should apply only to clients of a particular class, such as a hardware or vendor platform. The Solaris DHCP implementation includes a number of vendor options for Solaris clients. For example, the option SrootIP4 is used to specify the IP address of a server that a client that boots from the network should use for its root (/) file system.
Chapter 15, Administering DHCP (Tasks) includes procedures for creating, modifying, and deleting DHCP options.
About DHCP Macros
In the 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
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:
The macro is mapped to an IP address.
The macro is included in another macro that is processed automatically.
The macro is included in another macro that is mapped to an IP address.
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:
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, 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 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.
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 Solaris DHCP client is a daemon (dhcpagent) that runs in the Solaris OS 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 Solaris DHCP server. However, this document describes only the Solaris DHCP client.
See Chapter 16, Configuring and Administering DHCP Clients for detailed information about the Solaris DHCP client.