Operating System - HP-UX
1851461 Members
2947 Online
104059 Solutions
New Discussion

DHCP lease status on hp-ux 11.00

 
Tal Drigov
Advisor

DHCP lease status on hp-ux 11.00

Hi,

OS: HP-UX 11.00

how can I tell when my DHCP lease expires ?

3 REPLIES 3
Ravi_8
Honored Contributor

Re: DHCP lease status on hp-ux 11.00

Hi,

try with dhcpclient,

The DHCP protocol is implemented as extensions to the BOOTP protocol, and in fact the HP-UX DHCP server daemon and the BOOTP daemon are the same (bootpd(1M)). This daemon reads two configuration files: /etc/bootptab and /etc/dhcptab.

The mapping of systems to IP addresses and lease time information is kept in the DHCP database file /etc/dhcpdb. Some amount of management of this database is provided by the dhcptools(1M) command.

On the client side, a command called /usr/lbin/dhcpclient is used to contact the server to get an IP address lease. This command has the ability to broadcast out onto the network prior to the network interface being enabled.

The dhcpclient also serves as a daemon process that sleeps until the time that it needs to renew the IP address lease, at which time it will re-contact the server where it got the original lease in order to extend it.

The dhcpclient command is not intended to be run by users directly, and is called by other tools during system bootup and installation.

never give up
Tal Drigov
Advisor

Re: DHCP lease status on hp-ux 11.00

ok,

but can't I see some details of the dhcp client ?

on my pc you do ipconfig /all

and here ?
Steven Gillard_2
Honored Contributor

Re: DHCP lease status on hp-ux 11.00

According to the dhcpclient man page on 11i (I assume its the same on 11.0), this information is stored in the file /etc/dhcpclient.data. The following excert from the man page shows the format of this file:



00 IFname
01 hostname
02 sname
03 bootfile
04 NIS_domain
05 domain_name
06 lease_duration
07 lease_expiration
08 T1
09 T2
10 htype
11 chaddr
12 IP_addr
13 subnet_mask
14 broadcast_addr
15 default_gateway
16 server_addr
17 boot_server
18 dest_gateway
19 DNS_server
20 LPR_server
21 swap_server
22 NIS_server
23 NTP_server
24 raw_options

So, if you look at the line with code 07 (which will be an integer representing number of seconds since the epoch) you will have your lease expiration time.

Regards,
Steve