dhcp-eval(5) File Formats Manual dhcp-eval(5) (NAME) dhcp-eval - ISC DHCP (DESCRIPTION) () () DHCP Internet Systems Consortium . (syntax) . : (REFERENCE: CONDITIONAL BEHAVIOUR) if else elsif switch case . ( option) . : IF (CONDITIONAL BEHAVIOUR: IF) if : if option dhcp-user-class = "accounting" { max-lease-time 17600; option domain-name "accounting.example.org"; option domain-name-servers ns1.accounting.example.org, ns2.accounting.example.org; } elsif option dhcp-user-class = "sales" { max-lease-time 17600; option domain-name "sales.example.org"; option domain-name-servers ns1.sales.example.org, ns2.sales.example.org; } elsif option dhcp-user-class = "engineering" { max-lease-time 17600; option domain-name "engineering.example.org"; option domain-name-servers ns1.engineering.example.org, ns2.engineering.example.org; } else { max-lease-time 600; option domain-name "misc.example.org"; option domain-name-servers ns1.misc.example.org, ns2.misc.example.org; } : # example.org filters DNS at its firewall, so we have to use their DNS # servers when we connect to their network. If we are not at # example.org, prefer our own DNS server. if not option domain-name = "example.org" { prepend domain-name-servers 127.0.0.1; } if elsif (boolean) . . (true) if elsif else . elsif elsif . elsif else . if elsif else else . null (false) . : SWITCH (CONDITIONAL BEHAVIOUR: SWITCH) switch . switch (option dhcp-user-class) { case "accounting": max-lease-time 17600; option domain-name "accounting.example.org"; option domain-name-servers ns1.accounting.example.org, ns2.accounting.example.org; case "sales": max-lease-time 17600; option domain-name "sales.example.org"; option domain-name-servers ns1.sales.example.org, ns2.sales.example.org; break; case "engineering": max-lease-time 17600; option domain-name "engineering.example.org"; option domain-name-servers ns1.engineering.example.org, ns2.engineering.example.org; break; default: max-lease-time 600; option domain-name "misc.example.org"; option domain-name-servers ns1.misc.example.org, ns2.misc.example.org; break; } switch case . switch . switch case . case break . default break . default . (BOOLEAN EXPRESSIONS) DHCP : data-expression-1 = data-expression-2 = true false . null null . data-expression-1 ~= data-expression-2 data-expression-1 ~~ data-expression-2 ~= ~~ ( ) regex(7) data- expression-1 data-expression-2 true false . null false . ~~ ~= (case-insensitive). boolean-expression-1 and boolean-expression-2 and true true . false . null null . boolean-expression-1 or boolean-expression-2 or true true . false . null null . not boolean-expression not boolean-expression false true boolean-expression true false . boolean-expression null null . exists option-name exists DHCP true . known known -- (host declaration) -- true . static static (lease) (static) true . (DATA EXPRESSIONS) . . substring (data-expr, offset, length) substring offset length . Offset length . data-expr offset length null null . offset . length offset offset . suffix (data-expr, length) suffix data-expr length . Length . data-expr length null null . suffix . lcase (data-expr) lcase data-expr (lower case) . data-expr null null . ucase (data-expr) ucase data-expr (upper case) . data-expr null null . option option-name option . config-option option-name config-option DHCP . gethostname() gethostname() gethostname() ( NULL) . dhclient dhclient.conf . hardware hardware (link- layer) . hlen RFC2131 null . ethernet () token-ring () fddi () . IETF RFC2131 ( ISC DHCP doc/ ). packet (offset, length) packet null . Offset length substring . string ASCII . ('\') C : '\t' TAB '\r' (carriage return) '\n' (newline) '\b' (bell) . (octal) '\nnn' nnn 0400 . (hexadecimal) '\xnn' nn 0xff . colon-separated hexadecimal list (octet) (:) . concat (data-expr1, ..., data-exprN) () . null null . reverse (numeric-expr1, data-expr2) . . leased-address IP IP . IP "there is no lease associated with this client" (debug) (syslog) ( dhcpd.conf ). binary-to-ascii (numeric-expr1, numeric-expr2, data-expr1, data-expr2) data-expr2 data-expr2 . data-expr1 . numeric- expr1 ( ) . numeric-expr2 ( ) . PTR IP : concat (binary-to-ascii (10, 8, ".", reverse (1, leased-address)), ".in-addr.arpa."); encode-int (numeric-expr, width) numeric-expr ( - network byte order) . null null . pick-first-value (data-expr1 [ ... exprn ] ) pick-first-value . null . . null null . host-decl-name host-decl-name (host declaration) . null . (NUMERIC EXPRESSIONS) . . . : (operation) (symbol) (add) + (subtract) - (divide) / (multiply) * (modulus) % and (bitwise and) & or (bitwise or) | xor (bitwise xor) ^ extract-int (data-expr, width) extract-int (network byte order) . Width . . null . lease-time -- . number . client-state . DHCP . : o Booting - DHCP INIT IP . DHCPDISCOVER (broadcast) . o Reboot - DHCP INIT- REBOOT . IP . DHCPREQUEST . BOUND . o Select - DHCP SELECTING - DHCPOFFER DHCPOFFER . SELECTING . o Request - DHCP REQUESTING - DHCPOFFER . DHCPREQUEST . o Bound - DHCP BOUND - IP . . o Renew - DHCP RENEWING - IP . DHCPREQUEST ( / unicast) . o Rebind - DHCP REBINDING - IP . DHCPREQUEST . : (REFERENCE: ACTION EXPRESSIONS) log (priority, data-expr) (logging) . (fatal error info debug) . concat . execute (command-path [, data-expr1, ... data-exprN]); execute . . . execute (synchronous) () . ( "on commit" dhcpd.conf) (timeout) . . . . ASCII dhcpd.conf ("\nnn") . execute . (scope) . parse-vendor-option; parse-vendor-option ( - vendor option) . vendor-option-space (vendor space) . . . : (REFERENCE: DYNAMIC DNS UPDATES) DDNS dhcpd.conf dhclient.conf . (SEE ALSO) dhcpd.conf(5) dhcpd.leases(5) dhclient.conf(5) dhcp-options(5) dhcpd(8) dhclient(8) RFC2132 RFC2131. (AUTHORS) Internet Systems Consortium : https://www.isc.org dhcp-eval(5)