This tutorial will show you how to Verify the VLAN trunk on ESXi Host using CLI - SSH.
Most of the environment Network and Compute are managed by a different team. If there is any new deployment of Compute cluster or addition of VLAN in the existing compute resources. Compute team will share requirements. The VLANs that are allowed on the trunk link which is directly connected to servers' physical port -> TOR switches. In some cases, the network team forgets to add the new VLAN on a specific physical port. These human errors may lead major impact on production.
The role of the VMware Administrator makes sure that the allowed VLANs are spanned across the physical ports of the ESXi hosts.
VLAN Trunk Verify thru CLI
Step 1: Using SSH you can verify the VLAN trunk on ESXi Host.
Note: Use a Privilege account to login into ESXi Host and execute the commands mentioned in step 2.
Step 2: In the VMware vSphere ESXi Shell / PUTTY, run this command.
!Command to list the ESXi Physical Adapter
esxcli network nic list
!Command to Enable VLAN Stats for vmnic0 and vmnic1
esxcli network nic vlan stats set -e true -n vmnic0
esxcli network nic vlan stats set -e true -n vmnic1
!Command to get allowed VLANs from the physical layer to ESXi host for vmnic0 and vmnic1
esxcli network nic vlan stats get -n vmnic0 | grep -E VLAN
esxcli network nic vlan stats get -n vmnic1 | grep -E VLAN
!Command to Disable VLAN Stats for vmnic0 and vmnic1
esxcli network nic vlan stats set -e false -n vmnic0
esxcli network nic vlan stats set -e false -n vmnic1
Verification Command Output:
Note:
Network Switch - CDP or LLDP Discovery Protocol type should be enabled for the UPlinks.
ESXi Host - Make sure your Distributed Virtual Switch [DVS] Discovery Protocol Operation should be in the Listen State. TOR Switches - if it's Cisco choose Type: Cisco Discovery Protocol, Other vendors choose Type: Link Layer Discovery Protocol.
Output: Distributed Switch Configuration
#ESXi VLAN Trunk Validation#ESXi VLAN Trunk Verification
#Verify ESXi Host VLAN Trunk
#Trunk validation between ESXi host and TOR Switches
I hope this information is useful for you. Please forgive any typos or incomplete sentences.
Thanks for Visiting vNetes.com