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
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
Thanks a lot.
Netconfig works great.
By the way, Even if I logged on as a root, it says I do not have a permission to do it when I use Linux command.
Is this what VMWare customized RedHat?
Thanks
Kevin
that's weird, it should work...
what version of esx are you using ?
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.
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
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.
You are correct ! thanks for the add-on
cheers
Bart
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
Yes, but I don't have access to my template from here (home).
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.
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
Either way... glad you got it working. ![]()
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
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.