1 DHCPINFO(1) User Commands DHCPINFO(1) 2 3 4 5 NAME 6 dhcpinfo - display values of parameters received through DHCP 7 8 SYNOPSIS 9 dhcpinfo [-c] [-i interface] [-n limit] [-v 4|6] code 10 11 12 dhcpinfo [-c] [-i interface] [-n limit] [-v 4|6] identifier 13 14 15 DESCRIPTION 16 The dhcpinfo utility prints the DHCP-supplied value(s) of the parameter 17 requested on the command line. The parameter can be identified either 18 by its numeric code in the DHCP specification, or by its mnemonic 19 identifier, as listed in dhcp_inittab(4). This command is intended to 20 be used in command substitutions in the shell scripts invoked at system 21 boot or in event scripts as described in dhcpagent(1M). It first 22 contacts the DHCP client daemon dhcpagent(1M) to verify that DHCP has 23 successfully completed on the requested interface. If DHCP has 24 successfully completed on the requested interface, dhcpinfo retrieves 25 the values for the requested parameter. Parameter values echoed by 26 dhcpinfo should not be used without checking its exit status. See 27 exit(1). 28 29 30 See dhcp_inittab(4) for the list of mnemonic identifier codes for all 31 DHCP parameters. See RFC 2132, DHCP Options and BOOTP Vendor Extensions 32 for more details on DHCPv4 parameters, and RFC 3315, Dynamic Host 33 Configuration Protocol for IPv6 (DHCPv6), for more details on DHCPv6 34 parameters. 35 36 Output Format 37 The output from dhcpinfo consists of one or more lines of ASCII text; 38 the format of the output depends upon the requested parameter. The 39 number of values returned per line and the total number of lines output 40 for a given parameter are determined by the parameter's granularity and 41 maximum values, respectively, as defined by dhcp_inittab(4). 42 43 44 The format of each individual value is determined by the data type of 45 the option, as determined by dhcp_inittab(4). The possible data types 46 and their formats are listed below: 47 48 49 50 51 Data Type Format dhcp_inittab(4) type 52 Unsigned Number One or more decimal digits UNUMBER8, UNUMBER16, 53 UNUMBER32, UNUMBER64 54 Signed Number One or more decimal digits, SNUMBER8, SNUMBER16, 55 optionally preceded by a SNUMBER32, SNUMBER64 56 minus sign 57 IP Address Dotted-decimal notation IP 58 IPv6 Address Colon-separated notation IPv6 59 Octet The string 0x followed by a OCTET 60 two-digit hexadecimal value 61 String Zero or more ASCII characters ASCII 62 DUID DHCP Unique Identifier text DUID 63 Domain Name Standard dot-separated domain DOMAIN 64 name, RFC 1035 format 65 66 67 OPTIONS 68 The following options are supported: 69 70 -c 71 Displays the output in a canonical format. This format 72 is identical to the OCTET format with a granularity of 73 1. 74 75 76 -i interface 77 Specifies the interface to retrieve values for DHCP 78 parameters from. If this option is not specified, the 79 primary interface is used. 80 81 If a primary interface has not been selected for the 82 system by ifconfig(1M) or for this command by -i, the 83 system automatically selects an interface to consider 84 as primary for the current command invocation. The 85 selection chooses the interface whose name sorts 86 lexically first, and that has DHCP parameters attached. 87 This selection does not affect system state. Use 88 ifconfig(1M) to set a primary interface. 89 90 The recommended practice in the dhcpagent(1M) eventhook 91 scripts is to specify the desired interface with -i, 92 rather than relying on primary selection. 93 94 For DHCPv6, the interface name used should be the name 95 of the physical interface, not one of the logical 96 interfaces created by dhcpagent. 97 98 99 -n limit 100 Limits the list of values displayed to limit lines. 101 102 103 -v 4|6 104 Specifies the DHCP version to query. Use -v 4 for 105 DHCPv4 and -v 6 for DHCPv6. 106 107 108 OPERANDS 109 The following operands are supported: 110 111 code 112 Numeric code for the requested DHCP parameter, as defined 113 by the DHCP specification. Vendor options are specified 114 by adding 256 to the actual vendor code for DHCPv4, and 115 65536 for DHCPv6. 116 117 118 identifier 119 Mnemonic symbol for the requested DHCP parameter, as 120 listed in dhcp_inittab(4). 121 122 123 EXIT STATUS 124 The following exit values are returned: 125 126 0 127 Successful operation. 128 129 130 2 131 The operation was not successful. The DHCP client daemon might not 132 be running, the interface might have failed to configure, or no 133 satisfactory DHCP responses were received. 134 135 136 3 137 Bad arguments. 138 139 140 4 141 The operation timed out. 142 143 144 6 145 System error (should never occur). 146 147 148 ATTRIBUTES 149 See attributes(5) for descriptions of the following attributes: 150 151 152 153 154 +--------------------+-----------------+ 155 | ATTRIBUTE TYPE | ATTRIBUTE VALUE | 156 +--------------------+-----------------+ 157 |Interface Stability | Committed | 158 +--------------------+-----------------+ 159 160 SEE ALSO 161 dhcpagent(1M), ifconfig(1M), dhcp_inittab(4), attributes(5) 162 163 164 Alexander, S., and R. Droms, RFC 2132, DHCP Options and BOOTP Vendor 165 Extensions, Silicon Graphics, Inc., Bucknell University, March 1997. 166 167 168 Droms, R. , RFC 3315, Dynamic Host Configuration Protocol for IPv6 169 (DHCPv6), Cisco Systems, July 2003. 170 171 172 Mockapetris, P.V. , RFC 1035, Domain names - implementation and 173 specification, ISI, November 1987. 174 175 176 177 February 13, 2020 DHCPINFO(1)