# dhclient.conf and lease-time



## hedgehog (Dec 21, 2010)

Greetings.
I recieve too high lease-time from ISP's DHCP (15 days). Is there a way to force dhclient to ask DHCP server more frequently without setting up crontab?

/var/db/dhclient.leases.nfe0:

```
lease {
  interface "nfe0";
  ...
  option dhcp-lease-time 1296000;
  option dhcp-renewal-time 1296000;
  option dhcp-rebinding-time 1296000;
  renew 3 2011/1/5 22:58:51;
  rebind 3 2011/1/5 22:58:51;
  expire 3 2011/1/5 22:58:51;
}
```

I tried to change it via /etc/dhclient.conf using either *supersede dhcp-lease-time 7260;* or *send dhcp-lease-time 7260;*, but lease-time remains the same.


----------



## eirnym (Dec 22, 2010)

Have you tried to use these options for interface "nfe0"?
Have you tried to remove leases for nfe0?

PS: Why do you need it?


----------



## hedgehog (Dec 24, 2010)

eirnym said:
			
		

> Have you tried to use these options for interface "nfe0"?
> Have you tried to remove leases for nfe0?


Yes and yes (by the way, option *append domain-name-servers 8.8.8.8;* is working as intended on this interface). 



			
				eirnym said:
			
		

> PS: Why do you need it?


Because when 24 hours have passed since a lease accepted, my port gets locked untill I restart dhclient manually. Time based ACL or something, I'm not so familiar with DHCP. And don't tell me to contact ISP :]


----------



## Orum (Dec 24, 2010)

If your ISP blocks your port after using the IP addresses that they assigned you for 15 days after only 1 day, I think you have bigger issues than DHCP to worry about.

However, you might be able to get a workaround with some supersede statements in dhclient.conf.

Edit: Ah, missed your last line.  Try a renew/rebind/expire date?  Not sure if these can be set on a recurring schedule though...


----------



## eirnym (Dec 25, 2010)

I use dhcping in cron for this


----------



## hedgehog (Dec 29, 2010)

Looks like issue solved on the ISP side. Thanks everyone.


----------

