In today’s post we will have a look on some networking commands allowing us to troubleshoot or view networking information on ESXi host. ESXi Commands List is part of a serie, but this serie of posts is not an exhaustive nor a deep dive into a VMware CLI, but rather an introductory series which shall get you through some basic CLI commands used on the ESXi shell.
The networking namespace can be broken into several sub commands after typing the esxcli network. So let’s check what’s available in the esxcli network namespace by simply invoking this command (Note that you must previously activate SSH to be able to connect with Putty or other SSH client).
See the first introductory post where we discuss the basics – ESXi Commands List – Getting started.
ESXi Commands List – networking commands
After connection via Putty, type this:
As you can see from the available namespace we can go a bit further for example
esxcli network nic
gives us another level where we have two things:
- Another namespace – to go further down
- Available commands – commands which allows direct execution
So here we are able to list and modify NIC information, such as name, wake on LAN, and speeds….
So when executing
esxcli network nic list
we get the details about our NICs…
esxcli network vm list
shows networking info about the VMs with number of active network ports, with details…
Now let’s take a look at the
esxcli network ip
which allows us to manage VMkernel ports (management, vmotion, FT…) This command allows modify other network informations, like dns, routing or IPsec
Now the vSwitch…
esxcli network vswitch
gives us option to work with standard vSwitch or distributed vSwitch (vds)
esxcli network vswitch standard
Now, to see that we are not only able to list network configs but also modify/add stuff. Let’s add a second vswitch!
esxcli network vswitch standard add -v vswitch1
*Note that there is no output (no output = success !!!)
Now if we list the vswitches present on the esxi host with
esxcli network vswitch standard list
we will see our newly added vSwitch. By default (without precising how many ports you want on this vswitch, a 128 ports is created) and MTU is 1500.
Network Troubleshooting commands
vmkping is one of them. This command allows us to use the IP stack of VMkernel interface to send a ping command to another VMkernel interface. Like this you can check if the remote site (remote host) reply on this VMkernel. Good when configuring iSCSI or vMotion VMkernel interfaces…
Let’s describe our scenario. I’m connected via Putty to my esxi host on 10.10.5.11 and I’ll be pinging by using vmk5 (vsan vmkernel interface with 10.10.6.11 as an IP) another esxi host in my cluster on 10.10.5.10. I’ll be pinging the remote vmkernel interface on 10.10.6.10.
vmkping -l vmk5 10.10.6.10
So as you can see, the connectivity works as expected.
More ESXi CLI commands: