Koozali.org: home of the SME Server
Legacy Forums => Experienced User Forum => Topic started by: Rob Wellesley on September 25, 2003, 06:16:27 PM
-
I notice that dhcp.leases retains records of leases for MAC addresses long since gone. Also - occasionally there are 2 or 3 leased IP's to the same host - different date periods tho.
Any ideas why? and what would happen once current scope is gone (we build PC's and load software from our network)?
How come the lease file isn't "flushed" regularly? the oldest lease record we have is July 30.
Any comments form the learned and experienced appreciated
rob
-
Yeah... good question. I too would like to know of a means / method to periodically clear the leases pool. I installed a little contrib that shows what leases are in use - kinda cool. I'd like to be able to 'manage' the pool too (simply in the respect of clearing/flushing it).
-=- jd -=-
-
This is what I use to clear my DHCP Leases every month via cron
Type at command line or create a bash script - do the following
/etc/rc.d/init.d/dhcpd stop
rm /var/lib/dhcp/dhcpd.*
touch /var/lib/dhcp/dhcpd.leases
/etc/rc.d/init.d/dhcpd start
Hope this helps you
Byte
-
Groovy... thanks. ;)
-=- jd -=-
-
Byte wrote:
>
> This is what I use to clear my DHCP Leases every month via cron
Sure - but you'd want every one logged off and shut down tho' right? otherwise the next guy to turn on a PC will get the first IP in the scope - which may be already in use on a PC that's running - OUCH
rob
-
What you want is e-smith-dhcpmanager-1.2-8 from
http://www.developit.fr/FichePratique/SMEServer/index.html
I found it last night and installed it. Works well. Shows you the leases, which ones are active or not, and allows you to remove leases.
Jon
-
Ahh!! ... and this one works w/5.6 boxes? (I'm @work right now and haven't looked yet - will though. ;) )
Thanks for the link / post.
-=- jd -=-
-
Rob Wellesley wrote:
>
> I notice that dhcp.leases retains records of leases for MAC
> addresses long since gone. Also - occasionally there are 2 or
> 3 leased IP's to the same host - different date periods tho.
An expired lease is an expired lease. Why worry about it?
> Any ideas why?
You'd have to ask on the dhcpd design list. Probably just not worth purging.
Charlie
-
>An expired lease is an expired lease. Why worry about it?
How do you know it's expired?
>You'd have to ask on the dhcpd design list. Probably just not worth >purging.
If it's not work keeping it's worth purging.
Mark
-
Mark wrote:
> >An expired lease is an expired lease. Why worry about it?
>
> How do you know it's expired?
This seems very obvious to me - an expired lease is one whose expiry time is in the past (what else could an expired lease be?).
> >You'd have to ask on the dhcpd design list. Probably just
> > not worth purging.
>
> If it's not work keeping it's worth purging.
If you think so, then you are free to add the code. Note, however, that more code very often means more bugs.
Is it currently broken? Seems at most a cosmetic fault to me - and if so, it should have a cosmetic fix - whatever is displaying the expired leases should be modified to ignore them.
Further discussion should be directed to the dhcpd devel list.
Charlie
-
According to man dhcpd.leases "the file is rewritten from time to time". Apparently that is once an hour in the absence of activity, or after every thousand
leases that are written. It looks like Mitel changed that behaviour?
But as Charlie said, it doesn't really matter. Eventually it gets flushed and the file never even approaches the size of, say, /var/log/messages.
It even provides you with some forensic evidence. For example, your logs tell you that IP 192.168.208.69 did something naughty yesterday at 14:05 and you need to know who that bugger was. Have a look in dhcpd.leases and you'll know his MAC address.
Michiel
-
Rob Wrote:
>Sure - but you'd want every one logged off and shut down tho' right? otherwise >the next guy to turn on a PC will get the first IP in the scope - which may be >already in use on a PC that's running - OUCH
>rob
Not really because the cron runs at midnight ;-)
Byte
-
> Rob Wrote:
>
> >Sure - but you'd want every one logged off and shut down
Byte wrote:
> Not really because the cron runs at midnight ;-)
>
If a PC is left running over night it won't matter when the script runs - that PC will retain it's IP till reboot or end of lease. If it's IP is the first in the scope - and the first PC to boot up in the morning pickups the same IP from DHCPD - (because there is no record of the tie between MAC and IP addresses - because ot the blank dhcp.leases) you will have conflicts. Or am I missing something here?
rob