System Administration Guide: IP Services

About Macros

In the Solaris DHCP service, a macro is a collection of network configuration options and the values assigned to them by the system administrator. 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.

In order 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 7–3 Macro Categories for Automatic Processing

Macro Category 

Description 

Client class 

The macro name matches a class of client, indicated by the client machine type and/or operating system. For example, if a server has a macro named SUNW.Ultra-1, any client whose hardware implementation is SUNW,Ultra-1 automatically receives the values in the SUNW.Ultra-1 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 7–3 can be processed only if one of the following is true:


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, from the more general to the specific. The macros are processed in the following order:

  1. Client class macros – the most general category

  2. Network address macros – more specific than Client class

  3. Macros mapped to IP addresses – more specific than Network address

  4. 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 containing macro.

If the same option is included in more than one macro, the value set 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 contained the lease time option with a value of 24 hours, and a Client ID macro contained the lease time option with a value of 8 hours, the client would receive a lease time of 8 hours.