How to Delete Options from a DHCP Macro (dhtadm)
Become superuser or a user assigned to the DHCP Management profile.
Type a command of the following format:
# dhtadm -M -m macroname -e 'option='
For example, to remove the ability to negotiate leases in macro bluenote, type the following command:
# dhtadm -M -m bluenote -e 'LeaseNeg='
If an option is specified with no value, it is removed from the macro.
Creating DHCP Macros
You may 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 man page for more information about the dhtadm command.
The following figure shows DHCP Manager's Create Macro dialog box.
Figure 10-16 Create Macro Dialog Box
How to Create a DHCP Macro (DHCP Manager)
Select the Macros tab.
Choose Create from the Edit menu.
The Create Macro dialog box opens.
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 will be processed automatically for appropriate clients. If you use a different name, the macro can only be processed if it is assigned to a specific IP address or included in another macro that is processed. See "Macro Processing by the DHCP Server" for more detailed information.
Click the Select button 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 to select the category you want.
See "About Options" for more information about option categories.
Select the option you want to add to the macro and click OK.
The Macro Properties dialog box displays the selected option in the Option Name field.
Type the value for the option in the Option Value field.
Click Add.
The option is added to the bottom of the list of options displayed for this macro. If you want to change the option's position in the list, select the option and click the arrow keys next to the list to move the option up or down.
Repeat Step 6 through Step 8 for each option you want to add to the macro.
Select Notify DHCP Server of Change when you are finished adding options.
This selection tells the DHCP server to reread the dhcptab to put the change into effect immediately after you click OK.
Click OK.
How to Create a DHCP Macro (dhtadm)
Become superuser or a user assigned to the DHCP Management profile.
Type a command of the following format:
# dhtadm -A -m macroname -d ':option=value:option=value:option=value:'
There is no limit to the number of option/value pairs included in the argument to -d. The argument must begin and end with colons, with colons separating each option/value pair.
For example, to create macro bluenote, type the following command:
# dhtadm -A -m bluenote -d \ ':Router=10.63.6.121:LeaseNeg=_NULL_VALUE:'DNSserv=10.63.28.12:'
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.
How to Delete a DHCP Macro (DHCP Manager)
Select the Macros tab.
Select the macro you want to delete.
The Delete Macro dialog box prompts you to confirm that you want to delete the specified macro.
Select Notify DHCP Server of Change.
Click OK.
How to Delete a DHCP Macro (dhtadm)
Become superuser or a user assigned to the DHCP Management profile.
Type a command of the following format:
# dhtadm -D -m macroname
For example, to delete macro bluenote, type the following command:
# dhtadm -D -m bluenote
Working With DHCP Options (Task Map)
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. See the dhcp_inittab man page for more information about this file.
If you have DHCP clients that are not Solaris 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.
Task | Description | Instructions |
---|---|---|
Create DHCP options. | Add new options for information not covered by a standard DHCP option. | "How to Create DHCP Options (DHCP Manager)" |
Modify DHCP options. | Change properties of DHCP options you have created. | |
Delete DHCP options. | Remove DHCP options you have created. |
Before you create options, you should be familiar with the option properties listed in the following table.
Table 10-3 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). OCTET - Uninterpreted hexadecimal ASCII representation of binary data. For example, a client ID uses the octet data type. UNUMBER8, UNUMBER16, UNUMBER32, UNUMBER64, SNUMBER8, SNUMBER16, SNUMBER32, or SNUMBER64 - Numeric value. An initial U or S indicates whether the number is unsigned or signed, and the digits at the end indicates the amount of bits in the number. |
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. 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 that represents the client machine type and/or operating system, for example, SUNW.Ultra5_10. 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 that matches one you specify will 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 Solaris clients, refer to the vendor documentation for the DHCP client for the client class. For Solaris clients, the Vendor client class can be obtained by typing uname -i 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,Ultra5_10 is returned by the uname -i command, you should specify the Vendor client class as SUNW.Ultra5_10. |