1826605 Members
3283 Online
109695 Solutions
New Discussion

Set IP and Hostname

 
SOLVED
Go to solution
Quare
Advisor

Set IP and Hostname

Hi there,

May i know how to set a new IP and hostname at a server?

Please help.

Rgrds
25 REPLIES 25
bond007
Advisor
Solution

Re: Set IP and Hostname


Hi,

run

#set_params

it is menu driven util, using which you can set

hostname
IP Addess / Subnet
default gateway

Regards,

Siva.

Arunvijai_4
Honored Contributor

Re: Set IP and Hostname

Hello,

You can run the command "set_params" to setup hostname and IP address for a new server.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Senthil Kumar .A_1
Honored Contributor

Re: Set IP and Hostname

Hi Kadir,

There are ample number of ways to do it.

The easiest of it is using the command....
set_params

The other way would be editing manually, /etc/rc.config/netconf, /etc/hosts files, which I discourage,if you are a new to HPUX arena.

Regards,
Senthil Kumar .A
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Arunvijai_4
Honored Contributor

Re: Set IP and Hostname

Hello,

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=149249

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Robert-Jan Goossens_1
Honored Contributor

Re: Set IP and Hostname

Hi,

Minor typo in above answers

# set_parms initial

this will walk you throught all the steps.

Regards,
Robert-Jan
Muthukumar_5
Honored Contributor

Re: Set IP and Hostname

set_parms hostame

will set hostname.

set_parms ip_address

will set ip-address.

This action is needing *reboot of machine*

--
Muthu
Easy to suggest when don't know about the problem!
Muthukumar_5
Honored Contributor

Re: Set IP and Hostname

A method to change without reboot.

1) Setting hostname:

# hostname

Change in /etc/rc.config.d/netconf file for HOSTNAME entry and /etc/hosts file entry for hostname resolvation.

2) Setting IP-Address:

# ifconfig ip-address gw gateway up

Change the setting in /etc/rc.config.d/netconf file based on interface.

--
Muthu
Easy to suggest when don't know about the problem!
bond007
Advisor

Re: Set IP and Hostname


Hi,

To change the IP address while the server is running you may use ( without reboot)

#ifconfig

Regards,

Sivakaminathan
Senthil Kumar .A_1
Honored Contributor

Re: Set IP and Hostname

Hi Kadir,

For your requirement, these 2 commands would suffice.

set_parms ip_address
set_parms hostname

But if you want to achieve this change in one reboot, then u will have to use..

set_parms initial

Regards,
Senthil Kumar .A
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Arunvijai_4
Honored Contributor

Re: Set IP and Hostname

Hello,

Sorry for the typo in my previous post, it should be # /sbin/set_parms. This is the easiest and robust method of all.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Sivakumar TS
Honored Contributor

Re: Set IP and Hostname


Dear Shapuan,

The IP addess set using ifconfig wont be permanent.

The best way to make all basic network settings permanent is

#set_params

With Regards,

Siva.
Nothing is Impossible !
Asif Sharif
Honored Contributor

Re: Set IP and Hostname

Quare
Advisor

Re: Set IP and Hostname

Hi There,

What about changing the Hostname,Ip address and default gateway to a new one.

i try to run set_parms, seems didn't affect anything. Do i have to reboot the server after set the new hostname.

Rgrds
Arunvijai_4
Honored Contributor

Re: Set IP and Hostname

Hello,

yes, you should reboot the server in order to apply the changes.

-Arun
P.S Remember to assign points
"A ship in the harbor is safe, but that is not what ships are built for"
Yogeeraj_1
Honored Contributor

Re: Set IP and Hostname

hi,

if you are making more than 1 change, it is preferrable to restart the server so as to check if you have done everything well.

After restart, you can verify all your changes.

make sure that you have also backed up the configuration files and modification to remote scripts/programs so that they are aware of this change (if any)


hope this helps too!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Quare
Advisor

Re: Set IP and Hostname

HI all,

Thanks for all info. i had make a change and it works.

another thing to ask, how to change this

"apps100d: / >" ---- to "gst: />"

Thanks
Sivakumar TS
Honored Contributor

Re: Set IP and Hostname


Hi,

pls check the .profile

if it has a entry like,

PS1=[`hostname`]$

Then the prompt is 'hostname' then it would get changed automatically after changing the hostname.

Regards,

Siva.

Nothing is Impossible !
Sivakumar TS
Honored Contributor

Re: Set IP and Hostname


Hi,

If you want to change it manually to
"gst: />"

Then you have to add the follwoing line to .profile

PS1=gst'$PWD'$

Hope this Helps,

Siva.
Nothing is Impossible !
Arunvijai_4
Honored Contributor

Re: Set IP and Hostname

another thing to ask, how to change this

"apps100d: / >" ---- to "gst: />"

You might be having PS1 set in your .profile or /etc/profile and it reflects to hostname changes. Once you change your hostname to "gst" execute your .profile by

# . /.profile

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Quare
Advisor

Re: Set IP and Hostname

Hi there,

i have checked at .profile. it stated like this " export PS1='gst: $PWD >'". But it still read the " apps100d: / > " even in the profile stated gst.

Please advice.


Thnks
Senthil Kumar .A_1
Honored Contributor

Re: Set IP and Hostname

Hi Kadir,

If you made any changes to .profile, You need to logout and relogin to see your changes take effect.

2 more pointers to add.

1) Do not club another unrelated question in the same forum. Because,.. it would not reflect in the normal search ..even though a solution is provided for the second question. I would suggest you to close the first thread and open a new one for the second issue.

2) Secondly, not been shelfish.. when I went through this thread ..u have already received the solution for the first query. It is only befitting you to award point to the members who have taken pains in answering your query. Some even have taken pains twice or trice to get you through the problem. One other advantage in awarding the same. A Solution Bunny could be tagged with this thread . which would help us in future to indentify this as a solved thread when we search for a related issue.

No offense intended, just ..keeping up the motto and emphasizing what I consider this forum.. as "THE WORLDS BEST FORUM, and definitely proud to be a part of"...

Regards,
Senthil KUmar. A
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Senthil Kumar .A_1
Honored Contributor

Re: Set IP and Hostname

Hi Kadir,

Please go through the following link. I defenitely feel everyone needs to go through this doc time to time..

http://66.34.90.71/ITRCForumsEtiquette/

A very good doc by Patrick Walleck.

Regards,
Senthil Kumar .A

Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
V. Nyga
Honored Contributor

Re: Set IP and Hostname

Hi,

if you've changed .profile, you have to check the last lines .dtprofile.
Here is defined, if .profile is used!

HTH
Volkmar

P.S.
You have assigned points to 0 of 29 responses to your questions.
Please work at your assignment rate!
*** Say 'Thanks' with Kudos ***
Muthukumar_5
Honored Contributor

Re: Set IP and Hostname

If you are having the setting of export PS1="string to set" then, try as,

# . $HOME/.profile

what it is now on the prompt.

--
Muthu
Easy to suggest when don't know about the problem!