Change Service Console IP Address

Changing the Service Console IP on ESX is well documented all over the internet.  I see two different variants and I really like the one that requires less typing.  First action, log into the console of the server, gain root access.  Change the IP with the following command.

`esxcfg-vswif -i <a.b.c.d> -n <e.f.g.h>`

-i parameter is the IP address

-n parameter is the netmask

Next step is to modify support network files:

  1. Edit/etc/hosts and modify with new IP address
  2. Edit /etc/sysconfig/network and set ‘GATEWAY=’ value to default gateway

With the other documentation I’ve seen the last step is to set the default gateway and restart the server or network services with:

`route add default gw <e.f.g.h>`

`service network restart`

This is all well and good if the IP address is being modified on the same network.  If the network is different default gateway will not be present upon reboot or start of networking services and this is the part I see as missing from most documentation.  To modify the gateway there is one more file to change, assuming virtual interface is vswif0.

  1. Edit /etc/sysconfig/network-scripts/ifcfg-vswif0 and set ‘NETWORK=’ value to the new network

My experiences have shown mixed results on actually modifying the networking properties completely.  I have had to login to the ESX server with VI client and add in the default gateway in the VI client as well.  At this point I have absolutely no clue as to what is causing this inconsistency, I intend to find out though!  Once this is all complete VMKernel IP addresses can also be changed, if necessary.  I have found that the VI client is not very intelligent and will not take both IP and gateway changes in the same operation.  I have had to blank the gateway and save prior to changing the IP then reset the gateway address.

This is the procedure I’ve used to take a perfectly good server and reuse after a hardware refresh.  Good luck.