how to know how many ip are assigned

Luc T. taoh666 at yahoo.com
Sun Jan 21 20:22:30 UTC 2007


I installed dhcpstatus, however it doesn't work because I have include statement in my dhcpd.conf.
   
  in addition, I am confused with following entries in the lease file:
   
  lease 192.168.31.73 {
  starts 5 2007/01/19 19:40:32;
  ends 5 2007/01/19 20:40:32;
  tstp 5 2007/01/19 20:40:32;
  binding state free;
  hardware ethernet 00:11:01:07:f2:6a;
  uid "\001\000\023\002\005\362j";
}
lease 192.168.31.55 {
  starts 4 2007/01/18 20:42:19;
  ends 5 2007/01/19 20:42:19;
  tstp 5 2007/01/19 20:42:19;
  binding state free;
--More--(2%)
   
  the 2nd entry for 192.168.31.55 starts on thursday, jan 18 should be appended into the file earlier than the 1st one for 192.168.31.73. why 31.55 is behind 31.73?
  
Glenn Satchell <Glenn.Satchell at uniq.com.au> wrote:
  
>X-Original-To: dhcp-users at webster.isc.org
>Date: Fri, 19 Jan 2007 22:49:42 +0000
>To: dhcp-users at isc.org
>From: Simon Hobson 
>Subject: Re: how to know how many ip are assigned
>X-archive-position: 2677
>X-ecartis-version: Ecartis v1.0.0
>X-original-sender: dhcp1 at thehobsons.co.uk
>List-software: Ecartis version 1.0.0
>X-List-ID: 
>X-list: dhcp-users
>
>Luc T. wrote:
>
>>how can I know how many IPs in a subnet have been assigned? by 
>>looking at the dhcpd.leases file? do I need to look at the 
>>dhcpd.leases~ file?
>
>Yes. But there are already a couple of scripts that will do it for 
>you - try the mail archives. IIRC there's at least one stand alone 
>script, and at least one cgi script so you can find out remotely with 
>your web browser.
>
>> when an assigned IP is released by the client, will dhcpd delete 
>>the entry in the dhcpd.lease file? I mean if I can conclude that an 
>>IP is available if the IP can not be found in the dhcp.leases file.
>
>Two different questions there. To the first, no it does not delete 
>the record of a lease - it is left so as to allow the same address to 
>be allocated should the client return to the network. Expired leases 
>should be identified as such though.
>
>To the second, yes - with the proviso that you have to parse the 
>config file to know what addresses are included in pools before you 
>can work out which of them are free.
>
>
Have a look at the dhcpd.leases man page to see the format of the
entries and how they are stored.

Essentially this file is like a log, with new entries added to the end
of the file only. Thus a later record supercedes an earlier one for
that IP address. Periodically the system re-writes the file, with only
th elast record for each IP address stored in the new file.

One of many tools for querying the lease usage is dhcpstatus, available
from http://dhcpstatus.sourceforge.net/ There have been some comments
on the list about this, so a search will bring up those.

regards,
-glenn




             
  Luc










More information about the dhcp-users mailing list