At boot time under Red Hat 7.3, /etc/init.d/network logs
Bringing up interface eth0:
and runs /etc/sysconfig/network-scripts/ifup, which
sources
/etc/sysconfig/network-scripts/ifcfg-eth0, which
sets BOOTPROTO='dhcp'. This causes
ifup to set DYNCONFIG=true when
it's configuring eth0, which makes ifup execute its dhcpcd startup
code. When the code executes, you get a
Determining IP information for eth0
message in /var/log/messages. Then dhcpcd runs
/etc/dhcpcd/dhcpcd.exe, which fixes up
/etc/resolv.conf.
When connected at home, the Cisco 770 ISDN router generates infinite lease times, even though its configured not to. Infinite lease times cause dhcpcd to syslog
infinite IP address lease time. Exiting
and die. To fix this, I edited
/etc/sysconfig/network-scripts/ifcfg-eth0 and
added
DHCPCDARGS='-l 86400 -t 5'
This causes dhcpcd to ask the server for a lease time of 24
hours. The server grants the request, and dhcpcd doesn't die.
This makes life more predictable.
First, use YAST to delete any exisitng dhcpcd.
Web to the dhcpcd-1.3 home page.
cd /usr/src
ftp gate.ucar.edu
anonymous@ftp.phystech.com
siemsen@ucar.edu
cd pub
binary
get dhcpcd-1.3.20-pl0.tar.gz
quit
gunzip dhcpcd-1.3.20-pl0.tar.gz
tar xf dhcpcd-1.3.20-pl0.tar
rm dhcpcd-1.3.20-pl0.tar
cd dhcpcd-1.3.20-pl0
./configure
make
make install
make clean
/var/state/dhcp, which cna sometimes
confuse things. Dhcpcd requires that an existing device name be
supplied on the command line.
Dhcpcd maintains state files in
/var/state/dhcp. In one of the
files, it caches the last-assigned IP address. When it runs
again, it tries to use the IP address that it was previously
assigned, to try to make the machine have the same IP address over
time. In my environment, where I bounce back and forth between
work and home, this breaks. It also causes confusion. For
example, if I docked at work and run "sudo dhcpcd -d eth0" it
sometimes hangs. Inspecting
/var/log/messages shows
broadcasting DHCP_REQUEST for
10.0.0.2 and then terminating on
signal 2. This means that dhcpcd is trying to get
a lease for the IP address that I use at home. When it doesn't,
it hangs.
To see how the ISDN router at home is configured to do DHCP, see the ISDN page.
The dhclient startup script in
/etc/rc.d is run at boot time and
at shutdown time. It runs dhcpcd. If dhcpcd gets a lease with
a time of 0 (infinite), then dhcpcd will set the values and
exit. If the lease time isn't 0, dhcpcd will hang around as a
daemon, in case the DHCP server wants to converse with it later.
The NCAR DHCP server hands out leases with non-zero times, so
when I'm docked at NCAR, the dhcpcd process exists. The ISDN
router hands out leases with infinite times, so when I'm docked
at home, the dhcpcd process doesn't exist. During a halt or
reboot, the dhclient script is run, and tries to kill down the
dhcpcd process. At home, the process doesn't exist, so an
annoying error message is displayed during shutdown. I couldn't
seem to get the ISDN router to hand out leases with non-zero
times, so to solve this, use the "-l" option in the dhcpcd
command line to request a non-zero time.
/etc/rc.d as follows. No big deal.
rm /etc/rc.d/rc2.d/K30dhcp
rm /etc/rc.d/rc2.d/S30dhcp
rm /etc/rc.d/rc3.d/K30dhcp
rm /etc/rc.d/rc3.d/S30dhcp