how to get lease DHCP expiration time?

  • Follow


I'm trying to get the time for a DHCP lease expiration from the client side . . . . dhcpinfo doesn't appear to provide it.  A quick look at the various dhcp man pages and the RFC (2131 and 2132) doesn't show any obvious technique.  The parameters in my /etc/dhcp/inittab don't appear to include this info.

The one parameter that I thought might be appropriate was T1Time, but from the RFC this looks like it's the time from the lease start to a state change, rather than the actual renewal time.  With my client, this appears to be a constant.

Since the total lease time is available (LeaseTim parameter), if I could get the lease start time, that would also solve the problem.

I'm running the Solaris 8 client and a Windows 2003 DHCP server

Thanks!

Dan
0
Reply Daniel 1/18/2006 12:21:55 PM

Daniel Rawson <daniel_dot_rawson@take_this_out!asml.com> writes:

>I'm running the Solaris 8 client and a Windows 2003 DHCP server

ifconfig <if> dhcp status

Where <if> is your network interface, e.g., hme0, iprb0, etc.

Casper
-- 
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
0
Reply Casper 1/18/2006 12:39:27 PM


Casper H.S. Dik wrote:
> Daniel Rawson <daniel_dot_rawson@take_this_out!asml.com> writes:
> 
> 
>>I'm running the Solaris 8 client and a Windows 2003 DHCP server
> 
> 
> ifconfig <if> dhcp status
> 
> Where <if> is your network interface, e.g., hme0, iprb0, etc.
> 
> Casper
Excellent, thanks . . . .
0
Reply Daniel 1/18/2006 12:42:55 PM

Daniel Rawson wrote:
> 
> I'm trying to get the time for a DHCP lease expiration from the client side . . . . dhcpinfo doesn't appear to provide it.  A quick look at the various dhcp man pages and the RFC (2131 and 2132) doesn't show any obvious technique.  The parameters in my /etc/dhcp/inittab don't appear to include this info.
> 
> The one parameter that I thought might be appropriate was T1Time, but from the RFC this looks like it's the time from the lease start to a state change, rather than the actual renewal time.  With my client, this appears to be a constant.
> 
> Since the total lease time is available (LeaseTim parameter), if I could get the lease start time, that would also solve the problem.
> 
> I'm running the Solaris 8 client and a Windows 2003 DHCP server

I'm not sure if it is what you want, but

   ifconfig bge3 dhcp status

where "bge3" will be whichever interface is relevant in your case, will
return something like:

  Wed Nov  9 05:20:25 FKST 2005
  Interface  State         Sent  Recv  Declined  Flags
  bge3       BOUND            1     1         0  
  (Began, Expires, Renew) = (11/09/2005 05:18, 11/09/2005 05:24,
11/09/2005 05:21)

which shows both the "Expires" time and the time when the Solaris dhcp
client will start the "Renew". If the DHCP server is not present when
the Renew starts you will see:

  Wed Nov  9 05:21:25 FKST 2005
  Interface  State         Sent  Recv  Declined  Flags
  bge3       RENEWING         1     0         0  [BUSY] 
  (Began, Expires, Renew) = (11/09/2005 05:18, 11/09/2005 05:24,
11/09/2005 05:21)

i.e. the state changes to RENEWING, and if the DHCP server has not come
back before the lease expires you will see:

  Wed Nov  9 05:24:25 FKST 2005
  Interface  State         Sent  Recv  Declined  Flags
  bge3       SELECTING        6     0         0  [BUSY]

BTW, FKST is Falklands Standard Time!

John Howells
0
Reply John 1/18/2006 12:46:10 PM

Daniel Rawson wrote:
> Casper H.S. Dik wrote:
>> Daniel Rawson <daniel_dot_rawson@take_this_out!asml.com> writes:
>>
>>
>>> I'm running the Solaris 8 client and a Windows 2003 DHCP server
>>
>>
>> ifconfig <if> dhcp status
>>
>> Where <if> is your network interface, e.g., hme0, iprb0, etc.
>>
>> Casper
> Excellent, thanks . . . .

And, for the record, "netstat -D" will also provide the same information.

Dave
0
Reply Dave 1/18/2006 8:07:35 PM

4 Replies
529 Views

(page loaded in 0.279 seconds)

Similiar Articles:













7/23/2012 4:12:31 AM


Reply: