How to find which vmnic a VM is using on ESXi?
search cancel

How to find which vmnic a VM is using on ESXi?

book

Article ID: 385143

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article shows the different methods to find which VMNIC a VM uses on ESXi.

Environment

  • ESXi 7.x
  • ESXi 8.x
  • ESX 9.x

 

Resolution

The four methods to find which VMNIC a VM uses on ESXi:

  1. esxtop
  2. vsish
  3. esxcli network
  4. netdbg vswitch instance list


1. esxtop

SSH to ESXi host, Run the command "esxtop" press enter, and press "n", Under the TEAM-PNIC column, find the vmnic used by the target VM


2. vsish

SSH to ESXi host, Run the command "net-stats -l" to get the network adapter ID(PortNum) and vSwitch name which VM is located of target VM.
Then get the VMNIC of the actual use with the command "vsish -e cat /net/portsets/<vSwitch_name>/ports/<switchport_number>/teamUplink


You also can refer Broadcom KB: Packet capture on ESXi using the pktcap-uw tool

3. esxcli network

SSH to ESXi host, Run the command "esxcli network vm list" to find World ID of target VM.
Then run the command "esxcli network vm port list -w <World ID>"



4. netdbg vswitch instance list

SSH into the ESXi Host and Run the Command: netdbg vswitch instance list


  • Note: This command will not display NSX switches.