Changing IP configurations and enabling SSH in ESX

A few simple commands to help troubleshoot ESX connections.
NOTE: The commands listed must be executed as root. This guide assumes you are logged in as root and are locally connected to the ESX console.
To change the IP for vswif0 change directory to /usr/sbin/

  • cd /usr/sbin

Then delete the old vswif0 interface:

  • esxcfg-vswif -d vswif0

Now create a new vswif0 interface with the correct IP settings:

  • esxcfg-vswif -a vswif0 -p Service\ Console -i x.x.x.x -n x.x.x.x -b x.x.x.x
  • -a (Adds an interface)
  • -p (Sets the portgroup name of the int)
  • -i (IP of the vswif int, ex. 192.168.1.100)
  • -n (Netmask, ex. 255.255.255.0)
  • -b (Broadcast, ex. 192.168.1.255)

Now to verify the changes have been made type:

  • esxcfg-vswif -l

That will list all vswif interfaces and show the configurations.
To change your default gateway (extends beyond just the vswif interface):

  • nano /etc/sysconfig/network

Here you can change the hostname of the server and the default gateway. To change the gateway, just type in the IP of your gateway where it reads GATEWAY=:

  • GATEWAY=x.x.x.x

Now CTRL-O to write the file then press enter. Then to exit press CTRL-X.
Now that the IP configurations are correct, make sure you can ping the server.

To SSH into your ESX server, you only need to modify one config file. SSH is enabled by default, telnet is not (for security reasons).

  • nano /etc/ssh/sshd_config

Find the line that reads PermitRootLogin and change the no to yes.
Now restart the service and try remoting in.

  • service sshd restart

I use Putty to SSH into ESX, which can be downloaded here.

0 comments: