Correlating HCX Network Extension Switchports to VLANs for Targeted Packet Captures
search cancel

Correlating HCX Network Extension Switchports to VLANs for Targeted Packet Captures

book

Article ID: 388893

calendar_today

Updated On:

Products

VMware HCX

Issue/Introduction

When performing packet captures on HCX Network Extension (NE) deployments, determining which VLAN is associated with a specific switchport is critical. Network administrators need to correlate switchports seen in vSphere with specific extended VLANs to properly target their packet captures. This correlation is essential for:

  • Accurate packet captures on specific extended networks
  • Targeted troubleshooting of VLAN-specific connectivity issues
  • Precise monitoring of network traffic on particular extended networks
  • Efficient network analysis and diagnostics

This article describes how to identify which VLANs correspond to which switchports by correlating MAC addresses between switchport information and network adapter settings in the HCX Network Extension appliance.

Environment

  • VMware HCX
  • VMware vSphere ESXi
  • VMware vCenter Server
  • HCX Network Extension service deployed

Cause

The challenge in performing targeted packet captures with HCX Network Extension stems from:

  • Each Network Extension appliance uses multiple network adapters, each associated with a different VLAN
  • The correspondence between switchports, MAC addresses, and VLANs is not immediately apparent
  • Command-line investigation is required to correlate this information
  • Standard packet capture tools require specific port/VLAN information but don't provide this correlation automatically

Resolution

Follow these steps to identify which VLANs are associated with specific switchports by correlating MAC addresses:

  1. First, identify the Network Extension VM in the vCenter inventory.
  2. Obtain a list of all VMs to find the World ID of the Network Extension VM

    esxcli network vm list

    Example output:

    World ID Name Num Ports Networks -------- ------------------------ --------- -----------------

    8734###   vm-prod-app-### 7 , , , , , , dvportgroup-3482###

    9217### vm-dev-web### 3 , , dvportgroup-3187###

    5392### vm-ne-### 7 , , , , , , dvportgroup-3482###

    • Note the World ID of the HCX Network Extension VM (5392### in this example)
  3. List all the ports associated with this VM to identify the switchports and their MAC addresses:

    esxcli network vm port list -w <world-id>

    Example output:
     

    Port ID: 78453896

    vSwitch: datacenter-vds01-###

    Portgroup: DVPort ID: 71aed22d-8934-4128-b530-65239f723###

    MAC Address: 00:50:56:00:74:22

    IP Address: 0.0.0.0

    Team Uplink: vmnic0

    Uplink Port ID: 3587421###

    Active Filters:

    Port ID: 78453###

    vSwitch: datacenter-vds01-###

    Portgroup: DVPort ID: 85b319fd-ca73-4277-8415-12f16e7c0###

    MAC Address: 00:50:56:00:74:23

    IP Address: 0.0.0.0

Document each Port ID and its corresponding MAC address

  1. Now, access the Network Extension VM's settings in the vSphere Client:
    • Right-click the VM and select Edit Settings
    • Review the network adapters section - please see screenshot below

  1. For each network adapter, record:
    • The MAC address displayed (e.g., 00:50:56:00:74:22)
    • The network name which contains VLAN information (e.g., L2E_vnet-vlan-222)
  2. Correlate the MAC addresses from the switchports with the network adapters:
    • MAC address 00:50:56:00:74:22 from Port ID 78453896 matches Network adapter 7
    • Therefore, Port ID 78453896 is handling traffic for VLAN 222 (from the adapter name L2E_vnet-vlan-222)
  3. Repeat this correlation for each port/network adapter to create a complete mapping table
    Port ID MAC Address Network Adapter VLAN
    78453896 00:50:56:00:74:22 Network adapter 7 222
  4. For physical network troubleshooting, provide network administrators with
    • The VLAN ID experiencing issues
    • The Port ID and MAC address associated with that VLAN

NOTE: The Port ID, VLAN and MAC are purely demonstrative in this article and not real and should never be used in real environments based off this article