Remove Lease via omshell

Marc Perea marccp at srttel.com
Thu Jan 21 15:49:44 UTC 2010


Hi Billy,
I'm not sure what your exact goal is for removing the lease entirely, but we use omshell to what we call "clear" a lease. We're using option 82 to define a customer and 1 lease per customer, 1 class per customer for a statically assigned dynamic IP pool of 1 address. When a customer has to replace a modem, that's a problem if there is an existing lease because the IP is tied to the old modem's MAC address until that lease expires. I tried many different maneuvers, but only one seemed to fit what we needed to have happen; I really wanted to remove the lease entirely, but have only been able to force the lease to end prematurely instead - using omshell, of course you could use perl or something else to manually edit the file, but that invokes its own set of trouble.
 
Anyway, if ending the lease on demand is an acceptable solution for you, you can just
>set ends 00:00:00:00
>update
This leaves the lease in the database, but will set the end time (to the beginning of time?) so that the lease is available for re-use on another MAC. It works great for us. We then tied a script to do that work to a web page that our support people have access to, and it's working well for us.
 
HTH - Marc
 
PS - Just wanted to send a thanks to Glenn and Simon who have imparted lots of knowledge to me through this list and without whose help I'm sure I wouldn't have nearly as robust or as stable a deployment!
 


Date: Thu, 21 Jan 2010 14:37:28 +1100
From: Glenn Satchell <glenn.satchell at uniq.com.au>
Subject: Re: Remove Lease via omshell
To: Users of ISC DHCP <dhcp-users at lists.isc.org>
Message-ID: <4B57CBF8.3020507 at uniq.com.au>
Content-Type: text/plain; charset=UTF-8; format=flowed

Hi Billy

Selecting by anything only works when it matches one lease. That 
hardware-address must correspond to more than one lease, so in that case 
hardware-address and dhcp-identifier are not unique selectors. 
ip-address is always a unique selector for a lease.

I don't know about removing a lease, I thought that was only for host 
entries, perhaps someone else can help?

-- 
regards,
-glenn
--
Glenn Satchell                            |  Miss 9: What do you
Uniq Advances Pty Ltd, Sydney Australia   |  do at work Dad?
mailto:glenn.satchell at uniq.com.au         |  Miss 6: He just
http://www.uniq.com.au tel:0409-458-580   |  types random stuff.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20100121/692dc9a6/attachment.html>


More information about the dhcp-users mailing list