Operating System - HP-UX
1820885 Members
3538 Online
109628 Solutions
New Discussion юеВ

How to change IP-Address and Hostname on HP-UX 10.20?

 
Lothar Mueller
Trusted Contributor

How to change IP-Address and Hostname on HP-UX 10.20?

Hi,

as a Solaris User I have to change IP address and hostname on a HP-UX 10.20 machine.

Can anybody tell me how to do that (I know set_parms a bit)?

Thanks for helping

Lothar
14 REPLIES 14
Vincenzo Restuccia
Honored Contributor

Re: How to change IP-Address and Hostname on HP-UX 10.20?

#set_parms ip_address (hostname)
eran maor
Honored Contributor

Re: How to change IP-Address and Hostname on HP-UX 10.20?

Hi

you can change menual the ip and the hostname of the computer if you edit the /etc/rc.config.d/netconf

you can also can opr the set_parms hostname
to change the hostname
and set_parms id_adress to change the ip of the computer

also it is advise to do a reboot to the computer .

hope that i help
love computers
James R. Ferguson
Acclaimed Contributor

Re: How to change IP-Address and Hostname on HP-UX 10.20?

Hi:

A good way to change the hostname and ipaddress is, in fact, to use 'sbin/set_parms':

# /sbin/set_parms hostname
# /sbin/set_parms ipaddress

You will be prompted to provide the appropriate data by passing the arguments as shown.

...JRF...
Rob Smith
Respected Contributor

Re: How to change IP-Address and Hostname on HP-UX 10.20?

You can either user set_parms, but that will cause a system reboot or bring the system down to single user mode:

shutdown

Then make a backup of /etc/rc.config.d/netconf.

vi /etc/rc.config/netconf and change the appropriate settings. Just rememeber that the [0] or [1] or whatever number refers to the particular lan card. When you are done modifying the file do and init 3 to bring the system back to multi user state. To me this has always been the easiest way to do it. Hope this helps.

Rob
Learn the rules so you can break them properly.
Lothar Mueller
Trusted Contributor

Re: How to change IP-Address and Hostname on HP-UX 10.20?

Thanks for the quick answers,

One more little question regarding hostname change.
is there a known problem if hostname length is longer than 8?
I tried it once and got a cde login error

Cheers
Lothar
MANOJ SRIVASTAVA
Honored Contributor

Re: How to change IP-Address and Hostname on HP-UX 10.20?

Hi Lothar

1.As a Solaris User the best way you can change it is using SAM

SAM -----> Netwroking and Devices.

2.Also you can do it from the command line using
/sbin/set_parms hostname
/sbin/set_parms ipaddress


Manoj Srivastava


Haitham Hamad
Regular Advisor

Re: How to change IP-Address and Hostname on HP-UX 10.20?

You can use set_parms to change the IP and hostname. You can also do the following (You have to be root)

#hostname new_hostname
#uname -S new_hostname
#vi /etc/rc.config.d/netconf
modify hostname & IP address
modify gateway (if needed)
save
#/sbin/init.d/net stop
#/sbin/init.d/net start

These steps doesnot require reboot but you will need to open a new session if you were working from a client software (telnet, hostaccess,....)

Hope this helps
Haitham
Alex Glennie
Honored Contributor

Re: How to change IP-Address and Hostname on HP-UX 10.20?

Hi again

CDE & hostname length =>

a component of CDE (ToolTalk) uses the uname system call while
the remainder of the system uses gethostname, a UUCP nodename must be
specified. Normally, this is automatically set to the value of the
hostname. However, the maximum length of a UUCP nodename is 8
characters. If a hostname is longer than 8 characters, such as
"verylongname", a shorter UUCP nodename must be specified separately.
1. Do this by adding a line in /etc/rc.config.d/netconf such as:
NODENAME="short"
2. You will also need to edit /etc/hosts and add this as an alias
to your hostname. This is very important as CDE will not work
without it. An example entry might be:
123.4.5.6 verylongname short
If you are using DNS and do not wish to have DNS entries for
these "short" nodenames, you must also configure the system
to use /etc/hosts before using DNS to resolve names and IP addresses.
This can be accomplished by using an "/etc/nsswitch.conf" file with
"files" before "dns" and/or "nis" on the hosts
line. An example file that can be used may be found at:
/usr/examples/nsswitch/nssw.filesdns It can be put into place with:
cp -p /usr/examples/nsswitch/nssw.filedns /etc/nsswitch.conf
3. Finally, change your hostname entries in /var/adm/inetd.sec to your
IP address, for example: Change line:
dtspc allow 127.0.0.1 verylongname To read:
dtspc allow 127.0.0.1 123.4.5.6
4. Reboot the machine (/sbin/reboot will do).

Vincenzo Restuccia
Honored Contributor

Re: How to change IP-Address and Hostname on HP-UX 10.20?

The sethostname() system call sets the name of the host processor to name, which has a length of namelen characters. At system boot time sethostname() is normally executed by the hostname command (see hostname(1) ) in the /sbin/init.d/hostname script. Host names are limited to MAXHOSTNAMELEN characters, as defined in .
Bill McNAMARA_1
Honored Contributor

Re: How to change IP-Address and Hostname on HP-UX 10.20?

Try set_parms

For future reference have a look here:Here's a link to a nick quick ref for often used admin command translation between hpux and solaris

http://www.hp.com/technicalsolutions/eda/hp-ux11_solaris/reference_guide.html

Later,
Bill
It works for me (tm)
Lothar Mueller
Trusted Contributor

Re: How to change IP-Address and Hostname on HP-UX 10.20?

Thanks to all for the good and fast answers,

that's why I like this forum.

Cheers

Lothar
Shahul
Esteemed Contributor

Re: How to change IP-Address and Hostname on HP-UX 10.20?



Hi

Use this procedure

Login as root
#set_parms hostname
Now it will ask for hostname, Please enter correct Hostname

#set_parms ip_address
Now it will ask for IP address, Please enter it correctly.

If U want to change default gateway or subnet use this command
#set_parms addl_netwrk
Now U will have to enter subnetmask, default gateway hostname , Default gateway address..etc.

If just type set_prms it will show what are all can be done by that command.

Best of luck .shahul
jedd
Advisor

Re: How to change IP-Address and Hostname on HP-UX 10.20?

Hi I've tried all of the above recommendations and nothing works. I'm running a 10.20 on a 715 box. when i do uname -a gives me 1 response and when i type hostname it gives me another response. i've done /sbin/set_parms hostname and changed /etc/rc.config.d/netconf.
the only thing i didn't do is change the /etc/hosts but i don't think that matters it what i'm trying to do, does it? really desperate as i'm in the process of changing our proxy servers.
thanks for the help.
Lothar Mueller
Trusted Contributor

Re: How to change IP-Address and Hostname on HP-UX 10.20?

Here is what I did and it worked;

- Hostname change
#hostname
#uname -S (UUCP nodename)- Backup-copy of /etc/rc.config.d/netconf-
Modify netconf HOSTNAME=""
IP_ADDRESS[1]=
SUBNET_MASK[1]=
INTERFACE_NAME[1]=btlan01
BROADCAST_ADDRESS[1]=
ROUTE_DESTINATION[1]="default"
ROUTE_GATEWAY[1]=-
Change Fle /etc/hosts
-
DNS modify
/etc/resolv.conf (Backup-Copy: resolv.conf.xxx)
domain
nameserver
nameserver -
Stop network services
#/sbin/init.d/net stop-
Start network services
#sbin/init.d/net start-
Reboot
#shutdown -r 60

Hope that helps

Lothar