Identifying Physical Switch Connectivity in vCenter Using lldpnetmap
When managing ESXi hosts in vCenter, one common challenge is visibility into the physical switch connections. While vCenter provides detailed information about virtual networking, it doesn’t always expose which physical switches the host NICs are connected to. This can make troubleshooting and auditing network paths more difficult.
The ChallengevCenter shows NICs and port groups but not the upstream switch details.
Network admins often need to confirm which physical switch and port a NIC is connected to.
This is especially important in environments with multiple switches, VLANs, or redundant uplinks.
The Solution: Use lldpnetmap
ESXi supports LLDP (Link Layer Discovery Protocol), which allows NICs to exchange information with connected switches. By logging into the ESXi host directly, you can query this data.
Login to ESXi Host
Access the ESXi host directly using SSH or a Putty session.
Open Putty → Enter ESXi host IP → Authenticate with root credentials
Ensure SSH is enabled on the host
Use secure credentials
Run the LLDP Command
Execute the built-in command to fetch NIC-to-switch mapping.
lldpnetmap
Displays all NICs on the host
Shows connected switch names and port IDs
Useful for verifying uplink connectivity
Interpret the Output
Review the displayed NIC and switch details to confirm connectivity.
Each NIC will list the connected switch
Port IDs help identify exact switch ports
Cross-check with switch configuration for accuracy
Apply in Troubleshooting
Use the mapping to resolve network issues or validate configurations.
Identify misconnected NICs
Verify redundancy across switches
Document physical connectivity for audits
Example Output
# lldpnetmap
vmnic0 -> Switch01 Port Gi1/0/24
vmnic1 -> Switch02 Port Gi1/0/12
This output clearly shows which NIC is connected to which physical switch and port.
Benefits
Faster troubleshooting: Quickly identify miswired or disconnected NICs.
Improved documentation: Maintain accurate records of host-to-switch connectivity.
Enhanced reliability: Validate redundancy and load balancing across multiple switches.
No comments: