In the previous post we discussed what the VMware vSwitch actually was. This allowed the reader to gain insight into the difference of a software switch compared to a hardware switch. This discussion assumes a default vSwitch install and the uplink is connected to a Cisco switch. After you first install the ESXi hypervisor your vSwitch will be listening to CDP to learn about the upstream switch. In the distributed vSwitch you will find the ability to enable the sending of CDP packets or LLDP. The default vSwitch in the GUI doesn’t let you configure this.

It is time to dive into ESXi command line to enable the vSwitch to send CDP information to the upstream switch.

# esxcfg-vswitch -b vSwitch0
listen

As we can see we are looking at the information of vSwitch0. Listen has been printed below our command. At the moment we are seeing one way CDP information. The three modes that can be configured are listen, advertise, both. The following command will enable CDP for the vSwitch.

#  esxcfg-vswitch -B both vSwitch0

Now lets confirm that the ESXi host is sending CDP to the uplink switch.

# esxcfg-vswitch -b vSwitch0
both

Now from the switches point of view.

LAB-SW-01#sh cdp nei | beg esxi01
esxi01.lab.internal
                 Gig 1/0/10        151               S    VMware ES vmnic8

LAB-SW-01#sh cdp nei det 

Device ID: esxi01.lab.internal
Entry address(es): 
Platform: VMware ESX,  Capabilities: Switch 
Interface: GigabitEthernet1/0/10,  Port ID (outgoing port): vmnic8
Holdtime : 154 sec

Version :
Releasebuild-800380

advertisement version: 2
VTP Management Domain: ''
Duplex: full
Management address(es): 

LAB-SW-01# sh mac address-table | inc 1/0/10
  11    000c.2981.0cc9    DYNAMIC     Gi1/0/10
  11    0050.56b0.58e9    DYNAMIC     Gi1/0/10

Look at that. Uplink information, the ability to quickly find the correct port and the associated vmnic inside the Hypervisor. Awesome stuff. Now this may violate some security policies or not a great use in certain environments but you can enable it in places that are safe to such as management networks. It certainly can help with documentation!

Leave a Reply

Your email address will not be published. Required fields are marked *

*