List Info

Thread: Clear individual DHCP lease?




Clear individual DHCP lease?
user name
2006-03-02 17:01:17
   *** From dhcp-server -- To unsubscribe, see the end of
this message. ***

Hi,
> -----Original Message-----
> From: dhcp-server-bounceisc.org
[mailto:dhcp-server-bounceisc.org]
On
> Behalf Of Mike Horn
> Sent: Thursday, March 02, 2006 10:53 AM
> To: dhcp-serverisc.org
> Subject: Clear individual DHCP lease?
> 
>    *** From dhcp-server -- To unsubscribe, see the end
of this
message.
> ***
> 
> Hi all,
> I'm relatively new to the ISC DHCP server
implementation and I was
> wondering
> if there was a way to clear an assigned lease,
preferably by supplying
the
> IP address of the client.  Thanks!

Geez, I subscribed to this list just so I could send in a
patch, which I
never did (until now). :-/

Anyway, with this micro-patchlet applied, you can use OMAPI,
look up a
lease, and clear it by setting the state to 'free'. 
Granted, you need
to understand the implications of freeing a lease this way;
AFAIK,
there's no way for the server to send an un-looked-for
message that it's
lease has been expired, please get a new one.

I created this patch when I ran out of 3-week leases in a
building that
was getting a lot of passing-through traffic; I checked
router ARP
tables, and freed the leases of any machine not appearing
there.  Of
course, I had already shorted the default & max lease
times for that
subnet.  This worked like well for me; it would have been
much uglier
w/o OMAPI.

How to use OMAPI is, of course, beyond the scope of this
e-mail.  There
are some fine man pages, tho - man omapi, man dhcpd.

Another way to skin this cat would be to write a script,
probably perl,
that will read the dhcpd.leases file and spit out a new one
with the
proper entries deleted.  Then stop dhcpd, run the script,
and restart.

Regards,
	David

> 
> -mike
> 
> 
> 
> 
> 
>
------------------------------------------------------------
-----------
> List Archives : http://www.isc.org/ops/
lists/
> Unsubscribe   : http://www.
isc.org/sw/dhcp/dhcp-lists.php
> -or-          : mailto:dhcp-server-requestisc.org?Subject=unsubscribe
>
------------------------------------------------------------
-----------



------------------------------------------------------------
-----------
List Archives : http://www.isc.org/ops/
lists/
Unsubscribe   : http://www.
isc.org/sw/dhcp/dhcp-lists.php    
-or-          : mailto:dhcp-server-requestisc.org?Subject=unsubscribe  
------------------------------------------------------------
-----------

Clear individual DHCP lease?
user name
2006-03-02 18:51:06
   *** From dhcp-server -- To unsubscribe, see the end of
this message. ***

Parsley, David L wrote:
> Geez, I subscribed to this list just so I could send in
a patch, which I
> never did (until now). :-/
> 
> Anyway, with this micro-patchlet applied, you can use
OMAPI, look up a
> lease, and clear it by setting the state to 'free'. 
Granted, you need
> to understand the implications of freeing a lease this
way; AFAIK,
> there's no way for the server to send an un-looked-for
message that it's
> lease has been expired, please get a new one.

To be clear: the protocol does not support the server
expiring a lease early. 
You are playing with fire.  Checking to see if the box is
still "up" will work 
most of the time, but eventually one will be off line when
you check and come 
back to an IP collision.

^C

------------------------------------------------------------
-----------
List Archives : http://www.isc.org/ops/
lists/
Unsubscribe   : http://www.
isc.org/sw/dhcp/dhcp-lists.php    
-or-          : mailto:dhcp-server-requestisc.org?Subject=unsubscribe  
------------------------------------------------------------
-----------

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )