Re: DHCP connection time



On Wed, 28 Mar 2007 22:21:46 +0000, Bit Twister wrote:

That is kinda funny question.

Why?

I'll guess you look at the lease file and
current date/time and do some math.

man dhclient for location of lease file. hint: ls /var/lib/dhcp/*

The content of the relevant file makes no sense to me:

lease {
interface "eth1";
fixed-address 192.168.0.5;
option subnet-mask 255.255.255.0;
option routers 192.168.0.1;
option dhcp-lease-time 86400;
option dhcp-message-type 5;
option domain-name-servers 192.168.0.1;
option dhcp-server-identifier 192.168.0.1;
option dhcp-renewal-time 43200;
option dhcp-rebinding-time 75600;
renew 2 2007/3/27 09:30:53;
rebind 2 2007/3/27 19:22:54;
expire 2 2007/3/27 22:22:54;
}

The connection is definitely not from 2007-03-27 as I switched on the PC
a few hours ago, that is on 2007-03-28. After a reconnect the file looks
like this:

lease {
interface "eth1";
fixed-address 192.168.0.5;
option subnet-mask 255.255.255.0;
option routers 192.168.0.1;
option dhcp-lease-time 86400;
option dhcp-message-type 5;
option domain-name-servers 192.168.0.1;
option dhcp-server-identifier 192.168.0.1;
option dhcp-renewal-time 43200;
option dhcp-rebinding-time 75600;
renew 4 2007/3/29 00:45:44;
rebind 4 2007/3/29 00:45:44;
expire 4 2007/3/29 00:45:44;
}
lease {
interface "eth1";
fixed-address 192.168.0.5;
option subnet-mask 255.255.255.0;
option routers 192.168.0.1;
option dhcp-lease-time 86400;
option dhcp-message-type 5;
option domain-name-servers 192.168.0.1;
option dhcp-server-identifier 192.168.0.1;
option dhcp-renewal-time 43200;
option dhcp-rebinding-time 75600;
renew 4 2007/3/29 10:04:03;
rebind 4 2007/3/29 21:45:52;
expire 5 2007/3/30 00:45:52;
}

Now I see the correct lease time (00:45), strangely in GMT and not in my
local timezone. "Expire 5" is also clear, it's the expiration time
(+24h). But I do not understand what the other times are supposed to
mean, as they refer to the past!? And why didn't I get the correct lease
time before the reconnect? I would be glad if you could shed some light
on this!

Many thanks,
Rehceb
.