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.

dhcpcd-1.3 has been reported to compile and
successfully used on Intel,PPC, and Alpha-based
Linux platforms providing glibc-2.0.5 or later has been
installed. Steve Dunham <dunham@cps.msu.edu> put together
a patch for dhcpcd-1.3 to make it work on
Linux Sparc and ARM platforms. The patch is available at
http://www.cse.msu.edu/~dunham/out/dhcpcd-align.patch.

dhcpcd-1.3 has been reported as compatible with DHCP servers
used by the following network service providers:

1. Time Warner RoadRunner http://www.rr.com/
2. MediaOne Express http://www.mediaoneexpress.com/
3. @Home Networks http://www.home.com/
4. France Telecom ADSL http://www.wanadoo.fr/
5. USWest.net DSL http://www.uswest.com/
6. France CyberCable http://www.cybercable.fr/
7. BellSouth ADSL http://www.bellsouth.net/
8. BCtel Multimedia Gateway ADSL http://www.bctel.net/
9. Cogeco Cable Canada http://www.cogeco.ca/
10.Sympatico High Speed Edition ADSL http://www.hse.sympatico.ca/
11.Adelphia PowerLink http://powerlink.adelphia.net/
12.Videotron, Canada http://www.videotron.ca/
13.Access Cable, Nova Scotia, Canada http://www.accesscable.net/
14.A2000 Cable, Netherlands http://www.a2000.nl/
15.Tele-Communications, Inc http://www.tci.com/
16.Telenet, Belgium http://www.telenet.be/

if you have been successfully using dhcpcd-1.3
on your network please report the fact along
with network provider's name/URL/whatever and dhcpcd version
to the author <sv@phystech.com>.

dhcpcd-1.3 primary web site is
http://www.phystech.com/download/
ftp://ftp.phystech.com/pub/

1. Install

Make sure your kernel is compiled with support for SOCK_PACKET.
Edit Makefile to customize compile time options.
Do 'make' followed by 'make install'. Please note that to compile
dhcpcd-1.3.X you have to install glibc-2.0.5 or later. dhcpcd-1.3.X will
not compile under libc.5
You may want to add the following line to your /etc/syslog.conf file:
local0.*          /var/log/dhcpcd.log
and then refresh syslogd daemon:
kill -1 `cat /var/run/syslogd.pid`

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 follows in
the example below where linux box serves as a router/firewall for
the local network 192.168.12.0.

-- - - - - - - - - -
if dhcpcd; then
  portmap
  inetd
  /usr/sbin/sendmail -bd
  httpd
  echo 1 > /proc/sys/net/ipv4/ip_forward
  if [ "`uname -r | cut -d\. -f3`" -gt 101 ]; then
    ipchains -P forward MASQ
  else
    ipfwadm -F -p deny
    ipfwadm -F -a m -S 192.168.12.0/24 -D 0.0.0.0/0 -W eth0
  fi
  modprobe ip_masq_ftp
fi
- - - - - - - - - - -

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

In a case dhcpcd detects a change in assigned IP address it
will try to execute /etc/dhcpc/dhcpcd-interface.exe program.
The word <interface> is substituted by the actual interface name
like e.g. eth0. Caution: do not use /etc/dhcpcd-interface.exe
as a bootup script. It will not be executed if the assigned IP address
is the same as it was before reboot. The included sample
/etc/dhcpc/dhcpcd-eth0.exe will log the time of IP change
to /var/log/messages file.

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 DNS
  o host name
  o domain name

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. Information File

dhcpcd writes the configuration information into
/etc/dhcpc/dhcpcd-interface.info file. The word 'interface' is actually
replaced with the interface name like eth0, etc. to which dhcpcd is
attached. That file may be included into a Bourne or Korn shell script
to set an environment variables like e.g. HOSTNAME, DOMAIN, NETMASK, etc.

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 currently does not support multiple IP addresses for the
same interface.
dhcpcd currently supports only Ethernet link protocol.

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/dhcpcd.log 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 <sv@phystech.com>
   
