[KLUG Members] quickest dhcp renewal

Adam Tauno Williams members@kalamazoolinux.org
Fri, 02 Apr 2004 16:28:50 -0500


> >>What's the quickest way to get a RH9 box to renew it's DHCP lease?
> > ifdown eth0; ifup eth0
> Ah, slightly different from what I tried.
> I did
> ifconfig eth0 down
> and then
> ifconfig eth0 up
> and it reported success using the old IP address, even when it was only 
> connected to the hub, which had been disconnected from the rest of the 
> network and doesn't do DHCP.  So, I figured that command wasn't renewing 
> the lease.
> I tried your command and it did indeed renew the lease.
> What's the difference between your command and mine?  Why doesn't 
> ifconfig renew the lease?

ifconfig is the metal+1 layer tool for controlling an interface.  It
doesn't "know" anything about your systems configuration, etc...

ifup and ifdown are actually scripts that look at how you have your
network setup (via whatever wizardly gewey thing) and execute the
requisite underlying commands.    If you have configured for a static IP
then ifdown/ifup just call upon ifconfig with the correct parameters, if
you have configured for a dynamic IP then it informs the dhcp client
daemon you wish to perform some operation and/or if there is no dhcp
client daemon it summons one and tells her to sit on interface X.  For
every DHCP interface there is a dhcp client daemon since DHCP is
actuallu much more than just get-an-ip-at-start,  the client daemon
handles lease renewal, etc...