0. Introduction

This is an RFC2131 and RFC1541 compliant DHCP client daemon. RFC1541
was obsoleted by RFC2131, but there are still some RFC1541 compliant
DHCP servers. dhcpcd gets an IP address and other information from a
corresponding DHCP server, configures the network interface
automatically, and tries to renew the lease time according to RFC2131
or RFC1541 depending on the command line option.

1. Install

Do 'make' followed by 'make install'.

2. How to Use It

Invoke the client by typing 'dhcpcd'. Note that you should NOT
explicitly put it in the background with the '&' character -
background processing is automatic unless 'dhcpcd' was
compiled with -DDEBUG flag. Dhcpcd will fork into background
as soon as it configures the interface. By default, dhcpcd will
attach to 'eth0' unless you explicitly give an interface name on the
command line.
Please note that 'dhcpcd -c filename' usage is no longer supported
in v.1.3. This is because processing in system bootup scripts
might depend on the outcome of interface configuration process
and hence 'dhcpcd' should return some useful exit code to the parent
process before forking into background. The more appropriate way
to invoke 'dhcpcd' in system bootup scripts is as e.g:

-- - - - - - - - - -
if dhcpcd; then
  portmap
  inetd
  [...]
  sendmail -bd
fi
- - - - - - - - - - -

So the bootup process will wait until 'dhcpcd' configures
interface or until dhcpcd times out before proceeding further.

3. Supported DHCP Options

The current version of dhcpcd supports the following DHCP options:

  o lease time
  o renewal (T1) time
  o rebind (T2) time
  o netmask
  o broadcast address
  o router
  o time server
  o DNS
  o lpr server
  o host name
  o domain name
  o NTP server
  o NIS domain name

dhcpcd uses the netmask and broadcast address options if it gets these
options from the DHCP server. It uses the 'natural' netmask and
broadcast address if it does not get those options. dhcpcd configures
the host name by using the 'sethostname' system call if it gets the
host name option. It configures the NIS domain name by using the
'setdomainname' system call if it gets the NIS domain name option. It
creates the file '/etc/resolv.conf' if it gets DNS and domain
name options.  It also creates the file '/etc/dhcpc/ntp.conf' if it
gets NTP server option. The host name, NIS domain name, lpr server,
NTP server, and time server option values are written into the file 
'/etc/dhcpc/dhcpcd-ifname.info' (ifname is actually replaced with the
network interface name like "eth0").


5. Cache File

dhcpcd saves the assigned IP address to the file
'/etc/dhcpc/dhcpcd-interface.cache' (the word 'interface' is actually
replaced with the interface name like eth0, etc. to which dhcpcd is
attached) so that it can try to use that IP address when it is invoked
next time. Remove the file '/etc/dhcpc/dhcpcd-interface.cache' before
you invoke dhcpcd unless you like using the previously assigned IP
address.


6. PCMCIA

dhcpcd can be automatically invoked when the PCMCIA card service gets
started. There is a sample 'network' shell script for pcmcia-cs in
the directory './pcmcia'. Read the file './pcmcia/README' for more
details.


7. Cable Modems and ADSL Modems

DHCP servers used in some cable modem servecices and ADSL services
require DHCP clients to include the hostname option having a specific
string provided by the service providers when the clients send the
DHCP_DISCOVER and DHCP_REQUEST messages. Try '-h' option in the case
you are using either cable modem service or ADSL service and dhcpcd
outputs the "no DHCP_OFFER messages" error message.


8. Other Information

dhcpcd sends DHCP_RELEASE message to the DHCP server, deletes the
/etc/dhcpc/dhcpcd-interface.cache file and brings the attached
network interface down when it gets SIGHUP signal. It will
not send DHCP_RELEASE message and will not delete
/etc/dhcpc/dhcpcd-interface.cache file in a case it gets
SIGTERM as normally happens upon reboot.

dhcpcd currently does not support DHCP_INFORM message.

dhcpcd does not work in the case that the same DHCP option
(e.g. domain name) appears multiple times in a message. dhcpcd simply
uses the option which appeared last. This happens only when options
have a long (more than 255 characters) value. This limitation will be
fixed in the next release. 

9. In case dhcpcd does not work:
   Run 'dhcpcd -d' and mail me the relevant messages
   from /var/log/debug file. Also run
   tcpdump -evvn -i eth0
   and mail me the results of that.
   If the things are too bad for you,
   uncomment -DDEBUG flag in Makefile
   and recompile 'dhcpcd'. Run 'dhcpcd -d'
   and mail me what you see.

   Sergei Viznyuk <sviznyuk@columbus.rr.com>
   
