WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / ESXi / Quick Tip - lldpnetmap, a handy utility to map pNic to pSwitch on ESXi

Quick Tip - lldpnetmap, a handy utility to map pNic to pSwitch on ESXi

05.20.2014 by William Lam // 8 Comments

Last week while attending VMware's R&D Innovation Offsite (RADIO), I ran into Christian Dickmann, who as many of you know works on the VSAN team. During our discussion, he mentioned a nifty little utility called lldpnetmap that he had used recently. This utility is found within the ESXi Shell and provides a quick and easy way to display the mapping between an ESXi hosts physical network interface to the physical switch they are connected to using LLDP (Link Layer Discovery Protocol). This is similar to what Cisco's proprietary discovery protocol (CDP) provides, but only details about the physical switch.

CDP has been supported with vSphere Standard Switches for quite sometime now, but LLDP support was only added recently with the introduction of the vSphere Distributed Switch. Chris Wahl has a great article here on why you should enable either CDP/LLDP and the benefits you get with it. For customers who are running non-Cisco switches, lldpnetmap is a great way to quickly figure out which physical switch your ESXi hosts are connected to, especially useful during troubleshooting where every minute counts.

There are actually two ways in which you can run the lldpnetmap utility. The first method is by running it within the ESXi Shell using the following command:

lldpnetmap

The command takes about about 30-60 seconds to run and if successful, you should see the name of the physical network switch and the vmnic (pNIC) that they are connected to.

Here is a screenshot of what that output looks like:

lldpnetmap-0
The second method is actually how Christian had been using the command which is through RVC. Using the vsan.lldpnetmap command, you can specify an individual ESXi host or an entire vSphere Cluster. Even though the command is under the VSAN namespace, you do not need to have VSAN enabled to use the command.

Here is a screenshot of what that output looks like:

lldpnetmap-1
Note: If you do not see any output, you are most likely connected to a Cisco switch or to a non-managed switch that does not support LLDP.

This is one utility I will be sure to remember the next time I need to troubleshoot a networking issue. Thanks for sharing this handy tidbit Christian!

More from my site

  • How to run the VSAN Observer in "collection" mode in the background?
  • A killer custom Apple Mac Mini setup running VSAN
  • Does VSAN work with Free ESXi?
  • ESXi 5.5 Kickstart script for setting up VSAN
  • Does reinstalling ESXi with an existing VSAN Datastore wipe your data?

Categories // ESXi, vSphere 5.5 Tags // ESXi 5.5, LLDP, lldpnetmap, rvc, vSphere 5.5

Comments

  1. *protectedS A says

    05/20/2014 at 4:04 pm

    is there any util for cisco / cdp ?

    Reply
    • William Lam says

      05/21/2014 at 4:27 am

      For CDP, you can enable it it on vSwitch which provides more details. A quick google will provide you with the instructions

      Reply
      • *protectedWerner says

        08/01/2014 at 1:34 pm

        Hi William,

        That is nice to know. We use in a lot of branch offices no cisco switches and vsphere is a standard edition because it's enough features for us….
        But when I try the lldpnetmap command I see only the relation between network card in the ESX and the connected switch name NOT the connected port on the switch. It is normal? For us it’s also important to know the switch port we the cable is plugged in.

        Reply
  2. *protectedP. Cruiser says

    05/20/2014 at 5:34 pm

    This is great. Unfortunately it has limited usefulness as there is still no lldp support for vSphere standard switches.

    Reply
    • *protectedRiemann says

      12/03/2014 at 3:23 am

      P. Cruiser, I'm not sure why you would think vSphere standard switch would/should have advanced functionality like lldp.

      Reply
      • *protectedP. Cruiser says

        12/03/2014 at 6:30 am

        VSS already has advanced functionality, but only CDP, not LLDP which makes no sense unless you enjoy vendor lock-in.

        Reply
  3. *protectedGanadmin says

    01/19/2016 at 4:46 pm

    ESX is connected to the arista but still it is now showing up , is this because of hp virtual connect layer ..?

    Reply
  4. *protectedGanadmin says

    01/19/2016 at 4:46 pm

    It is not showing the info...

    Reply

Thanks for the comment!Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025
  • vCenter Server Identity Federation with Kanidm 04/10/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025

 

Loading Comments...