Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > D

dhcpclient(1M)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

dhcpclient — Client for Dynamic Host Configuration Protocol Server

SYNOPSIS

dhcpclient [-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

DESCRIPTION

dhcpclient 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.

  • <code> <length> <data>

    00 <length> IFname 01 <length> hostname 02 <length> sname 03 <length> bootfile 04 <length> NIS_domain 05 <length> domain_name 06 <length> lease_duration 07 <length> lease_expiration 08 <length> T1 09 <length> T2 10 <length> htype 11 <length> chaddr 12 <length> IP_addr 13 <length> subnet_mask 14 <length> broadcast_addr 15 <length> default_gateway 16 <length> server_addr 17 <length> boot_server 18 <length> dest_gateway 19 <length> DNS_server 20 <length> LPR_server 21 <length> swap_server 22 <length> NIS_server 23 <length> NTP_server 24 <length> raw_options

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:

1.

It may be possible that the configuration file had been deleted or it may not be available for reading.

2.

The file may have got corrupted and contains irrelevant data for the particular interface.

3.

There may be no configuration information for the particular interface.

4.

User may have specified -n option meaning that a new lease is needed.

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

-G

When this option is used, the client will accept the reply from the DHCP server only if the class-id in the request and reply packet matches.

-N hostname

This option is used to send a hostname. The hostname should be specified as an ASCII string.

-b interface

This option is used during bootup time to obtain a new lease. If the client is trying to obtain the configuration parameters from the server for the first time, then /etc/dhcpclient.data does not exist. So, using this option, the client obtains a new lease for the interface specified.

-d interface

This option is used for dumping the internal data of an interface. A sample dump is shown below.

Interface PPA MAC Type Physical Address lan0 0 ETHER 0x080009709631

-f tracefile

This option is used to specify the file name for the debugging output.

-g class-id

This option is used for specifying the class-id of the device group. class-id should be specified as an ASCII string.

-l debug_level

This option is used for logging of debug information. debug_level specifies the amount of debug information logged. The debugging messages are sent to STDERR.

-m interface

This option is used for maintaining the lease. When invoked with this option, the dhcpclient runs as a daemon. The dhcpclient calculates how much time it needs to sleep before the lease needs to be renewed and then sleeps for that time. When it wakes up, it extends the lease by sending the request to the DHCP server.

-n

This option is used for ignoring the current lease. When this option is used, the current configuration information is discarded and request for a new lease is sent.

-p

This option is used for tracing the packets. It displays the packet contents in a readable format.

-r interface

This option is used for releasing a lease. The dhcpclient releases all the assigned configuration parameters. This is done by sending the DHCPRELEASE message to the server. The dhcpclient then empties the record corresponding to that interface in the configuration file, /etc/dhcpclient.data.

-s server_ipaddress

This option is used to specify the ip address of the DHCP server from which the reply should be accepted. server_ipaddress must be a unicast IP address specified in dotted decimal form.

-t log_type

If the log_type is a non zero value and if the debug_level is low enough for the process to detach from the tty (see syslog(3C)), then, the logging goes to syslog, else it goes to STDERR. This option is used when the dhcpclient is running as a daemon.

-v

This option prints the various version strings of the dhcpclient to stdout.

-x send_attempts

This option is used to specify the number of attempts the packet should be sent before obtaining a reply. send_attempts must be specified as an unsigned number.

-z time_to_wait

This option is used to specify the time interval between successive packet retransmission. time_to_wait will be in seconds.

EXAMPLES

To 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

AUTHOR

dhcpclient was developed by HP.

FILES

/etc/dhcpclient.data

configuration file.

SEE ALSO

auto_parms(1M), bootpd(1M), bootpquery(1M), dhcptools(1M), syslog(3C).

DARPA Internet Request For Comments: RFC1541, RFC1542, RFC1533, RFC1534, Assigned Numbers RFC.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.