The Cisco Discovery Protocol (CDP) is a Cisco proprietary protocol to share information between directly connected network devices. It’s very useful, especially in a complex network, to discover its topology, for example which switch port a server is connected to.
In addition to CDP and other proprietary protocols, a IEEE standard protocol exists, the Link Layer Discovery Protocol (LLDC).
VMware supports both CDP and LLDC in three modes:
[checklist]
- Listen
- Advertise
- Both
[/checklist]
In Listen mode, the ESXi servers receive and display network information from other devices; in Advertise mode the servers sends information and in Both mode the servers both send and receive.
By default, the mode active on the virtual switches (both standard and distributed) is the listen one and the information the host receives are displayed with a click on the “baloon” icon next to the network interface:
If you’re using distributed vSwitches, you can switch to advertise or both mode using the GUI. Right click on the dvSwitch and choose Edit Settings…:
In the Advanced section, you can change the protocol (CDP/LLDC) and the operation (mode):
For local (standard) vSwitches, you have to connect via SSH to each host and type the following command:
esxcfg-vswitch --set-cdp <mode> <vSwitchName>
For example, to change the mode to both for the vSwitch0:
Once you have activated advertise or both mode, you can check if the server is correctly sending information using the CDP (or LLDC) commands at the switch side; for Cisco devices:
show cdp neighbors