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. Re: DHCP lease states and expire leases (Peter Rathlev)


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

Message: 1
Date: Mon, 17 Jun 2019 23:20:38 +0200
From: Peter Rathlev <pe...@rathlev.dk>
To: Users of ISC DHCP <dhcp-users@lists.isc.org>
Subject: Re: DHCP lease states and expire leases
Message-ID:
        <336263fb19767e88e95c75b53306a89abc6acebe.ca...@rathlev.dk>
Content-Type: text/plain; charset="UTF-8"

On Fri, 2019-06-14 at 14:17 +0000, King, Harold Clyde (Hal) wrote:
> I can?t seem to find the explation of lease states on google or my
> books. I see it used in Windows, but I?m in ISC. I can set the state,
> but I?m not sure of all the state numbers.
>  
> For instance, a lease with a state of 1 is free?
> And a lease of state 7 is taken?

You can see the numeric values of lease states in includes/dhcpd.h
around line 533 in 4.4.1:

/* Lease states: */
#define FTS_FREE        1
#define FTS_ACTIVE      2
#define FTS_EXPIRED     3
#define FTS_RELEASED    4
#define FTS_ABANDONED   5
#define FTS_RESET       6
#define FTS_BACKUP      7

So yeah, 1 is free. State 7 is "backup" which means that it's free for
use by the failover partner. Only 2/active means that it's in use.

> I?m trying to expire leases and have clients be able to get those
> leases. I think I have with a state of 1, but my clients get a peer
> holds free leases.

You could use omshell to simulate that the lease was released and then
move it to "free" afterwards. Something like this, where I have
excluded the state output omshell places after each command:

$ omshell
> server 127.0.0.1
> key <keyname> <secret>
> new lease
> set ip-address = 192.0.2.10
> open
> set state = 4
> update
> set state = 1
> update
> close

This effectively moves the lease to state "relased" and the "free". It
cannot go directly to "free", that's an invalid state transition. Doing
so might work on the local server but the failover partner would reject
the update.

You could also just mark it released and let dhcpd do its thing like
normally. As far as I understand, setting state 4/released has the
exact same effect as if the client sent a "RELEASE" packet to the
server.

HTH.

-- 
Peter




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

Subject: Digest Footer

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


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

End of dhcp-users Digest, Vol 128, Issue 9
******************************************

Reply via email to