Have you ever made a change to your VMware ESX Server Network configuration using the Virtual Infrastructure (VI) Client and then lost communications with the server? If you had to go to the ESX Service console to troubleshoot the virtual network configuration, would you know the commands to do it? In this article, you will learn the 5 most critical ESX CLI commands you need to know to troubleshoot networking issues.
The service X restart command is an excellent command that allows you to restart any service running on your ESX Server. In our case, we are using the network keyword to restart network services. This is the command you should run after making changes to your ESX networking configuration. You can also do network start or network stop. This brings down all network interfaces, then brings up the interfaces configured to start at boot.
Here is an example of what it looks like an an ESX Server:
The second command is ifconfig. Similar to the Windows command, ipconfig, this command is used to view the status of all network interfaces on the system. However, it can do a lot more than just view an interface, it can reconfigure interfaces, bring them down, or back up. You can change the IP address of your interfaces with ifconfig.
Here is an example of what it looks like an an ESX Server:
Next, we have the ESX command that allows you to view the status of or reconfigure the VMware Service console network interface. That SC network interface is called “vswif” and the first interface is always “vwsif0”. To view the status of it, you can use the -l (L for list) command, like this:
The fourth command on the list is the esxcfg-vswitch command. This command is used to view the status of or reconfigure the VMware virtual switches (called vswitch). These vswitches are used to connect the physical NIC in the server (called vmnic) to the ESX port groups (such as the “Service Console” and the “VM Network” port groups). To view the status of your vswitches, you can use the -l (L for list) command, like this:
As you can see, this ESX server has 4 port groups but they are all associated with a single VMnic interface.
Lastly, we have the esxcfg-nics command. This command is used to view the status of or reconfigure the VMware Physical Network interface cards that are installed in the physical server. These physical NICs are called “vmnic” and they start with “vmnic0”. The vmnics are connected to vswitches to connect the physical network to the virtual networks.
To view the status of your vmnics, you can use the -l (L for list) command, like this:
As you can see, this server just have a single physical NIC, vmnic0.
Summary
Believe me, there was a time that I was stuck at the ESX service console interface, trying to resolve a networking issues, and struggling to find the right commands to do it. I hope that you will save this URL or print this article to keep it handy the next time you are in a similar situation because that know that these 5 commands can help you get out of any VMware ESX Server networking configuration or troubleshooting issue.