To configure CDP for a Standard vSwitch:
-
Log in as root to the Service Console (via SSH, remote console, or physical console if connecting to ESX) or to management vmkernel port (if connecting to ESXi).
-
Verify the current CDP setting for the desired virtual switch (vSwitch1, in this example):
# esxcfg-vswitch -b vSwitch1
You see an output similar to:
listen
The output of listen indicates CDP is configured to read CDP information from the physical switch if available.
This is the default setting for ESXi.
-
Set the CDP status for a given virtual switch. Possible values here are down, listen, advertise, or
both
.
Down Mode
- The Esxi host disables CDP.
Listen mode
- The ESXi host detects and displays information about the associated Cisco switch port, but information about the vSwitch is not available to the Cisco switch administrator.
Advertise mode
- The ESXi host makes information about the vSwitch available to the Cisco switch administrator, but does not detect and displays information about the Cisco switch.
Both mode
- The ESXi host detects and displays information about the associated Cisco switch and makes information about the vSwitch available to the Cisco switch administrator.
# esxcfg-vswitch -B both vSwitch1
4. Verify the new setting:
# esxcfg-vswitch -b vSwitch1
You see an output similar to:
both
To configure CDP on a vNetwork Distributed Switches (vDS):
-
Connect to vCenter Server using the vSphere Client.
-
In the vCenter Server home page, click Networking.
-
Right-click the vDS and click Edit Settings.
-
Select Advanced under Properties.
-
Using the checkbox and the drop down, change the CDP settings.
The following is an example of configuring CDP for a Cisco 6500 physical switch:
-
switch#
- switch# config terminal
- switch(config)# cdp run
- switch(config)# interface g1/1
- switch(config-if)# cdp enable
-
switch# show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
Device ID Local Intrfce Holdtme Capability Platform Port ID
pa-tse-h24.pasl.vmware.comGig 1/1 121 S VMware ESXvmnic2
pa-tse-h24.pasl.vmware.comGig 1/2 121 S VMware ESXvmnic3
Additional Information
For translated versions of this article, see: