About DHCP Macros

In the Oracle 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

Macro Category

Description

Client class

The macro name matches a class of client, indicated by the client
machine type, operating system, or both. For example, if a server has a macro
named SUNW.Sun-Blade-100, any client whose hardware implementation
is SUNW,Sun-Blade-100 automatically receives the values
in the SUNW.Sun-Blade-100 macro.

Network address

The macro name matches a DHCP-managed network
IP address. For example, if a server has a macro named 10.53.224.0,
any client connected to the 10.53.224.0 network automatically
receives the values in the 10.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
with the client ID 08002011DF32 (derived from the Ethernet
address 8:0:20:11:DF:32) automatically receives the values
in the macro named 08002011DF32.

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 Oracle 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.