System Administration Guide, Volume 3

Chapter 13 DHCP Reference

This chapter lists information useful regarding DHCP. It explains the relationships between files and the commands that use the files, but does not explain how to use the commands. The commands are linked to their man pages, so you can find information on a command by clicking on it.

DHCP Commands

The following table lists the commands you might find useful in managing DHCP on your network.

Table 13-1 Commands Used in DHCP
 Command Man Page Command Description
dhtadm(1M)

Used to make changes to the options and macros in the dhcptab file. This command is most useful in scripts that you create to automate changes you need to make to your DHCP information. Use dhtadm with the -P option and pipe it through the grep command for a quick way to search for particular option values in the data base.

pntadm(1M)Used to make changes to the DHCP network tables that map client IDs to IP addresses and optionally associate configuration information with IP addresses.
dhcpconfig(1M)Used to configure and unconfigure DHCP servers and BOOTP relay agents. dhcpconfig uses dhtadm and pntadm to create and make changes to dhcptab and DHCP network tables.
in.dhcpd(1M)The DHCP server daemon. This command is used by /etc/init.d/dhcp, the DHCP service startup and shutdown script. You can start in.dhcpd with non-default options, such as -d for debugging.
dhcpmgr(1M)The DHCP Manager, a graphical tool used to configure and manage the DHCP service. DHCP Manager is the recommended Solaris DHCP management tool.
ifconfig(1M)Used at system boot to assign IP addresses to network interfaces, configure network interface parameters or both. On a Solaris DHCP client, ifconfig starts DHCP to get the parameters (including the IP address) needed to configure a network interface.
dhcpinfo(1)Used by system startup scripts on client machines to obtain information (such as hostname) from the DHCP client daemon (dhcpagent) . You can also use dhcpinfo in scripts or at the command line to obtain specified parameter values.
snoop(1M)Used to capture and display the contents of packets being passed across the network. snoop is useful for troubleshooting problems with the DHCP service.
dhcpagent(1M)The DHCP client daemon, which implements the client side of the DHCP protocol.

DHCP Files

The following table lists files associated with Solaris DHCP.

Table 13-2 Files Used by DHCP Daemons and Commands

File Man Pages 

Description 

dhcptab(4)

Table of configuration information recorded as options with assigned values, which are then grouped into macros. The dhcptab file's location is determined by the data store you use for DHCP information.

dhcp_network(4)

Maps IP addresses to client IDs and configuration options. DHCP network tables are named according to the IP address of the network, such as 172.21.32.0. There is no file called dhcp_network. The location of DHCP network tables is determined by the data store you use for DHCP information.

dhcp(4)

Records DHCP daemon startup options and the location and type of data store used by DHCP service. The file is located in the /etc/default directory.

nsswitch.conf(4)

Specifies the location of name service databases and the order in which to search them when looking up various kinds of information. The nsswitch.conf file is consulted when you configure a DHCP server in order to obtain accurate configuration information. The file is located in the /etc directory.

resolv.conf(4)

Contains information used by the DNS resolver. 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.

dhcp.interface

Indicates that DHCP is to be used on the client's network interface specified in the file name, such as dhcp.qe0. The dhcp.interface file might contain commands that are passed as options to the ifconfig interface dhcp start option command used to start DHCP on the client. The file is located in the /etc directory.

interface.dhc

Contains the configuration parameters 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. 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 DHCP lease negotiation process.

dhcpagent

Sets parameter values for the dhcpagent client daemon. The path to the file is /etc/default/dhcpagent. See the file itself or the daemon's dhcpagent(1M) man page for information about the parameters.

dhcp_inittab(4)

Defines aspects of DHCP option codes, such as the data type, and assigns mnemonic labels. The information in the /etc/dhcp/inittab file is used by dhcpinfo to provide more meaningful information to human readers of the information. This file replaces the /etc/dhcp/dhcptags file. "DHCP Option Information" provides more information about this replacement.

DHCP Option Information

