Troubleshooting VLAN connectivity on ESXi uplinks
search cancel

Troubleshooting VLAN connectivity on ESXi uplinks

book

Article ID: 375097

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

A VM may not be able to connect to devices on the network when bound to certain uplinks on an ESXi host.  There is no indication of a vnic being disconnected, and the VM itself shows an active network link.

Environment

VMware ESXi 7.x
VMware vCenter Server 7.x
VMware ESXi 8.x
VMware vCenter Server 8.x

Cause

Upstream switch ports need to be configured to allow traffic on all VLANs used by endpoints on the ESXi host.

Resolution

Determine which VMNIC a VM is bound to for communication outside the host:

  • Start esxtop using the command :

esxtop

  • Change to the networking view by pressing 'n'
  • From this screen, locate the VM name and the uplink
  • Confirm required VLANs are configured upstream on all uplinks - run the following commands on both hosts:

esxcli network nic vlan stats set -e true -n vmnicX 

  • Where vmnicX is the uplink in use by the VM. 
  • After 10 seconds run the following commands on both hosts, and provide the output to VMware:

    esxcli network nic vlan stats get -n vmnicX

  • The output will look similar to the image below :

Note : Since the VLAN tagged on vmnic1 is only VLAN 0, we are able to see it as shown in the screenshot. If there are multiple VLANs tagged, they will show up too in the output.

  • All VLANs should show receive traffic from upstream.  If no receive traffic is reported, that indicates the upstream switch port is not configured to allow that particular VLAN.
  • After gathering the output above, reset the stats to false (this is just cleanup, it isn't impacting the functionality of the system)

    esxcli network nic vlan stats set -e false -n vmnicX

Note : The VLAN stats are designed for use as a troubleshooting tool and should not be left running full time.  It is important to disable the stats after troubleshooting has completed.

Additional Information

To determine which VMNIC a VM is bound to for communication outside the host run the below commands:

esxcli network vm list | grep -i vm_name. --> This command will list networking information for the virtual machine

esxcli network vm port list -w 'world_id'  ---> Specify the corresponding world ID number which is an output to the above command.