Send dhcp-users mailing list submissions to
        dhcp-users@lists.isc.org

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.isc.org/mailman/listinfo/dhcp-users
or, via email, send a message with subject or body 'help' to
        dhcp-users-requ...@lists.isc.org

You can reach the person managing the list at
        dhcp-users-ow...@lists.isc.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of dhcp-users digest..."


Today's Topics:

   1. DHCP Lease (Soporte VT)
   2. Re: DHCP Lease (Gregory Sloop)
   3. Re: DHCP Lease (Gregory Sloop)


----------------------------------------------------------------------

Message: 1
Date: Wed, 8 Jun 2022 18:28:15 +0200
From: Soporte VT <sopo...@vallecastelecom.com>
To: Users of ISC DHCP <dhcp-users@lists.isc.org>
Subject: DHCP Lease
Message-ID: <31ffd842-98bd-99a0-fdc6-11bb90fb4...@vallecastelecom.com>
Content-Type: text/plain; charset="utf-8"; Format="flowed"

Hi, community,

I want to delete a lease, for example, this one below instead of waiting 
eight hours. What is the correct way to do it? I mean, I do not want to 
screw the DHCP service up. So, could someone give me some advice to 
approach this task? Thanks a lot.

> /var/lib/dhcp/dhcpd.leases

> lease DIR-IP-X.X.X.X {
> ? starts 3 2022/06/08 10:42:28;
> ? ends 3 2022/06/08 18:42:28;
> ? tstp 3 2022/06/08 18:42:28;
> ? cltt 3 2022/06/08 10:42:28;
> ? binding state active;
> ? next binding state free;
> ? rewind binding state free;
> ? hardware ethernet DIR-MAC-X:X:X:X;
> ? uid "\001\304\015\2264\243\376";
> ? set agent-id = "DIR-IP-X.X.X.X";
> ? set hstnm = "EG8145X6";
> ? set clhw = "DIR-MAC-X:X:X:X";
> ? set clip = "DIR-IP-X.X.X.X";
> ? set cllt = "28800";
> ? set hsttype = "pc";
> ? set tech = "gpon";
> ? set clrid = "34:38:35:37:35:34:34:33:44:33:42:46:45:31:41:37";
> ? set clcid = 
> "4d:41:44:52:49:44:5f:30:31:20:78:70:6f:6e:20:30:2f:31:31:2f:30:2f:31:33:3a:34:2e:32:2e:32:30:30:25";
> ? option agent.circuit-id "XXXXX_01 xpon 0/11/0/13:4.2.200%";
> ? option agent.remote-id "48575443D3BFE1A7";
> ? client-hostname "EG8145X6";
> ? on expiry {
> ??? set clip =
> ?????? binary-to-ascii (10, 8, ".", leased-address) ;
> ??? execute ("/opt/fos/bin/push_ip_lease", "--transaction=expiry",
> ??????? concat ("--leased-address=", clip));
> ? }
> ? on release {
> ??? set clip =
> ?????? binary-to-ascii (10, 8, ".", leased-address) ;
> ??? execute ("/opt/fos/bin/push_ip_lease", "--transaction=release",
> ??????? concat ("--leased-address=", clip));
> ? }
> }
Best,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<https://lists.isc.org/pipermail/dhcp-users/attachments/20220608/88e77f04/attachment-0001.htm>

------------------------------

Message: 2
Date: Wed, 8 Jun 2022 11:59:56 -0700
From: Gregory Sloop <gr...@sloop.net>
To: Users of ISC DHCP <dhcp-users@lists.isc.org>
Subject: Re: DHCP Lease
Message-ID: <412715745.20220608115...@sloop.net>
Content-Type: text/plain; charset="utf-8"

You can stop the dhcpd server and edit the leases file and remove the lease.
?
That doesn't follow the RFC for how leases are handled, and if you have a ddns 
entry that was generated by the lease, it won't get removed.
There are probably other undesirable side-effects I can't think of at the 
moment too.
?
You'll also need to make sure that client doesn't continue to attempt to use 
the lease it was promised, and hasn't expired yet. Different clients handle 
that differently.
?
But you're breaking the rules for dhcpd leases, so you have to work around 
those problems.
?
I think that answers your question - but it perhaps misses the more important 
factor of "Why?"
Why are you wanting to delete a lease? (One off mistake, and you'll handle the 
fallout? Probably fine. You want to do this systemically? Quite ugly with lots 
of complications.)
?
There's been a lot of discussion on the list over the years about admins 
wanting to force all leases to get new IP's at expiration, cause them to end 
early etc. And there's a lot of reasons those ideas are often bad - some more 
bad than others. Thus, knowing what you're trying to accomplish might help us 
offer more than a set of steps to do what you asked, and more along the lines 
of "Is this a good idea that has practical merit?" (Probably not, but it might 
be worth some consideration.) :)

-Greg
?

