Implementing LLDP and CDP in vSphere 5

In one of our data silos, we’ve been using a lot of spreadsheets and manual tracking to manage physical-to-virtual cross-connects between our physical switches and our ESXi hosts.  There are a couple of reasons for this.  The first is that up until recently, the silo was using non-Cisco switches and the second is that the licensing on our hosts don’t allow for LLDP, only CDP.  We only have Standard licensing and Enterprise is required for distributed switches.  Only distributed switches can do LLDP, so we were stuck with a protocol that we couldn’t use with our physical switches.  Now that we’re in the process of migrating the silo to some newer hardware, I’m preparing to do a small redesign of our environment.

I’ve added some additional physical NICs to increase our host-side port density and I’ve moved off of the cheap low-end switches onto Cisco gear.  However, since I’m sick of tracking cables manually and tagging switchports with “description” lines.  I’m finally able to start using the discovery protocol for which we’re licensed.  Since we don’t have distributed switches in this silo, I’ll be using CDP instead of LLDP, but our new Cisco switches will like that just fine.

By default, a virtual standard switch has CDP enabled, but it’s in “listen” mode only.  We’re going to change that to “both” (listen/broadcast).  For vSS, there’s no GUI.  We can do it with esxcli, though:

# esxcli network vswitch standard set -v vSwitch0 -c both

Here’s a screen shot of my lab environment so you can see what the results look like:


Great!  Now that I am broadcasting CDP instead of just listening, let’s see what the physical switch sees!  In the next screen shot, I executed a “show cdp neighbors” both before and after enabling CDP on my lab host.

neighborsYou can see a couple of other Cisco devices being picked up on the uplink port (G1/0/1) in the top section, but now that CDP is broadcasting, the rest of my ESXi ports are self-documenting as well.  It displays the vmnic as well as the local physical switch interface to which it is connected.  Fantastic!

If you’re fortunate enough to have Distributed Switches in your licensing, you can enable LLDP and/or change the discovery protocol options through the GUI as well.  Go into Inventory – Networking, edit the properties of the vDS and click on Advanced on the Properties tab.  Here’s a screen cap of the VIC:


Since we’re a fairly small shop, this should take away some of the paperwork involved in documenting this part of our network and make it easier and faster to do the administrative tasks that we should be doing instead.


One thought on “Implementing LLDP and CDP in vSphere 5

Comments are closed.