Re: dhcp-client cleanup



On Sun, 26 Feb 2006 01:42:10 -0500, cga wrote:

otoh wouldn't it make sense being able to tell the server.. ok I'll be
on the road with this machine for the next couple of days so I won't be
needing this ip address.. feel free to move it back to your pool of
free/unused ip addresses..

You can do it to be polite.

Or am I missing something..?

But the ip address will be released when it expires.


depending on how it is configured would still
retain the lease information.. and might refuse to give me another lease
because it thinks I already have one (?) And since I have no access to
my ISP's dhcp server configuration I cannot verify the above assumption.


Well, a new requirement.
Doing a
man dhclient
would suggest you could release the assigned ip addy.


at least on my system - the dhclient man page only talks of configuring
one (or several) interface(s).. says nothing about de-configuring them
or releasing the ip address..

Hmmm, you could be right, but here is a snippet from my distro's man page

The client normally doesn't release the current lease as it is not
required by the DHCP protocol. Some cable ISPs require their clients
to notify the server if they wish to release an assigned IP address.
The -r flag explicitly releases the current lease, and once the lease
has been released, the client exits.

Once you get a lease, your box is supposed to renew it based on renew,
rebind, expire times in the dhclient*.leases file.

ok. so if I understand you correctly I should edit this file

Never suggested that

- changing the rebind or expiration date and wait for dhclient to
wake up and take action..?

I would guess those values are stored in memory before writing them to
the leases file. Changing them will not get the client's attention
until next boot.

now the problem with this is that on the etch system the
dhclient.eth0.leases file is created empty - since I was unable to
obtain a lease -

That is normaly a day one condition and would expect that.

So, should I create a syntactically valid file with a
fake ip address etc. and an expiration date/time at eg. current time
plus thirty seconds.. save it.. and wait for dhclient to wake up and
seeing that the lease is expired go get me a new one..???

Off hand, I would say no. From man page

Old leases are kept around in case the DHCP server is unavailable when
dhclient is first invoked (generally during the initial system boot
process). In that event, old leases from the dhclient.leases file
which have not yet expired are tested, and if they are determined to be
valid, they are used until either they expire or the DHCP server
becomes available.


Apart from striking me as being rather complicated .. I'm not sure this
would work anyway.. since surely the dhcp server at the other end must
keep track of the leases it has served - with rebind.. expiration dates
and times.. etc.

Not to mention, using the nic's MAC in concert with assigned IP


I've even tried copying over the lease file from the sarge /var/run/ but
that did not work either. IIRC dhclient could not get a lease from the
server.. fell back on the lease that was in the lease file.. ifconfig
eth0 showed the ip address dhclient picked up from the lease file.. but
the interface was not listed as "up" and the routing table was not
configured.

That I can believe. dhcp script tells the ifup script it failed and
ifup does not try to continue with setup.


Maybe I should try removing everything that has to do with bringing up
the network from /etc/rc.2

I run Mandriva Linux so I would have to run at level 3 for network on boot.

and try to do everything manually since I am
pretty sure that the problem is with the etch init scripts.

That is pretty bold thinking.
If you can bring up the connection manualy, then you should be able to
debug the scripts without removing them from the rc directories.


No.. I have three different systems installed on this laptop Win98..
sarge.. and etch.. and only etch has this connection problem.

Now that you provided some facts/debugging information, that rules out
other possible problems.

So either way I look at it the odds are that the etch networking
scripts are the culprit..

Since you indicate they work sometimes that would indicate a race condition.

It would seem, you could release the ip lease under win98, boot etch to
rule out dhcp server interaction about assigned IP address.

and unfortunately I neither have the time

Which indicates we should not be wasting our time with it either.

nor the ability to debug this.

If it is script knowledge, these will help.
! bash script introduction documentation
http://tldp.org/LDP/intro-linux/html/index.html

! bash script advanced documentation
http://tldp.org/LDP/abs/html/index.html
.



Relevant Pages

  • Re: dhcp-client cleanup
    ... The client normally doesn't release the current lease as it is not ... The -r flag explicitly releases the current lease, ... even a cursory glance at the output of "strings $(which dhclient)" did not provide a clue as to what this thing is.. ... they are used until either they expire or the DHCP server ...
    (comp.os.linux.networking)
  • Re: System V initialization
    ... > ifdown simply kills the running dhclient. ... never called the script as far as I can tell. ... > boot when I acquired a new lease on boot this AM. ... > data at shutdown. ...
    (comp.os.linux.setup)
  • Re: dhcp-client cleanup
    ... Windows 98' provides this functionality via winipcfg but I could not find anything similar mentioned in the dhclient man page. ... that would reset the client system to its original state but the dhcp server system.. ... depending on how it is configured would still retain the lease information.. ... and might refuse to give me another lease because it thinks I already have one And since I have no access to my ISP's dhcp server configuration I cannot verify the above assumption. ...
    (comp.os.linux.networking)
  • Re: DHCP fallback to fixed IP
    ... >> Testing on a variable which may not exist is a pain. ... >> ip address to parse for. ... > The dhcpcd script has a hook to an external script, ... DNS value changes and short lease times. ...
    (comp.os.linux.networking)
  • Re: DHCP Script
    ... >I need a script to change the lease period for a DHCP scope on a windows ...
    (microsoft.public.windows.server.scripting)