howto change the ipaddress of an ESX server from the server console

from the service console

  • login with or su to root
  • esxcfg-vswif -d vswif0
    this will delete the existing vswif0, will give an error about nothing to flush
  • esxcfg-vswif -a vswif0 -p Service\ Console -i xx.xx.xx.xx -n 255.255.255.0 -b xx.xx.xx.255
    replace the xx after -i with the new ipaddress, and the xx after -b with the broadcast address.  So not the default gateway, but the broadcast address!
    example: esxcfg-vswif -a vswif0 -p Service\ Console -i 192.168.1.22 -n 255.255.255.0 -b 192.168.1.255
  • for the default gateway
    edit the file /etc/sysconfig/network .  You can edit this file with vi or nano (I prefer nano).
  • after that, reboot the ESX.  You can already connect to the ESX without rebooting, but virtual center reacts funny without a reboot.  Or connect to virtual center and check the network configuration 🙂
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s