Operating System - HP-UX
1834934 Members
2633 Online
110071 Solutions
New Discussion

Re: DHCP client configuration on hpux

 
Ernesto Valderrama
New Member

DHCP client configuration on hpux

Hi!

I need to configure DHCP client on hpux (10.20 and 11.0)

I have serched this forums, to see if someone else have this need, and to find a way to do it.

Unfurtunately non of the answers help very much to solve my problem.

What I learned so far...

1.- activate DHCP from SAM.
2.- change 0 to 1 the DHCP entry on file /etc/rc.config.netcon
3.- activate bootd on /etc/inetd.conf
4.- reread the inetd.conf with inetd -c
5.- start the dhcpclient with: dhcpclient -b lan0 -u

The answers I found, work only for one time to help reconfigure the network parameters. (when you clear all the parametes and the machine enters into the set_parm sript)

When you run "dhcpclient -b lan0 -u" it access the dhcp server an gets an IP address.

and it creates a dhcpclient.data file on /etc with all the dhcp data.

The problemm is that this appears to work only one time, not every time the lease expires.

How can I set dhcpclient to work all the time ans to start when the machine is reboted?

It will be nice if dhcpclient updates the machine name as my imac does, but this is not prioritary.

this is my dhcp server dhcpd.conf file (part of)

ddns-update-style none;
subnet xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx {
option routers xxx.xxx.xxx.xxx;
option subnet-mask xxx.xxx.xxx.xxx;
option netbios-node-type 8;
option domain-name "my.domain.com";
option domain-name-servers my.dns.servers.addresses;
option netbios-name-servers my.netbios.servers.addresses;
default-lease-time 7200;
max-lease-time 14400;
filename "/tftpboot/my.boot.image";


host dns_name { option host-name "dns_name"; fixed-address dns_name; hardware ethernet xx:xx:xx:xx:xx:xx; }


Thanks

Ernesto.
2 REPLIES 2
Victor_5
Trusted Contributor

Re: DHCP client configuration on hpux

One more point I would like to add is check /etc/auto_parms.log to determine whether the lease request was successful.

David Burgess
Esteemed Contributor

Re: DHCP client configuration on hpux

I've just finished getting my HPUX 11.00 server to be a dhcp client. It gets it config from my ISP. Here's what I did :-

Edit /etc/rc.config.d/netconf and change the line DHCP_ENABLE[0]=0 to DHCP_ENABLE[0]=1
Note you may have a different card and so it could be DHCP_ENABLE[1]=1 etc. If you have more than 1 card leave the rest =0 unless you want them all to be dhcp clients.

Next touch /etc/dhcpclient.data

shutdown -ry 0

On reboot you find your NIC has been configured by dhcp.

If it still doesn't work then check that the DHCP server knows the MAC address etc of your network card. I had to update this on my ISP's web site, but it took a while before it released the MAC address of my Sun box. I think I can only have one lease at a time. So be patient!

Once I got mine working I found that the hostname was also being set by dhcp. Well sort of. uname -a showed the hostname as unkown and CDE wouldn't start. Turned out auto_parms was editing /etc/hosts and /etc/rc.config.d/netconf and setting the hostname to dhcp-4-51. To fix this I added this script /sbin/rc1.d/S321sethostname

#!/sbin/sh # # @(#) $Revision: 1.0 Dave Burgess 18/04/2002$
#
# /sbin/rc1.d/S321sethostname
# /sbin/auto_parms sets up the dhcp client. Unfortunately ISP's can set the
# hostname for us. In this case it is set to dhcp-4-51.
# This script resets the hostname to raver.

new_hostname="raver"
PATH=/sbin:/usr/sbin:/usr/bin
export PATH
echo "Resetting dhcp set hostname to $new_hostname"
uname -S $new_hostname
cp -p /etc/hosts /tmp/hosts.boot
cat /tmp/hosts.boot | sed s/dhcp-4-51/$new_hostname/g > /etc/hosts
cp -p /etc/rc.config.d/netconf /tmp/netconf.boot
cat /tmp/netconf.boot | sed s/dhcp-4-51/$new_hostname/g > /etc/rc.config.d/netconf

Hope this helps,

Dave.