Skip to content
Advertisement

DHClient override renewal time

My ubuntu machine is receiving a renewal time of 7000 seconds from the DNS server. I want to change this on the ubuntu machine to be longer via the dhclient.conf. I can’t change the dhcp sever.

However all the examples I try don’t seem to be the correct syntax. For instance if I add at the top of the .conf to request a lease time of 6000, I get no change. I’ve also tried

min-lease-time infinite;
max-lease-time infinite;

as global variables.

#send host-name "andare.fugue.com";
#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
send dhcp-lease-time 6000;
#supersede domain-name "fugue.com home.vix.com";
#prepend domain-name-servers 127.0.0.1;
request subnet-mask, broadcast-address, time-offset, routers,
    domain-name, domain-name-servers, host-name,
    netbios-name-servers, netbios-scope;
#require subnet-mask, domain-name-servers;
#timeout 60;
#retry 60;
#reboot 10;
#select-timeout 5;
#initial-interval 2;
#script "/etc/dhcp3/dhclient-script";
#media "-link0 -link1 -link2", "link0 link1";
#reject 192.33.137.209;

Any ideas, seems like it should be easy to do?

TIA

Advertisement

Answer

In my case the solution was to add in dhclient.conf :

supersede dhcp-lease-time the_value_i_want;

This override the lease time given by the server.

By the way this set the expiration time, the renewal (T1) and rebind (T2) times are calculated by the client (something like 1/2 and 7/8 of the lease time).

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement