1 <!-- 2 -- ident "%Z%%M% %I% %E% SMI" 3 -- 4 CDDL HEADER START 5 6 The contents of this file are subject to the terms of the 7 Common Development and Distribution License, Version 1.0 only 8 (the "License"). You may not use this file except in compliance 9 with the License. 10 11 You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 12 or http://www.opensolaris.org/os/licensing. 13 See the License for the specific language governing permissions 14 and limitations under the License. 15 16 When distributing Covered Code, include this CDDL HEADER in each 17 file and include the License file at usr/src/OPENSOLARIS.LICENSE. 18 If applicable, add the following below this CDDL HEADER, with the 19 fields enclosed by brackets "[]" replaced with your own identifying 20 information: Portions Copyright [yyyy] [name of copyright owner] 21 22 CDDL HEADER END 23 24 -- Copyright 2003 Sun Microsystems, Inc. All rights reserved. 25 -- Use is subject to license terms. 26 --> 27 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> 28 <html> 29 30 <head> 31 <title>DHCP Manager Help: About Macros and Options</title> 32 <meta NAME="AUTHOR" CONTENT="smorgan"> 33 <meta NAME="KEYWORDS" CONTENT="DHCP"> 34 35 </head> 36 <body bgcolor="#FFFFFF"> 37 38 <a name="top"></a> 39 40 <table border=0 cellspacing=0 cellpadding=0 width=645> 41 42 <!-- Start navigation banner --> 43 44 <tr><td colspan=4 WIDTH="615" align="center" valign="top"><IMG SRC="art/bannersmc.gif" WIDTH=615 BORDER=0 ALT="DHCP Manager Help"> 45 46 </td> 47 </tr> 48 49 <!-- End navigation banner --> 50 51 52 <tr> 53 54 <!-- Start contents block --> 55 56 <td colspan=1 valign="top" width=105> 57 <P> </P> 58 <A HREF="dhcp_main_top.html"><STRONG>Overview</STRONG></A><BR> 59 <A HREF="dhcp_solaris_about.html">Solaris DHCP</A><BR> 60 <IMG SRC="art/tip2.gif" WIDTH=12 HEIGHT=10 BORDER=0 ALT="">About Macros<BR> 61 <A HREF="dhcp_main_hlp.html">Getting Help</A><P> 62 <A HREF="dhcp_relay_ref.html"><STRONG>Servers and Relays</STRONG></A><P> 63 <A HREF="dhcp_net_ref.html"><STRONG>Networks</STRONG></A><P> 64 <A HREF="dhcp_addr_ref.html"><STRONG>Addresses</STRONG></A><P> 65 <A HREF="dhcp_macro_ref.html"><STRONG>Macros</STRONG></A><P> 66 <A HREF="dhcp_option_ref.html"><STRONG>Options</STRONG></A><P> 67 <A HREF="dhcp_main_how.html"><STRONG>How To..</STRONG></A><P> 68 <A HREF="dhcp_main_idx.html"><STRONG>Index</STRONG></A> 69 70 </td> 71 72 <!-- End contents block --> 73 74 <!-- Start column rule --> 75 76 <td colspan=1 width=5 bgcolor="#CCCCCC"> </td> 77 78 <!-- End column spacer --> 79 80 <!-- Start column spacer --> 81 82 <td colspan=1 width=10 bgcolor="#FFFFFF"> </td> 83 84 <!-- End column spacer --> 85 86 87 88 <!-- Start topic block --> 89 90 <td colspan=1 valign="top" bgcolor="#ffffff" width=495> 91 92 93 94 <P> </P> 95 96 <h1>About Macros and Options</H1> 97 98 99 In a DHCP environment, <em>macros</em> are containers for <em>option values</em> that are 100 passed as configuration parameters from the DHCP server to the DHCP client. For example, 101 you might define a macro that contains options specifying a DNS server and print server 102 to be used by all clients using IP addresses owned by a particular DHCP server.<p> 103 104 <em>Options</em> specify the format in which option values are 105 defined in the DHCP server's <tt>dhcptab</tt> (in which all DHCP 106 options and macros are stored). For example, option category, data type, vendor, and granularity all determine the <em>shape</em> of the options 107 contained in your macros. Creating and modifying options is described 108 further in the help pages for <a href="dhcp_option_create.html">Create Option</a> and 109 <a href="dhcp_option_mod.html">Modify Option</a>.<p> 110 111 <h1> 112 Macro Processing 113 </h1> 114 <p> 115 Remember the following points when naming DHCP macros and adding 116 options to macros: 117 </p> 118 <ol> 119 <li> 120 <strong>Automatic processing</strong> occurs for Client Class, 121 Network, and Client ID category macros when the macro category 122 matches the client's class, network address, or client 123 identifier. 124 <br> 125 </li> 126 <li> 127 <strong>Macro categories</strong> determine the order in which 128 macros are processed automatically. 129 <br> 130 </li> 131 <li> 132 <strong>Macro names</strong> determine macro categories, with the 133 exception of IP address macros, which are categorized by their 134 assignment to an IP address.<br> 135 136 <p> 137 For most macros, make your macro names <strong>match the names 138 of the resources or devices</strong> to which you want the 139 macros to apply. For example: 140 </p> 141 <br> 142 <table cellpadding="4" cellspacing="4" border="1"> 143 <tr> 144 <td bgcolor="#CCCFFF" valign="middle" align="left"> 145 <p> 146 For Clients... 147 </p> 148 </td> 149 <td bgcolor="#CCCFFF" valign="middle" align="left"> 150 <p> 151 Name Your Macro 152 </p> 153 </td> 154 </tr> 155 <tr> 156 <td valign="top"> 157 <p> 158 Of a particular client class 159 </p> 160 </td> 161 <td valign="top"> 162 <p> 163 Same name as the DHCP client's client class. The 164 client class is determined by the client vendor. For 165 example, the client class name for a Sun Blade <sup><font 166 size="-2"> TM</font></sup> 150 client is SUNW,Sun-Blade-100 so 167 you must name your macro <tt> SUNW.Sun-Blade-100</tt> . On 168 Solaris DHCP client systems, you 169 can determine the client class by typing the command 170 <tt> uname -i</tt> on the client machine. Note that 171 macro names cannot contain commas; if a comma appears 172 in the client class, replace it with a period in the 173 macro name. 174 </p> 175 </td> 176 </tr> 177 <tr> 178 <td valign="top"> 179 <p> 180 On a particular network 181 </p> 182 </td> 183 <td valign="top"> 184 <p> 185 Same as the IP address of the network through which the 186 client is connecting; for example, name your macro <tt> 187 10.0.0.0</tt>. 188 </p> 189 </td> 190 </tr> 191 <tr> 192 <td valign="top"> 193 <p> 194 Using a particular IP Address 195 </p> 196 </td> 197 <td valign="top"> 198 <p> 199 Any name, but using the DHCP server's hostname or IP 200 address is recommended; for example, name your macro 201 <tt> shiva</tt> or <tt> 125.53.224.45</tt> . This kind 202 of macro is valuable for use as a configuration macro 203 for all clients obtaining configuration information 204 from this DHCP server. 205 </p> 206 </td> 207 </tr> 208 <tr> 209 <td valign="top"> 210 <p> 211 Identified by a particular client ID 212 </p> 213 </td> 214 <td valign="top"> 215 <p> 216 Same as the unique client identifier; for example, 217 name your macro <tt> 010800201112B7</tt> . 218 </p> 219 </td> 220 </tr> 221 </table> 222 <br> 223 </li> 224 <li> 225 <strong>Order is important.</strong> The order in which macros are 226 processed is significant. If an option is contained in more than 227 one macro, the option value passed to the client is the value 228 assigned in the macro processed last. Macros are processed in the 229 order shown in the illustration.<br> 230 <br> 231 232 <p> 233 <img src="art/macroflow.gif" alt="order of macro processing" vspace="0" hspace="0" border="0" 234 height="225" width="400"> 235 </p> 236 <p> 237 As shown in the illustration, macro processing progresses from 238 the general to the specific. 239 </p> 240 <ul type="disc"> 241 <li> 242 <p> 243 Client Class macros are processed first.<br> 244 </p> 245 </li> 246 <li> 247 <p> 248 Network macros are processed second, superseding any 249 competing settings in Client Class macros.<br> 250 </p> 251 </li> 252 <li> 253 <p> 254 IP Address macros are processed third, superseding any 255 competing settings in previous macros.<br> 256 </p> 257 </li> 258 <li> 259 <p> 260 Client ID macros are processed last, superseding any 261 competing settings in all previous macros.<br> 262 </p> 263 </li> 264 </ul> 265 </li> 266 <li> 267 <p> 268 <strong>Macros can include other macros.</strong> Regardless of a 269 macro's category, it can include other macros so that, for example, 270 a client class macro could be called from an IP Address macro.<br> 271 <br> 272 </li> 273 </ol> 274 <p> 275 276 </p> 277 <br> 278 <A HREF="#top"><small>return to top</small></A> 279 280 <p> </p> 281 282 283 <!-- Don't go past this line! --> 284 285 </td> 286 287 <!-- End topic block --> 288 289 </tr> 290 291 </table> 292 293 <!-- End topic table --> 294 295 </body> 296 </html>