📄 dhcp-options.5
字号:
and \fBconfig-option\fR operators in an expression, in which case it returnsall labels after the first label in the \fBfqdn.fqdn\fR suboption - forexample, if the value of \fBfqdn.fqdn\fR is "foo.example.com.",then \fBfqdn.hostname\fR will be "example.com.". If this suboption valueis not set, it means that an unqualified name was sent in the fqdn option,or that no fqdn option was sent at all..RE.PPIf you wish to use any of these suboptions, we strongly recommend that yourefer to the Client FQDN option draft (or standard, when it becomes astandard) - the documentation here is sketchy and incomplete in comparison,and is just intended for reference by people who already understand theClient FQDN option specification..SH THE NETWARE/IP SUBOPTIONSRFC2242 defines a set of encapsulated options for Novell NetWare/IPclients. To use these options in the dhcp server, specify the optionspace name, "nwip", followed by a period, followed by the option name.The following options can be specified:.PP.B option \fBnwip.nsq-broadcast\fR \fIflag\fR\fB;\fR.RS 0.25i.PPIf true, the client should use the NetWare Nearest Server Query tolocate a NetWare/IP server. The behaviour of the Novell client ifthis suboption is false, or is not present, is not specified..PP.RE.B option \fBnwip.preferred-dss\fR \fIip-address\fR [\fB,\fR \fIip-address\fR... ]\fR\fB;\fR.RS 0.25i.PPThis suboption specifies a list of up to five IP addresses, each ofwhich should be the IP address of a NetWare Domain SAP/RIP server(DSS)..RE.PP.B option \fBnwip.nearest-nwip-server\fR \fI\fIip-address\fR [\fB,\fR \fIip-address\fR...]\fR\fB;\fR.RS 0.25i.PPThis suboption specifies a list of up to five IP addresses, each ofwhich should be the IP address of a Nearest NetWare IP server..RE.PP.B option \fBnwip.autoretries\fR \fIuint8\fR\fB;\fR.RS 0.25i.PPSpecifies the number of times that a NetWare/IP client should attemptto communicate with a given DSS server at startup..RE.PP.B option \fBnwip.autoretry-secs\fR \fIuint8\fR\fB;\fR.RS 0.25i.PPSpecifies the number of seconds that a Netware/IP client should waitbetween retries when attempting to establish communications with a DSSserver at startup..RE.PP.B option \fBnwip.nwip-1-1\fR \fIuint8\fR\fB;\fR.RS 0.25i.PPIf true, the NetWare/IP client should support NetWare/IP version 1.1compatibility. This is only needed if the client will be contactingNetware/IP version 1.1 servers..RE.PP.B option \fBnwip.primary-dss\fR \fIip-address\fR\fB;\fR.RS 0.25i.PPSpecifies the IP address of the Primary Domain SAP/RIP Service server(DSS) for this NetWare/IP domain. The NetWare/IP administrationutility uses this value as Primary DSS server when configuring asecondary DSS server..RE.SH DEFINING NEW OPTIONSThe Internet Systems Consortium DHCP client and server provide thecapability to define new options. Each DHCP option has a name, acode, and a structure. The name is used by you to refer to theoption. The code is a number, used by the DHCP server and client torefer to an option. The structure describes what the contents of anoption looks like..PPTo define a new option, you need to choose a name for it that is notin use for some other option - for example, you can't use "host-name"because the DHCP protocol already defines a host-name option, which isdocumented earlier in this manual page. If an option name doesn'tappear in this manual page, you can use it, but it's probably a goodidea to put some kind of unique string at the beginning so you can besure that future options don't take your name. For example, youmight define an option, "local-host-name", feeling some confidencethat no official DHCP option name will ever start with "local"..PPOnce you have chosen a name, you must choose a code. For site-localoptions, all codes between 128 and 254 are reserved for DHCP options,so you can pick any one of these. In practice, some vendors haveinterpreted the protocol rather loosely and have used option codevalues greater than 128 themselves. There's no real way to avoidthis problem, but it's not likely to cause too much trouble inpractice..PPThe structure of an option is simply the format in which the optiondata appears. The ISC DHCP server currently supports a few simpletypes, like integers, booleans, strings and IP addresses, and it alsosupports the ability to define arrays of single types or arrays offixed sequences of types..PPNew options are declared as follows:.PP.B option.I new-name.B code.I new-code.B =.I definition.B ;.PPThe values of.I new-nameand.I new-codeshould be the name you have chosen for the new option and the code youhave chosen. The.I definitionshould be the definition of the structure of the option..PPThe following simple option type definitions are supported:.PP.B BOOLEAN.PP.B option.I new-name.B code.I new-code.B =.B boolean.B ;.PPAn option of type boolean is a flag with a value of either on or off(or true or false). So an example use of the boolean type would be:.nfoption use-zephyr code 180 = boolean;option use-zephyr on;.fi.B INTEGER.PP.B option.I new-name.B code.I new-code.B =.I sign.B integer.I width.B ;.PPThe \fIsign\fR token should either be blank, \fIunsigned\fRor \fIsigned\fR. The width can be either 8, 16 or 32, and refers tothe number of bits in the integer. So for example, the following twolines show a definition of the sql-connection-max option and its use:.nfoption sql-connection-max code 192 = unsigned integer 16;option sql-connection-max 1536;.fi.B IP-ADDRESS.PP.B option.I new-name.B code.I new-code.B =.B ip-address.B ;.PPAn option whose structure is an IP address can be expressed either asa domain name or as a dotted quad. So the following is an example useof the ip-address type:.nfoption sql-server-address code 193 = ip-address;option sql-server-address sql.example.com;.fi.PP.B TEXT.PP.B option.I new-name.B code.I new-code.B =.B text.B ;.PPAn option whose type is text will encode an ASCII text string. Forexample:.nfoption sql-default-connection-name code 194 = text;option sql-default-connection-name "PRODZA";.fi.PP.B DATA STRING.PP.B option.I new-name.B code.I new-code.B =.B string.B ;.PPAn option whose type is a data string is essentially just a collectionof bytes, and can be specified either as quoted text, like the texttype, or as a list of hexadecimal contents separated by colons whosevalues must be between 0 and FF. For example:.nfoption sql-identification-token code 195 = string;option sql-identification-token 17:23:19:a6:42:ea:99:7c:22;.fi.PP.B ENCAPSULATION.PP.B option.I new-name.B code.I new-code.B =.B encapsulate.I identifier.B ;.PPAn option whose type is \fBencapsulate\fR will encapsulate thecontents of the option space specified in \fIidentifier\fR. Examplesof encapsulated options in the DHCP protocol as it currently existsinclude the vendor-encapsulated-options option, the netware-suboptionsoption and the relay-agent-information option..nfoption space local;option local.demo code 1 = text;option local-encapsulation code 197 = encapsulate local;option local.demo "demo";.fi.PP.B ARRAYS.PPOptions can contain arrays of any of the above types except for thetext and data string types, which aren't currently supported inarrays. An example of an array definition is as follows:.nfoption kerberos-servers code 200 = array of ip-address;option kerberos-servers 10.20.10.1, 10.20.11.1;.fi.B RECORDS.PPOptions can also contain data structures consisting of a sequence ofdata types, which is sometimes called a record type. For example:.nfoption contrived-001 code 201 = { boolean, integer 32, text };option contrived-001 on 1772 "contrivance";.fiIt's also possible to have options that are arrays of records, forexample:.nfoption new-static-routes code 201 = array of { ip-address, ip-address, ip-address, integer 8 };option static-routes 10.0.0.0 255.255.255.0 net-0-rtr.example.com 1, 10.0.1.0 255.255.255.0 net-1-rtr.example.com 1, 10.2.0.0 255.255.224.0 net-2-0-rtr.example.com 3;.fi .SH VENDOR ENCAPSULATED OPTIONSThe DHCP protocol defines the \fB vendor-encapsulated-options\fRoption, which allows vendors to define their own options that will besent encapsulated in a standard DHCP option. The format of the.B vendor-encapsulated-optionsoption is either a series of bytes whose format is not specified, ora sequence of options, each of which consists of a single-bytevendor-specific option code, followed by a single-byte length,followed by as many bytes of data as are specified in the length (thelength does not include itself or the option code)..PPThe value of this option can be set in one of two ways. The firstway is to simply specify the data directly, using a text string or acolon-separated list of hexadecimal values. For example:.PP.nfoption vendor-encapsulated-options 2:4:AC:11:41:1: 3:12:73:75:6e:64:68:63:70:2d:73:65:72:76:65:72:31:37:2d:31: 4:12:2f:65:78:70:6f:72:74:2f:72:6f:6f:74:2f:69:38:36:70:63;.fi.PPThe second way of setting the value of this option is to have the DHCPserver generate a vendor-specific option buffer. To do this, youmust do four things: define an option space, define some options inthat option space, provide values for them, and specify that that option space should be used to generate the.B vendor-encapsulated-optionsoption..PPTo define a new option space in which vendor options can be stored,use the \fRoption space\fP statement:.PP.B option.B space.I name.B ;.PPThe name can then be used in option definitions, as described earlier inthis document. For example:.nfoption space SUNW;option SUNW.server-address code 2 = ip-address;option SUNW.server-name code 3 = text;option SUNW.root-path code 4 = text;.fiOnce you have defined an option space and the format of some options,you can set up scopes that define values for those options, and youcan say when to use them. For example, suppose you want to handletwo different classes of clients. Using the option space definitionshown in the previous example, you can send different option values todifferent clients based on the vendor-class-identifier option that theclients send, as follows:.PP.nfclass "vendor-classes" { match option vendor-class-identifier;}option SUNW.server-address 172.17.65.1;option SUNW.server-name "sundhcp-server17-1";subclass "vendor-classes" "SUNW.Ultra-5_10" { vendor-option-space SUNW; option SUNW.root-path "/export/root/sparc";}subclass "vendor-classes" "SUNW.i86pc" { vendor-option-space SUNW; option SUNW.root-path "/export/root/i86pc";}.fi.PPAs you can see in the preceding example, regular scoping rules apply,so you can define values that are global in the global scope, and onlydefine values that are specific to a particular class in the localscope. The \fBvendor-option-space\fR declaration tells the DHCPserver to use options in the SUNW option space to construct the.B vendor-encapsulated-optionsoption..SH SEE ALSOdhcpd.conf(5), dhcpd.leases(5), dhclient.conf(5), dhcp-eval(5), dhcpd(8),dhclient(8), RFC2132, RFC2131, draft-ietf-dhc-agent-options-??.txt..SH AUTHORThe Internet Systems Consortium DHCP Distribution was written by TedLemon under a contract with Vixie Labs. Funding forthis project was provided through Internet Systems Consortium.Information about Internet Systems Consortium can be found at.B http://www.isc.org.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -