Skip navigation
VMware
18,182 Views 20 Replies Last post: Aug 22, 2006 1:07 PM by Arthur_Hansen RSS
1 2 Previous Next
ksk5055 Lurker 7 posts since
Feb 12, 2004
Currently Being Moderated

Feb 17, 2004 4:28 PM

How to change Host server IP address and Name?

Hello,

 

How can I change Host name and IP address?

It was test server and it's time to move to live network with proper name.

Please help....

 

Thanks

 

Kevin Kang

Bart Korsten Enthusiast 478 posts since
Jan 6, 2004
Currently Being Moderated
1. Feb 17, 2004 11:09 PM in response to: ksk5055
Re: How to change Host server IP address and Name?

you can run 'netconfig' from the console. Be careful ! netconfig replaces your current network config.

 

If you want to do it the Linux way, please check :

 

http://www.europe.redhat.com/documentation/HOWTO/IBM7248-HOWTO/network.php3

 

it explains how to change IP/hostname

 

cheers

 

Bart

 

 

Message was edited by: Bart Korsten

Bart Korsten Enthusiast 478 posts since
Jan 6, 2004
Currently Being Moderated
3. Feb 18, 2004 8:42 AM in response to: ksk5055
Re: How to change Host server IP address and Name?

that's weird, it should work...

 

what version of esx are you using ?

ky-lab_rat Enthusiast 197 posts since
Feb 18, 2004
Currently Being Moderated
4. Feb 18, 2004 10:44 AM in response to: ksk5055
Re: How to change Host server IP address and Name?

There is no real easy way to change the host name that I have found.  You have to edit several files apache config, linux host files and more.

 

1)to change the linux name edit /etc/sysconfig/network (this will contain the linux name and the default gateway)

 

2) to change the ip addy edit /etc/sysconfig/network-scripts/ifcfg-eth0 (ip netmask etc.)  and also edit /etc/hosts

 

3) change the web config /usr/lib/vmware-mui/apache/conf/httpd.conf (server name)

 

These are all of the ones off the top of my head.  The best way to find them all is  from the esx console run "grep -r -i "hostname" /* |more" without the outer quotes. and document all of the non log files that contain the hostname and edit them..  Now I do not know your knowledge of linux but be careful of the /proc and /dev files if any contain the name.  These are critical system files and editing them in the wrong way can hose the system.  If you need more info email me.

Bart Korsten Enthusiast 478 posts since
Jan 6, 2004
Currently Being Moderated
5. Feb 18, 2004 11:54 AM in response to: ky-lab_rat
Re: How to change Host server IP address and Name?

as i said before :

 

you can run 'netconfig' from the console. Be careful ! netconfig replaces your current network config.

 

It's a real easy wizard configurator.

 

Cheers

 

Bart

ky-lab_rat Enthusiast 197 posts since
Feb 18, 2004
Currently Being Moderated
6. Feb 19, 2004 5:36 AM in response to: Bart Korsten
Re: How to change Host server IP address and Name?

Netconfig will ONLY change the Linux Settings and not the VMware ones.  For example when you launch the remote console the configuration for the host name comes from the /usr/lib/vmware-mui/apache/conf/httpd.conf file.  Running netconfig will not change this.  The thing to keep in mind is that ESX is a modified RedHat 7.2 install not an os integration.  Meaning that yes it does run very close to the hardware but there is still enough native redhat elements to keep them seperate.

Bart Korsten Enthusiast 478 posts since
Jan 6, 2004
Currently Being Moderated
7. Feb 19, 2004 10:51 AM in response to: ky-lab_rat
Re: How to change Host server IP address and Name?

You are correct ! thanks for the add-on

 

cheers

 

Bart

DallasJF Novice 10 posts since
Dec 3, 2004
Currently Being Moderated
8. Dec 7, 2004 9:21 PM in response to: ky-lab_rat
Re: How to change Host server IP address and Name?

Reading the posts from the original; it seems that "netconfig" will configure several network settings, but not in all of the required or possible files.  Does someone have  a checklist to run through when updating the hostname or IP address of the ESX server?

 

Thanks!

 

 

Message was edited by: DallasJF

a.k.a. Working.Man
JMills Master 2,627 posts since
Jun 18, 2004
Currently Being Moderated
9. Dec 7, 2004 11:43 PM in response to: DallasJF
Re: How to change Host server IP address and Name?

Yes, but I don't have access to my template from here (home).

JMills Master 2,627 posts since
Jun 18, 2004
Currently Being Moderated
10. Dec 7, 2004 11:48 PM in response to: JMills
Re: How to change Host server IP address and Name?

Oops, spoke too soon. I forgot I had cached copies elsewhere:

 

*****

 

In order to change the network configuration data (Hostname, IP Address, Subnet Mask, Gateway) for your VMware ESX Server's Console OS (aka "Service Console"), the recommended procedure at this time is to manually edit the files involved.

 

This process as detailed below assumes you have ONE network interface assigned to the Console OS, and are using static IP addressing. VMware -STRONGLY- discourages the use of dynamic IP addressing for the Console OS network interface.

 

 

The files involved are:

  /etc/hosts

  /etc/resolv.conf

  /etc/sysconfig/network

  /etc/sysconfig/network-scripts/ifcfg-eth0

  /usr/lib/vmware-mui/apache/conf/httpd.conf

 

 

It is recommended that you save copies of these files prior to starting your work, so that you have a reference point to work from later should you wish to roll-back the change. Instructions for this are included as part of the process below.

 

You will need `root` (SuperUser) privileges in order to effect these changes. Depending on decisions made to accomodate the security model of your local environment, you may need to use `sudo`, `su - root`, or log directly in as `root` in order to continue.

 

 

As root get pre-change copies...

  /bin/cp /etc/hosts /root/_hosts.orig

  /bin/cp /etc/resolv.conf /root/_resolv.conf.orig

  /bin/cp /etc/sysconfig/network /root/_network.orig

  /bin/cp /etc/sysconfig/network-scripts/ifcfg-eth0 /root/_ifcfg-eth0.orig

  /bin/cp /usr/lib/vmware-mui/apache/conf/httpd.conf /root/_httpd.conf.orig

(the leading underscore and trailing .orig are flags for you to denote copies)

 

 

Using `vi` or another text editor, edit the following files to match your new configuration:

  /etc/hosts

    IP Address to Hostname Mapping Data

  /etc/resolv.conf

    DNS Recursive Resolver and Search Path Data

  /etc/sysconfig/network

    Hostname and Default Gateway Data

  /etc/sysconfig/network-scripts/ifcfg-eth0

    Network Configuration for Ethernet0

  /usr/lib/vmware-mui/apache/conf/httpd.conf

    Hostname

 

 

As root get post-change copies...

  /bin/cp /etc/hosts /root/_hosts.NEW

  /bin/cp /etc/resolv.conf /root/_resolv.conf.NEW

  /bin/cp /etc/sysconfig/network /root/_network.NEW

  /bin/cp /etc/sysconfig/network-scripts/ifcfg-eth0 /root/_ifcfg-eth0.NEW

  /bin/cp /usr/lib/vmware-mui/apache/conf/httpd.conf /root/_httpd.conf.NEW

(the leading underscore and trailing .NEW are flags for you to denote copies)

 

 

If you have only made changes to /etc/resolv.conf, no further steps are necessary.

 

 

If you have only changed the Hostname, and nothing else, you can run the following:

  /bin/hostname New.Hostname.Here

  /etc/rc.d/init.d/httpd.vmware reload

 

If you have changed other network configuration data as well...

 

 

Restart networking for the Console OS. The `nohup` command and trailing '2>&1' prevents a rare network restart timeout midway through the change. The echoing of `date` output applies timestamps to the '/root/nohup.out' file's contents.

 

  cd /root/

  /bin/echo `/bin/date` >> /root/nohup.out

  /usr/bin/nohup /etc/rc.d/init.d/network restart 2>&1

  /bin/echo `/bin/date` >> /root/nohup.out

 

...Then check the contents of '/root/nohup.out' to be sure the change completed successfully...

 

  /bin/cat /root/nohup.out

 

Lastly, confirm that all required services are listening on the Console OS's network interface. You'll see at minimum a listener on 0.0.0.0:80 (http), 0.0.0.0:443 (https), and 0.0.0.0:902 (VMware Virtual Console).

 

  /bin/netstat --tcp --listening --numeric

 

At this point you've successfully completed the change of the network configuration data for the Console OS. A reboot should not be required.

DallasJF Novice 10 posts since
Dec 3, 2004
Currently Being Moderated
11. Dec 13, 2004 8:05 PM in response to: JMills
How to change Host server IP address and Name? (Netconfig)

Thank you for the answer JMills, I probably should have posted it as an original question, so I could send some 'correct answer' points your way.

 

You reply was spot on. After following the instructions, I determined our network guys had not enabled port 902 in the firewall. (I could not TELNET to port 902). A quick chat with them, a push to the firewall policy, and "wala", everyone "lived happily everafter".

 

DJF

a.k.a. Working.Man
JMills Master 2,627 posts since
Jun 18, 2004
Currently Being Moderated
12. Dec 13, 2004 8:19 PM in response to: DallasJF
Re: How to change Host server IP address and Name? (Netconfig)

Either way... glad you got it working.

RigasW Novice 40 posts since
Nov 29, 2004
Currently Being Moderated
13. Mar 16, 2005 2:47 AM in response to: JMills
Re: How to change Host server IP address and Name? (Netconfig)

Thanks for the excellent description.

I had to move our ESX machine to a different ip segment.

Changing the ip-address and network address worked fine.

 

Regards

 

Rigas Wendel

CWedge@Amsa Expert 385 posts since
Oct 25, 2005
Currently Being Moderated
14. Jan 11, 2006 5:58 AM in response to: RigasW
Re: How to change Host server IP address and Name? (Netconfig)

Did I miss something on this?

 

I did everything, name changed all is well.  I can't connect to the web admin though??  Doing a NetStat shows everything is listening.

 

Even using the http://ipaddress  doesn't work.

Bookmarked By (0)

Share This Page

Communities