WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud
  • Tanzu
    • Application Modernization
    • Tanzu services
    • Tanzu Community Edition
    • Tanzu Kubernetes Grid
    • vSphere with Tanzu
  • Home Lab
  • Nested Virtualization
  • 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. S 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
      • Werner 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. P. 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
    • Riemann 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
      • P. 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. Ganadmin 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. Ganadmin 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

Author

William Lam is a Senior Staff Solution Architect working in the VMware Cloud team within the Cloud Infrastructure Business Group (CIBG) at VMware. He focuses on Cloud Native technologies, Automation, Integration and Operation for the VMware Cloud based Software Defined Datacenters (SDDC)

Connect

  • Email
  • GitHub
  • LinkedIn
  • RSS
  • Twitter
  • Vimeo

Recent

  • Changing the default HTTP(s) Reverse Proxy Ports on ESXi 8.0 03/22/2023
  • Quick Tip - How to download ESXi ISO image for all releases including patch updates? 03/15/2023
  • SSD with multiple NVMe namespaces for VMware Homelab 03/14/2023
  • Is my vSphere Cluster managed by vSphere Lifecycle Manager (vLCM) as a Desired Image or Baseline? 03/10/2023
  • Interesting VMware Homelab Kits for 2023 03/08/2023

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 © 2023

 

Loading Comments...