> Hi, community,
> I want to delete a lease, for example, this one below instead of waiting 
> eight hours. What is the correct way to do it? I mean, I do not want to screw 
> the DHCP service up. So, could someone give me some advice to approach this 
> task? Thanks a lot.
>> /var/lib/dhcp/dhcpd.leases
>> lease DIR-IP-X.X.X.X {
>> ? starts 3 2022/06/08 10:42:28;
>> ? ends 3 2022/06/08 18:42:28;
>> ? tstp 3 2022/06/08 18:42:28;
>> ? cltt 3 2022/06/08 10:42:28;
>> ? binding state active;
>> ? next binding state free;
>> ? rewind binding state free;
>> ? hardware ethernet DIR-MAC-X:X:X:X;
>> ? uid "\001\304\015\2264\243\376";
>> ? set agent-id = "DIR-IP-X.X.X.X";
>> ? set hstnm = "EG8145X6";
>> ? set clhw = "DIR-MAC-X:X:X:X";
>> ? set clip = "DIR-IP-X.X.X.X";
>> ? set cllt = "28800";
>> ? set hsttype = "pc";
>> ? set tech = "gpon";
>> ? set clrid = "34:38:35:37:35:34:34:33:44:33:42:46:45:31:41:37";
>> ? set clcid = 
>> "4d:41:44:52:49:44:5f:30:31:20:78:70:6f:6e:20:30:2f:31:31:2f:30:2f:31:33:3a:34:2e:32:2e:32:30:30:25";
>> ? option agent.circuit-id "XXXXX_01 xpon 0/11/0/13:4.2.200%";
>> ? option agent.remote-id "48575443D3BFE1A7";
>> ? client-hostname "EG8145X6";
>> ? on expiry {
>> ??? set clip =
>> ?????? binary-to-ascii (10, 8, ".", leased-address) ;
>> ??? execute ("/opt/fos/bin/push_ip_lease", "--transaction=expiry",
>> ??????? concat ("--leased-address=", clip));
>> ? }
>> ? on release {
>> ??? set clip =
>> ?????? binary-to-ascii (10, 8, ".", leased-address) ;
>> ??? execute ("/opt/fos/bin/push_ip_lease", "--transaction=release",
>> ??????? concat ("--leased-address=", clip));
>> ? }
>> } Best,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<https://lists.isc.org/pipermail/dhcp-users/attachments/20220608/979b3f34/attachment-0001.htm>

------------------------------

Message: 3
Date: Wed, 8 Jun 2022 12:07:15 -0700
From: Gregory Sloop <gr...@sloop.net>
To: Users of ISC DHCP <dhcp-users@lists.isc.org>
Subject: Re: DHCP Lease
Message-ID: <1486147437.20220608120...@sloop.net>
Content-Type: text/plain; charset="utf-8"

Oh, and the expiry and release clauses for the lease you gave as an example 
have scripts that process - so you'll need to handle those items as well.
?

> Hi, community,
> I want to delete a lease, for example, this one below instead of waiting 
> eight hours. What is the correct way to do it? I mean, I do not want to screw 
> the DHCP service up. So, could someone give me some advice to approach this 
> task? Thanks a lot.
>> /var/lib/dhcp/dhcpd.leases
>> lease DIR-IP-X.X.X.X {
>> ? starts 3 2022/06/08 10:42:28;
>> ? ends 3 2022/06/08 18:42:28;
>> ? tstp 3 2022/06/08 18:42:28;
>> ? cltt 3 2022/06/08 10:42:28;
>> ? binding state active;
>> ? next binding state free;
>> ? rewind binding state free;
>> ? hardware ethernet DIR-MAC-X:X:X:X;
>> ? uid "\001\304\015\2264\243\376";
>> ? set agent-id = "DIR-IP-X.X.X.X";
>> ? set hstnm = "EG8145X6";
>> ? set clhw = "DIR-MAC-X:X:X:X";
>> ? set clip = "DIR-IP-X.X.X.X";
>> ? set cllt = "28800";
>> ? set hsttype = "pc";
>> ? set tech = "gpon";
>> ? set clrid = "34:38:35:37:35:34:34:33:44:33:42:46:45:31:41:37";
>> ? set clcid = 
>> "4d:41:44:52:49:44:5f:30:31:20:78:70:6f:6e:20:30:2f:31:31:2f:30:2f:31:33:3a:34:2e:32:2e:32:30:30:25";
>> ? option agent.circuit-id "XXXXX_01 xpon 0/11/0/13:4.2.200%";
>> ? option agent.remote-id "48575443D3BFE1A7";
>> ? client-hostname "EG8145X6";
>> ? on expiry {
>> ??? set clip =
>> ?????? binary-to-ascii (10, 8, ".", leased-address) ;
>> ??? execute ("/opt/fos/bin/push_ip_lease", "--transaction=expiry",
>> ??????? concat ("--leased-address=", clip));
>> ? }
>> ? on release {
>> ??? set clip =
>> ?????? binary-to-ascii (10, 8, ".", leased-address) ;
>> ??? execute ("/opt/fos/bin/push_ip_lease", "--transaction=release",
>> ??????? concat ("--leased-address=", clip));
>> ? }
>> } Best,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<https://lists.isc.org/pipermail/dhcp-users/attachments/20220608/00736ca8/attachment.htm>

------------------------------

Subject: Digest Footer

_______________________________________________
ISC funds the development of this software with paid support subscriptions. 
Contact us at https://www.isc.org/contact/ for more information.

dhcp-users mailing list
dhcp-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/dhcp-users


------------------------------

End of dhcp-users Digest, Vol 164, Issue 16
*******************************************

Reply via email to