United States-English |
|
|
HP-UX Reference > Ddhcpclient(1M)HP-UX 11i Version 3: February 2007 |
|
NAMEdhcpclient — Client for Dynamic Host Configuration Protocol Server SYNOPSISdhcpclient [-G] [-N hostname] -b interface [-f tracefile] [-g class-id] [-l debug_level] [-n] [-p] [-s server_ipaddress] [-t log_type] [-x send_attempts] [-z time_to_wait] dhcpclient -d interface [-s server_ipaddress] dhcpclient [-N hostname] [-f tracefile] [-l debug_level] -m interface [-p] [-s server_ipaddress] [-t log_type] [-z time_to_wait] dhcpclient [-f tracefile] [-l debug_level] [-p] -r interface [-s server_ipaddress] [-t log_type] dhcpclient -v DESCRIPTIONdhcpclient is used to obtain the configuration parameters from the Dynamic Host Configuration Protocol (DHCP) server ( bootpd(1M)) to configure the host. Currently, dhcpclient supports 10bt (10BaseT) and 100bt (100BaseT) Ethernet networks only. It does not support FDDI and Token-Ring networks. dhcpclient is invoked by the auto_parms script (see auto_parms(1M)) at boot up. The /etc/rc.config.d/netconf file is used for the configuration of the interfaces. To invoke dhcpclient using the auto_parms script, set the DHCP_ENABLE[index] variable to a non-zero value in the /etc/rc.config.d/netconf file. dhcpclient can also be invoked at the command prompt, when the interface is not configured. Once the dhcpclient obtains the configuration parameters from the server, it is stored in a configuration file named /etc/dhcpclient.data. The configuration parameters are valid for a fixed time, lease time. The configuration information in /etc/dhcpclient.data file will be of the following format.
The length field denotes the length of the data field following it. All these lines collectively indicate one record. The configuration file will have series of records. Since this file contains all the configuration information, it can be used to identify the server from which the configuration parameters were obtained. The configuration file can also be used to obtain the same configuration parameters from the server. So, once the dhcpclient is invoked, it will try to read the configuration file, /etc/dhcpclient.data. While trying to read the /etc/dhcpclient.data file, the following conditions are possible:
For all of the above cases, dhcpclient has to first find the server which is ready for the service. For this purpose, it will send a DHCPDISCOVER message. If the user has specified server_ipaddress using the -s option, then replies only from the specified server will be accepted. The server in turn will reply with the configuration parameters that it can offer. This message is called DHCPOFFER. If the client has sent the DHCPDISCOVER to broadcast address, then it will receive DHCPOFFER from more than one server. The dhcpclient selects one of the DHCPOFFER obtained. Then, it will send DHCPREQUEST to the server, requesting the configuration parameters. The server will reply with a positive acknowledgement called DHCPACK, if it is willing to send the configuration parameters to the host and with a negative acknowledgement, if it is not willing to do so. If the dhcpclient has received DHCPACK, it will copy all the configuration parameters to the configuration file, else, it will send another DHCPDISCOVER message and repeat the whole process. This process is called "Obtaining a new lease". If all the above 4 cases are not true, then the dhcpclient can directly send the DHCPREQUEST message and obtain the configuration parameters as mentioned above. This process is called "Renewing the lease". The various options supported by dhcpclient are as described below. Options
EXAMPLESTo maintain the lease for the interface lan0 and invoke logging in syslog, the following set of commands is invoked at the command prompt: dhcpclient -b lan0 -N "dhcp1" dhcpclient -m lan0 -N "dhcp1" -l 3 -t 1 To trace the packet and get the debugging messages, use: dhcpclient -b lan0 -N "dhcp1" -p -l 8 This is an example of a /etc/dhcpclient.data file. 00 4 lan0 01 5 dhcph 02 0 03 0 04 0 05 0 06 4 4294967295 07 4 4294967295 08 4 0 09 4 0 10 4 1 11 6 8 0 9 25 a5 b1 12 4 192.11.22.107 13 4 255.255.255.0 14 4 0.0.0.0 15 0 16 4 192.11.22.3 17 4 192.11.22.3 18 0 19 0 20 0 21 4 0.0.0.0 22 0 23 0 24 39 63 82 53 63 35 1 5 33 4 ff ff ff ff 36 4 c0 b8 16 3 1 4 ff ff ff 0 c 5 64 68 63 70 68 2 4 ff ff b2 a8 ff SEE ALSOauto_parms(1M), bootpd(1M), bootpquery(1M), dhcptools(1M), syslog(3C). DARPA Internet Request For Comments: RFC1541, RFC1542, RFC1533, RFC1534, Assigned Numbers RFC. |
Printable version | ||
|