Tag: IP Address
Week 1: Changing an ESX host IP address
by CharlesJP on Jan.02, 2010, under VMWare
Project 52 – Week 1
First Lesson: Changing the IP address of a VMWare ESX 4 host. I recently had to do this as I was moving my VM box to another network.
First you must disconnect it from vCenter if applicable, and shut down all VMs on this host.. If you have high availability just move them to the other host. Put the host into maintenance mode, easily done from the vSphere client.
Now that all machines are off the host and it is in maintenance mode you can change the IP on the console. You actually have to delete the interface and create a new one.
esxcfg-vswif -d vswif0
-d marks it for deletion, and “vswif0″ is the interface you are changing. This could vary if you have multiple NICs being used. You can list the NICs using esxcfg-vswif -l.
With the interface being deleted now you may create a new one.
esxcfg-vswif -a vswif0 -p “Service Console” -i <IP Address> -n <Subnet Mask> -b <Broadcast IP>
-a Defines the interface name. -p defines the portgroup the interface is assigned to… By default, this is Service Console.
To update the default gateway, use nano to edit the network file.
nano /etc/sysconfig/network file
You can change the Gateway here. If it is not present, add
GATEWAY=<IP Address>
Save the file and reset the interface using
esxcfg-vswif -s vswif0
esxcfg-vswif -e vswif0
You can change the DNS settings on the vSphere client once you have reconnected.
I will continue to write about general network topics as well as VMWare topics as these are my primary during these 52 weeks. I hope to learn alot as well as help others learn during this time. See you next time!