Use esxcli to gather network information from the ESXi command line.
- [Instructor] Before we begin diving into advanced networking topics, I want to introduce some of the command line tools that I'll be using, starting with esxcli. esxcli was introduced in 5.0, and its functionality has grown over time, so that it now supersedes many of the other command line utilities, such as the esxcfg commands. esxcli has a very long command list, and I'll go through some of the networking commands now, and I'll discuss others throughout this course. I'm currently logged in to a virtualized ESXi host, I've enabled SSH on it so that I have command line access.
You can also access this remotely through the Vmware Management Assistant, or vMA. esxcli is built on a namespace structure, so if I just type esxcli and Enter, it's going to show me all the available namespaces that I have. For each one of these, I can go a little bit deeper, and then it's going to show me, again, the available namespaces. The first one that I'll look at for networking is device driver list. This is going to list out all of the device drivers that I currently have loaded, and the devices that they are supporting.
This will show both my network interfaces as well as my storage interfaces. esxcli system module list is going to list out all of the modules that I have loaded. However, as you can see, this is a very long list. If I scroll up to the top, here, we'll see what these second and third columns mean. The second one indicates whether the driver is loaded, and the third one indicates whether it's enabled. If I'm looking for a specific driver, I can use the pipe symbol. Pipe from a command line will take the output of one command and use it as the input for the next command.
So I'm going to use grep, which is a search utility, and I'm going to look for vmxnet3. So now, I can see just that specific driver, and that it is loaded and enabled. If I want to see the parameters that are used to load that driver, I can use esxcli system module parameters list, and then specify the module. This gives me a list of parameters. The first column indicates the name, the second one is the type of parameter that it is, and the third one is the value.
Notice that currently, all of the values are blank. It's because I haven't actually set any of these for this particular module; it's using the defaults. The fourth column, under Description, will often show the default as well as give a little bit of a description of what that particular parameter does. For each network card that is loaded in your system, the parameter options will be different, so it's best to consult the vendor documentation to see which ones you can modify and what exactly they do. If I want to see a list of all of the nics that I have on this system, esxcli network nic list, spelling is important, and this shows the four vmnics that I have installed.
I can also take a look at the ARP table from the command line. The ARP table shows which MAC addresses the system has learned about, and their corresponding IP address. Here's the IP address, the MAC address that it matches and then which vmnic has learned that particular address. I can also look at all of the information for my vswitches from the command line. I want to go to standard. There's not a whole lot you can do with a distributed switch. You can mess around a little bit with link aggregation groups if you're using LICP, and that's about it.
Everything else on a distributed switch is managed through vCenter Server. So, let's take a look at our standard switches. And we'll see from here that we can do things like list out our port groups, we can add or remove uplinks, we can list out the available standard switches and then we can make configuration changes on those switches as well. So I'm logged onto my physical ESXi host now. The last command I want to show, for now, is esxcli network vm list. This is going to show my virtual machines, the number of nics that they have configured, and then what those nics are connected to.
This is the port group that those nics are connected to. We'll take a look at some other esxcli commands as we're going throughout the course. Next up, let's take a look at esxtop.
- Using command line utilities
- Performing packet captures
- Using the hardware compatibility list
- Installing drivers
- Understanding NetQueue and RSS
- Configuring VMDirectPath I/O
- Understand DvFilters
- Configure multicast filters
- Reviewing VMXNET3 features