System Administration Guide, Volume 3

Working With DHCP Options

Options are keywords for network configuration parameters that the DHCP server can pass to clients. In the Solaris DHCP service, the only options that you can create, delete, or modify are those that are not specified as standard options in the Solaris DHCP service. 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 Solaris DHCP client, you must edit the /etc/dhcp/inittab file to add entries for the new options. If you have non-Solaris DHCP clients, refer to the documentation for those clients for information about adding new options or symbols. See "About Options" for more information about options in Solaris DHCP.

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


Note -

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


The following task map lists tasks you must perform to create, modify, and delete DHCP options and the procedures needed to carry them out.

Table 11-8 DHCP Options Task Map

Tasks 

Description 

For Instructions, Go To... 

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 (Command Line)"

"Modifying the 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 (Command Line)"

Delete DHCP options. 

Remove DHCP options you have created. 

"How to Delete DHCP Options (DHCP Manager)"

"How to Delete DHCP Options (Command Line)"

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

Table 11-9 DHCP Option Properties

Option Properties 

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 Solaris DHCP.  

Code 

The code is a unique number 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. Valid data types are: 

ASCII - Text string value. 

BOOLEAN - No value is associated with the Boolean data type. The presence of the option indicates a condition is true, while the absence of the option indicates false. For example, the Hostname option (which is a Standard option and cannot be modified) is a Boolean. If it is included in a macro, it tells the DHCP server that it should consult name services to see if there is a host name associated with the assigned address.  

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

NUMBER - Unsigned number. For example, the MTU option accepts numbers such as 1500.  

OCTET - Uninterpreted hexadecimal ASCII representation of binary data. For example, a client ID uses the octet data type.  

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. A data type of NUMBER may specify a granularity of 1, 2, 4, or 8 octets each. 

Maximum 

The maximum number of values that can be specified for the option. Building on the previous example, a maximum of 2, with a granularity of 2 and a data type of IP Address would mean that 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. It identifies the client class(es) with which the Vendor option is associated. The Class is an ASCII string representing the client machine type and/or operating system, for example, SUNW.Javastation. This type of option makes it possible 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 matching one you specify will receive the options scoped by that class. 

For IA32-based machines, the Vendor client class is always SUNW.i86pc. For Sparc-based machines, the Vendor client class can be obtained by typing uname -i on the client. To specify the Vendor client class, substitute periods for any commans in the string returned by the uname command. For example, if the string SUNW,Ultra-1 is returned by the uname -i command, you should specify the Vendor client class as SUNW.Ultra-1.

Creating DHCP Options

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

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 11-17 Create Option Dialog Box

Graphic

How to Create DHCP Options (DHCP Manager)

  1. Select the Options tab.

  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 may contain up to eight alphanumeric characters and no spaces.

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

    Refer to Table 11-9 for information about each setting.

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

  6. Click OK.

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

How to Create DHCP Options (Command Line)

  1. Become superuser on the DHCP server system.

  2. Type a command using the following format:


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

    is an alphanumeric string of eight characters or less.

    category

    is Site, Extend, or Vendor=list-of-classes, and list-of-classes is a space-separated list of vendor client classes to which the option applies. See Table 11-9 for a information about determining the vendor client class.

    code

    is a numeric value appropriate to the option category, as explained in Table 11-9

    data-type

    is ASCII, IP, BOOLEAN, NUMBER, or OCTET

    granularity

    is a non-negative number, as explained in Table 11-9

    maximum

    is a non-negative number, as explained in Table 11-9

    The following two commands are two examples:


    # dhtadm -A -s NewOpt -d 'Site,130,NUMBER,1,1'
    # dhtadm -A -s NewServ -d 'Vendor=SUNW.Ultra-1 SUNW.SPARCstation10,200,IP,1,1'
    

Modifying DHCP Options

If you have created options for your DHCP service, you can change the properties for an option using either DHCP Manager or the dhtadm command.

You can use thedhtadm -M -s command or DHCP Manager's Option Properties dialog box to modify options.

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

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

Figure 11-18 Option Properties Dialog Box

Graphic

How to Modify DHCP Option Properties (DHCP Manager)

  1. Select the Options tab.

  2. Select the option whose properties you want to change.

  3. Choose Properties from the Edit menu.

    The Option Properties dialog box opens.

  4. Edit the properties as needed.

    See Table 11-9 for information about the properties.

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

  6. Click OK.

How to Modify DHCP Option Properties (Command Line)

  1. Become superuser on the DHCP server system.

  2. Type a command using the following format:


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

    is the option name whose definition you want to change.

    category

    is Site, Extend, or Vendor=list-of-classes, and list-of-classes is a space-separated list of vendor client classes to which the option applies. For example, SUNW.Ultra-1 SUNW.i86pc.

    code

    is a numeric value appropriate to the option category, as explained in Table 11-9.

    data-type

    is ASCII, IP, BOOLEAN, NUMBER, or OCTET.

    granularity

    is a non-negative number, as explained in Table 11-9.

    maximum

    is a non-negative number, as explained in Table 11-9.

    Note that you must specify all of the DHCP option properties with the -d switch, not just the properties you are changing.

    The following two commands are two examples:


    # dhtadm -M -s NewOpt -d 'Site,135,NUMBER,1,1'
    # dhtadm -M -s NewServ -d 'Vendor=SUNW.Ultra-1 SUNW.i86pc,200,IP,1,1' 
    

Deleting DHCP Options

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

How to Delete DHCP Options (DHCP Manager)

  1. Select the Options tab.

  2. Choose Delete from the Edit menu.

    The Delete Options dialog box opens.

  3. Confirm the deletion by clicking OK.

How to Delete DHCP Options (Command Line)

  1. Become superuser on the DHCP server system.

  2. Type a command using the following format:


    # dhtadm -D -s option-name
    

Modifying the 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 are using a DHCP client other than the Solaris DHCP client, please refer to that client's documentation for information about adding options or symbols.

On a Solaris DHCP client, you must edit the /etc/default/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 modify the entry in the client's /etc/default/inittab file accordingly.

Please refer to the dhcp_inittab(4) man page for detailed information about the syntax of the /etc/default/inittab file.


Note -

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