Checking the VLAN tag for a Virtual Machine or VMkernel adapter connected on a Virtual Distributed Switch using CLI
search cancel

Checking the VLAN tag for a Virtual Machine or VMkernel adapter connected on a Virtual Distributed Switch using CLI

book

Article ID: 411274

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

  • In scenarios where vSphere Client access is unavailable, administrators may need to verify the VLAN tag assigned to a virtual machine (VM) network adapter or a VMkernel adapter to troubleshoot network connectivity or validate configuration. 
  • This article provides the CLI steps for checking the VLAN tag of Connectee's connected to a Virtual Distributed Switch (VDS).

Environment

VMware vSphere ESXi

Resolution

Following steps have to be performed to check the VLAN tag:

  • Open SSH session to the ESXi host where the Virtual Machine is running.

  • Execute command esxcfg-vswitch -l and note down the DVPort ID:

In this case Windows10 Virtual Machine is connected on DVPort 384.

  • Run the command net-dvs -l | less.

  • Type the following string to search for DVPort 384 in the output:

/port 384:

And search for key com.vmware.vswitch.port.vlan which will give the VLAN tag:

 

**NOTE: Above steps can also be performed for a VMkernel adapter.