Koozali.org: home of the SME Server

DHCP Lease Time

Taylor

DHCP Lease Time
« on: May 09, 2002, 09:24:29 AM »
Hello,
I have an SME server running version 5.1.2. It is running in server/gateway mode. The server hands out DHCP but it only leases the IP for 1 day. Is there any way to change the lease time? Thanks for all the help in advance.

~Taylor

Grub

Re: DHCP Lease Time
« Reply #1 on: May 10, 2002, 04:20:29 AM »
Yes... change the value for max-leasese-time-time in dhcpd.conf.
The count is set in minutes.
Don't forget to make custom templates

Taylor

Re: DHCP Lease Time
« Reply #2 on: May 10, 2002, 05:25:42 AM »
Thanks!! BTW How do I make custom templates? Thanks again!

~Taylor

Grub

Re: DHCP Lease Time
« Reply #3 on: May 10, 2002, 07:25:15 AM »
Just do a forum search.

jrp2

Re: DHCP Lease Time
« Reply #4 on: May 11, 2002, 02:35:33 AM »
mkdir -p /etc/e-smith/templates-custom/etc/dhcpd.conf

cp /etc/e-smith/templates/etc/dhcpd.conf/25LeaseTimeDefault  /etc/e-smith/templates/etc/dhcpd.conf/25LeaseTimeDefault

cd /etc/e-smith/templates-custom/etc/dhcpd.conf/

pico 25LeaseTimeDefault

Edit the value (it is actually in seconds, not minutes as stated above).  If it is over 1 week (I don't recommend it) you also need to mod 25LeaseTimeMax.

Expand the new template:
/sbin/e-smith/expand-template /etc/dhcpd.conf

restart dhcpd:

service dhcpd restart

Then, make sure you completely understand what you did above so it is real easy next time ;)

Gordon Rowell

Re: DHCP Lease Time
« Reply #5 on: May 13, 2002, 07:58:51 AM »
Taylor wrote:
>
> Hello,
> I have an SME server running version 5.1.2. It is running in
> server/gateway mode. The server hands out DHCP but it only
> leases the IP for 1 day.

Out of interest, why do you want more than a day? DHCP leases will
be renewed automatically after approximately half of the lease time
has been used, so your lease will continue indefinitely.

A longer lease time is a problem for dynamic sites with a small IP addresse
pool (e.g. lots of laptops which appear in office from time-to-time).

Gordon

jrp2

Re: DHCP Lease Time
« Reply #6 on: May 13, 2002, 09:01:23 AM »
Grodon wrote:

> A longer lease time is a problem for dynamic sites with a
> small IP address pool (e.g. lots of laptops which appear
> in office from time-to-time).

And further, if the opposite is the case (small number of PCs, large pool) the ISC dhcp server handles that well.  You will almost always get the same IP back, even after months off-line.  It is very stingey about re-using IPs.  It will only recycle an address if the entire pool has been allocated, even then it will recycle the least recently used address.  I have had machines off-line for many months, boot them up and they get their old IP back.