Setting Default Gateway on vSphere 4

I had an issue recently where I had installed ESX4 on a number of hosts but had not been allocated IP addresses for them.  So I installed them using DHCP. 

Later when I had been given the IP addresses I set them on the service console via the vSphere Client, on checking the default gateway it was already set as it had been picked up from the DHCP server.  I checked connectivity to each of the hosts while I was oniste but later while working remotely I could not access the service consoles, obviously the default gateway was not correct. 

The servers were all IBM System x3650M2 servers with the IBM Virtual Media Key installed so I could access the Integrated Management Module (IMM) and access the console via the Remote Console functionality.  The default gatewayhas correctly listed in /etc/vmware/esx.conf but was not listed in /etc/sysconfig/network

The solution was to add the following to /etc/sysconfig/network (I added it as the last line)

GATEWAY=xxx.xxx.xxx.xxx

where xxx.xxx.xxx.xxx is the IP address of the default gateway.

For this change to be picked up networking needed to be restarted by running

/etc/init.d/network restart

This procedure could be used if you ever need to change the default gateway on ESX4.  To should be the same for previous versions of ESX.

Advertisements
This entry was posted in Configuration, VMware, vSphere. Bookmark the permalink.

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