Historically, DHCP option information has been stored in several places in Solaris DHCP, including the server's dhcptab file, the client's dhcptags file, and internal tables of in.dhcpd, snoop, dhcpinfo, and dhcpmgr. In an effort to begin consolidating option information, the Solaris 8 DHCP product has introduced the /etc/dhcp/inittab file. See dhcp_inittab(4) for detailed information about the file.

The inittab file is currently used on the Solaris DHCP client as a replacement for the dhcptags file. The dhcptags file was used to obtain information about option codes received in its DHCP packet. The inittab file now provides this information. In future releases, the in.dhcpd, snoop, and dhcpmgr programs on the DHCP server might use this file as well.


Note -

Most sites using Solaris DHCP are not affected by this change. Your site is affected only if you are upgrading to Solaris 8, you previously created new DHCP options and modified the /etc/dhcp/dhcptags file, and want to retain the changes. When you upgrade, the upgrade log will notify you that your dhcptags file was modified and that you should make changes to the inittab file.


Differences Between dhcptags and inittab

The inittab file contains more information than the dhcptags file, and the syntax used is different.

A sample dhcptags entry is:

33 StaticRt - IPList Static_Routes

where 33 is the numeric code that is passed in the DHCP packet, StaticRt is the option name, IPList indicates the expected data is a list of IP addresses, and Static_Routes is a more descriptive name.

The inittab file consists of one-line records describing each option. The format is similar to the format for defining symbols in dhcptab. The syntax of the inittab is described in the following table.

Table 13-3 DHCP inittab Syntax

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 Standard, Site, Vendor, Field, or Internal. 

code

Identifies the option when it is sent over the network. In most cases, the code uniquely identifies the option, without a category. However, in the case of internal categories like Field or Internal, a code might be used for other purposes and thus 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 associated with this option. Valid types are IP, Ascii, Octet, Number, Bool, Unumber8, Unumber16, Unumber32, Snumber8, Snumber16, and Snumber32. For numbers, a preceding `U' or `S' indicates whether the number is unsigned or signed, and the trailing number indicates the number of bits in the number.  

granularity

Describes how many units of data make up a whole value for this option. In the case of Number, granularity describes the number of bytes in the number.  

maximum

Describes how many whole values are allowed for this option. 0 indicates an infinite number. 

consumers

Describes which programs can use this information. This should be set to sdmi, where:

    s - snoop


    d - in.dhcpd


    m - dhcpmgr


    i - dhcpinfo


A sample inittab entry is:

StaticRt Standard, 33, IP, 2, 0, sdmi

This entry describes an option named StaticRt, which 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, granularity is 2, and 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. 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 connected to the network:

128 FaxMchn - IP Fax_Machine

The code 128 means that it must be in the site category, the option name is FaxMchn, the data type is IP.

The corresponding inittab entry might be:

FaxMchn SITE, 128, IP, 1, 1, sdmi

The granularity of 1 and maximum of 1 indicate that one IP address is expected for this option.

ARP Assignments for Network Hardware

The ARP (Address Resolution Protocol) assignment for the network hardware is specified at the beginning of a client ID in DHCP network tables. Use the following table to determine what code to use in your client ID.

The codes are assigned by the Internet Assigned Numbers Authority (IANA) in the ARP registrations section of the Assigned Numbers standard at http://www.iana.com/numbers.html.

Table 13-4 ARP Types

Code 

Hardware Type 

Ethernet (10Mb) 

Experimental Ethernet (3Mb) 

Amateur Radio AX.25 

Proteon ProNET Token Ring 

Chaos 

IEEE 802  

ARCNET 

Hyperchannel 

Lanstar 

10 

Autonet Short Address 

11 

LocalTalk 

12 

LocalNet (IBM PCNet or SYTEK LocalNET) 

13 

Ultra link 

14 

SMDS 

15 

Frame Relay 

16 

Asynchronous Transmission Mode (ATM) 

17 

HDLC 

18 

Fibre Channel 

19 

Asynchronous Transmission Mode (ATM) 

20 

Serial line 

21 

Asynchronous Transmission Mode (ATM) 

22 

MIL-STD-188-220 

23 

Metricom 

24 

IEEE 1394.1995 

25 

MAPOS 

26 

Twinaxial 

27 

EUI-64  

28 

HIPARP