VMware Cloud Community
primedia_jdavis
Contributor
Contributor
Jump to solution

Change host admin IP permanently?

Using ESX 3.0.2 and I'm new and confused.

I've followed the suggestion at to change the host IP, which includes reinstating vswif0 and updating the gateway at /etc/sysconfig/network, and additionally I've edited /etc/vmware/esx.conf (which appears to be generated and not really editable) and also figured out to use:

esxcfg-advcfg -s 10.2.1.159 /Misc/HostIPAddr

.. which looks like it does the same thing but applies it in realtime.

And after browsing these forums I've learned that I need to also use esxcfg-boot to get some of this stuff to persist.

At this point I'm grasping for anything that will get my changes to fully persist. The IP and route will now persist particularly after using esxcfg-boot now but I'm still getting the old IP address (10.1.1.159) coming up in the main boot screen, as echoed on /adv/Misc/HostIPAddr in esx.conf. Executing esxcfg-advcfg -s 10.2.1.159 /Misc/HostIPAddr makes the change in realtime but does not persist at boot.

How do I get the new IP address (10.2.1.159) to stick ??

Ultimately once I figure this out I'm going to need to know how to revert back to the old IP and route again, this is only for setup and configuration in a different and temporary geographic environment.

Reply
0 Kudos
1 Solution

Accepted Solutions
RParker
Immortal
Immortal
Jump to solution

ah, change the /etc/hosts file, I think you will find your IP address in there, if you change that it should be good.

View solution in original post

Reply
0 Kudos
12 Replies
RParker
Immortal
Immortal
Jump to solution

Did you try the VI console? You can edit the IP in the configuration tab, that should propagate to everywhere and make it permanent. Just point the VI3 client directly to your ESX host. That should work.

Reply
0 Kudos
primedia_jdavis
Contributor
Contributor
Jump to solution

Uhh, well, the VI client connects to the host via the host IP. Setting the host IP from the VI client.. that's pretty backwards, isn't it?

But since I can make the change manually at runtime from the console, I'll try getting it to commit/persist from the VI client.

Reply
0 Kudos
primedia_jdavis
Contributor
Contributor
Jump to solution

I see no way to change the VI3 host IP from the VI3 client.

Reply
0 Kudos
RParker
Immortal
Immortal
Jump to solution

Not really, the changes wouldn't take affect until AFTER a restart anyway.

And I just upgraded to a new computer yesterday, don't have all my tools and such to connect to my console to try it, but I thought there was a way, evidently not.

I think you did everything, except the /etc/sysconfig/networking-scripts for the vswif.cfg file (can't remember the exact file name). From what I could tell, there are only a couple of places to change the IP, but that cfg file is the main one, that's probably why it isn't persistent.

Reply
0 Kudos
RParker
Immortal
Immortal
Jump to solution

I found this post:

To change the IP address of the ESX 3.x host, you need to change the configuration of the vswif. By default this is vswif0 and this is assumed in this document. Login to the service console with root permissions, either by using root or doing a su - to get the permissions.

Once in the service console runt the command "esxcfg-vswif -d vswif0". This command deletes the existing vswif0. Don't worry if you get a message about nothing to flush. Then you need to run the command to change the ip address, subnet mask and broadcast address. They are also specified in that order when the command is given. An example command is below.

"esxcfg-vswif -a vswif0 -p Service\ Console -i 10.1.1.1 -n 255.255.255.0 -b 10.1.1.255"

In this command the -a switch is to add a vswif, the \ in the Service\ Console is deliberate, the -i is the ip address, the -n is the netmask and the -b is the broadcast address

Reply
0 Kudos
primedia_jdavis
Contributor
Contributor
Jump to solution

The changes take effect when you use any esx-- command, or in the case of network adapter / ethernet changes, when you restart the network service. My problem is that the changes revert upon reboot.

"I think you did everything, except the /etc/sysconfig/networking-scripts for the vswif.cfg file" Do you mean /etc/sysconfig/network-scripts/ifcfg-vswif0 ? No, I didn't forget that, I edited it or checked on it frequently. It is auto-generated by esxcfg-vswif.

"I found this post..." I did that, that text comes from the hyperlink in my original post.

Note that the Service Console IP address does change, if I ifconfig after boot it says the new IP address is being used, but the boot screen that says to connect to http://ip_addr/ is showing the old IP address. So the persistence puzzle is still not resolved.

Jon

Reply
0 Kudos
primedia_jdavis
Contributor
Contributor
Jump to solution

So eh .. is this a bug? Has no one ever changed an ESX host IP and rebooted before?

Reply
0 Kudos
djflux
Enthusiast
Enthusiast
Jump to solution

All I've ever done to change the service console IP address is edit /etc/sysconfig/network-scripts/ifcfg-vswif0 and /etc/sysconfig/network (if you changes subnets you have to change the GATEWAY variable in that file). I was a Linux (RH distro) guy before I was a VMware guy and I always just edit the /etc/sysconfig files to change IP addresses.

Once I've changed these files I run

server network restart

or just reboot the host. The changes always "stick."

RParker
Immortal
Immortal
Jump to solution

ah, change the /etc/hosts file, I think you will find your IP address in there, if you change that it should be good.

Reply
0 Kudos
primedia_jdavis
Contributor
Contributor
Jump to solution

djflux, thanks, like I said, though, I can get about everything to "stick" that way except for the console host IP that is displayed on boot as an HTTP URL.

Reply
0 Kudos
primedia_jdavis
Contributor
Contributor
Jump to solution

Oh for goodness sake .. the hosts file .. how on earth did I overlook that?! Sure enough the old IP is in there. I'll change it and reboot... UPDATE Yep, thanks, esx.conf shows correctly now.

Reply
0 Kudos
VI__ESXi
Contributor
Contributor
Jump to solution

Thank you for your POST.

I needed to edit an IP address for an ESX host that was built and deployed to a remote location....luckily the HP iLO was active.

Reply
0 Kudos