Loading

×Sorry to interrupt
CSS Error

Refresh

Cookie Preference Center

General Information on cookies

When you visit our website, we use cookies to ensure that we give you the best experience. This information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies by clicking on the different category headings to find out more and change your settings. However, blocking some types of cookies may impact your experience on the site and the services we are able to offer. Further information can be found in our

Cookie Policy.

Strictly Necessary

Strictly Necessary

Always Active

Strictly Necessary

Strictly necessary cookies are always enabled since they are essential for our website to function. They enable core functionality such as security, network management, and website accessibility. You can set your browser to block or alert you about these cookies, but this may affect how the website functions. For more information please visit www.aboutcookies.org or www.allaboutcookies.org.

Cookie Details‎

Performance

Performance

Performance

Performance cookies are used to analyze the user experience to improve our website by collecting and reporting information on how you use it. They allow us to know which pages are the most and least popular, see how visitors move around the site, optimize our website and make it easier to navigate.

Cookie Details‎

Please confirm your settings by refreshing the page.

Functional

Functional

Functional

Functional cookies help us keep track of your past browsing choices so we can improve usability and customize your experience. These cookies enable the website to remember your preferred settings, language preferences, location and other customizable elements such as font or text size. If you do not allow these cookies, then some or all of these services may not function properly.

Cookie Details‎

Advertising

Advertising

Advertising

Advertising cookies are used to send you relevant advertising and promotional information. They may be set through our site by third parties to build a profile of your interests and show you relevant advertisements on other sites. These cookies do not directly store personal information, but their function is based on uniquely identifying your browser and internet device.

Cookie Details‎

Advertising Cookies

Consent Leg.Interest

Select All Vendors

Select All Vendors

Select All Hosts

Select All

Clear Filters

Information storage and access

Apply

Confirm My Choices Reject All Allow All

Skip to main content

My Subscriptions

Loading

Knowledge Base

Cisco Discovery Protocol (CDP) network information (1007069)

Last Updated: 2/14/2016Categories: How toTotal Views: 169814Language:
Chinese (Simplified)JapaneseEnglish

13 like this article

Subscribe to get an email
newsletter with new updates

13 people found this helpful Please provide article feedback:

Purpose

This article provides steps to view Cisco Discovery Protocol (CDP) information.

Resolution

CDP is used to share information about other directly-connected Cisco networking equipment, such as upstream physical switches. CDP allows ESX and ESXi administrators to determine which Cisco switch port is connected to a given vSwitch. When CDP is enabled for a particular vSwitch, properties of the Cisco switch, such as device ID, software version, and timeout, may be viewed from the vSphere Client. This information is useful when troubleshooting network connectivity issues related to VLAN tagging methods on virtual and physical port settings.

Note: For CDP information to be available, ESX hosts must be configured to listen for CDP information and connected devices must be advertising CDP information. If CDP information is not available, confirm that CDP is enabled on the ESX virtual switch and physical switch. For more information, see Configuring the Cisco Discovery Protocol (CDP) with ESX (1003885).

CDP information in the vSphere/VI Client

To view CDP information using the vSphere/VI Client:

Connect to the vCenter Server/Virtual Center or ESX host using the vSphere/VI Client.

Select the ESX host in the Inventory.

Click the Configuration tab.

Click Networking.

Click the Info icon to the right of the vSwitch, under Properties. For example:

A tool tip opens with the Cisco Discovery Protocol information for the selected physical network interface. For example:

CDP information via PowerCLI

To display CDP information using PowerCLI:

Using PowerCLI, connect to the ESX host or vCenter Server:

# Connect-VIServer esx-or-vc-hostname

Run this script in PowerCLI:

Get-VMHost | Where-Object {$_.ConnectionState -eq "Connected"} |
%{Get-View $_.ID} |
%{$esxname = $_.Name; Get-View $_.ConfigManager.NetworkSystem} |
%{ foreach($physnic in $_.NetworkInfo.Pnic){
$pnicInfo = $_.QueryNetworkHint($physnic.Device)
foreach($hint in $pnicInfo){
Write-Host $esxname $physnic.Device
if( $hint.ConnectedSwitchPort ) {
$hint.ConnectedSwitchPort
}
else {
Write-Host "No CDP information available."; Write-Host
}
}
}
}

The CDP information for each physical network interface on each connected ESX host is displayed.

For example:

esxhostname vmnic0
CdpVersion : 2
Timeout : 0
Ttl : 177
Samples : 54732
DevId : example-lab-b2-c02
Address : 10.11.12.254
PortId : GigabitEthernet1/0/7 <<< Switch Port ID >>>
DeviceCapability : VMware.Vim.PhysicalNicCdpDeviceCapability
SoftwareVersion : Cisco IOS Software, C3750 Softw
HardwarePlatform : cisco WS-C3750G-24TS-1U
IpPrefix : 0.0.0.0
IpPrefixLen : 0
Vlan : 1 <<< VLan ID >>>
FullDuplex : True
Mtu : 0
SystemName :
SystemOID :
MgmtAddr : 10.11.12.254
Location :

To get more information about the uplink Cisco switch and related configured physical switch ports with CDP, run this script in PowerCLI:

param($VMHost)
$vmh = Get-VMHost $VMHost
If ($vmh.State -ne "Connected") {
Write-Output "Host $($vmh) state is not connected, skipping."
}
Else {
Get-View $vmh.ID | `
% { $esxname = $_.Name; Get-View $_.ConfigManager.NetworkSystem} | `
% { foreach ($physnic in $_.NetworkInfo.Pnic) {
$pnicInfo = $_.QueryNetworkHint($physnic.Device)
foreach( $hint in $pnicInfo ){
# Write-Host $esxname $physnic.Device
if ( $hint.ConnectedSwitchPort ) {
$hint.ConnectedSwitchPort | select @{n="VMHost";e={$esxname}},@{n="VMNic";e={$physnic.Device}},DevId,Address,PortId,HardwarePlatform
}
else {
Write-Host "No CDP information available."
}
}
}
}
}

For example, if this script is saved as Get-mVMHostCDPInfo.ps1 :

# Get-mVMHostCDPInfo.ps1 -VMHost esxhostname | ft -a

VMHost VMNic DevId Address PortId HardwarePlatform
------ ----- ----- ------- ------ ----------------
esxhostname vmnic0 esx1.mon.com 1.1.1.1 GigabitEthernet1/0/9 cisco WS-C3750G-24TS-1U
esxhostname vmnic1 esx1.mon.com 1.1.1.1 GigabitEthernet2/0/21 cisco WS-C3750G-24TS-1U
esxhostname vmnic2 esx1.mon.com 1.1.1.1 GigabitEthernet1/0/10 cisco WS-C3750G-24TS-1U
esxhostname vmnic3 esx1.mon.com 1.1.1.1 GigabitEthernet2/0/10 cisco WS-C3750G-24TS-1U
esxhostname vmnic4 esx1.mon.com 1.1.1.1 GigabitEthernet1/0/11 cisco WS-C3750G-24TS-1U
esxhostname vmnic5 esx1.mon.com 1.1.1.1 GigabitEthernet2/0/11 cisco WS-C3750G-24TS-1U
esxhostname vmnic6 esx2.mon.com 1.1.1.2 GigabitEthernet1/0/6 cisco WS-C3750G-24TS-1U
esxhostname vmnic7 esx2.mon.com 1.1.1.2 GigabitEthernet1/0/8 cisco WS-C3750G-24TS-1U

CDP information via the ESX/ESXi command line

To view CDP information using the ESX/ESXi command line:

Log into ESX/ESXi via SSH or the console as root.

Run this command to view the CDP information:

For ESX 4.x:

# vmware-vim-cmd hostsvc/net/query_networkhint

For ESXi 4.x and 5.x:

# vim-cmd hostsvc/net/query_networkhint

For ESXi 4.x and 5.x if you want to specify only one physical NIC to query run:

# vim-cmd hostsvc/net/query_networkhint --pnic-name=vmnic[xx]

Note: Log into the ESXi host at the console. For more information, see Tech Support Mode for Emergency Support (1003677).

The CDP information for each physical network interface on each connected ESX host is displayed.

For example:

(vim.host.PhysicalNic.NetworkHint) [
(vim.host.PhysicalNic.NetworkHint) {
dynamicType = ,
device = "vmnic3",
subnet = (vim.host.PhysicalNic.NetworkHint.IpNetwork) [
(vim.host.PhysicalNic.NetworkHint.IpNetwork) {
dynamicType = ,
vlanId = 0,
ipSubnet = "10.21.4.1-10.21.7.254",
}
],
connectedSwitchPort = (vim.host.PhysicalNic.CdpInfo) null,
},
(vim.host.PhysicalNic.NetworkHint) {
dynamicType = ,
device = "vmnic1",
subnet = (vim.host.PhysicalNic.NetworkHint.IpNetwork) [
(vim.host.PhysicalNic.NetworkHint.IpNetwork) {
dynamicType = ,
vlanId = 0,
ipSubnet = "10.21.3.1-10.21.3.15",
}
],
connectedSwitchPort = (vim.host.PhysicalNic.CdpInfo) {
dynamicType = ,
cdpVersion = 0,
timeout = 0,
ttl = 169,
samples = 2982,
devId = "PA-3210-2-R15-SW1",
address = "10.21.10.115",
portId = "GigabitEthernet1/0/7", <<< Switch Port ID >>>
deviceCapability = (vim.host.PhysicalNic.CdpDeviceCapability) {
dynamicType = ,
router = false,
transparentBridge = false,
sourceRouteBridge = false,
networkSwitch = true,
host = false,
igmpEnabled = true,
repeater = false,
},
softwareVersion = "Cisco IOS Software, C3750 Softw",
hardwarePlatform = "cisco WS-C3750G-48TS",
ipPrefix = "0.0.0.0",
ipPrefixLen = 0,
vlan = 3, <<< VLan ID >>>
fullDuplex = true,
mtu = 0,
systemName = "",
systemOID = "",
mgmtAddr = "10.21.10.115",
location = "",
},
},
]

We can also find the same CDP information by running this command:

# esxcfg-info | less

Search for the specific vmnic# (in this example vmnic0 ) to find the CDP information.

Example output:

|----Name........................................vmnic0
|----PCI Bus.....................................3
|----PCI Slot....................................0
|----PCI function................................0
|----MAC Address.................................xx:xx:xx:xx:xx:xx
|----Virtual MAC Address.........................xx:xx:xx:xx:xx:xy
|----Driver......................................bnx2
|----Network Hint................................0 10.112.100.0/255.255.252.0
|----MTU.........................................1500
|----Configured Speed............................1000
|----Actual Speed................................1000
|----Configured Duplex...........................1
|----Actual Duplex...............................1
|----Link Up.....................................true
|----enabled.....................................true
|----Wake on LAN supported ......................true
|----Wake on LAN enabled ........................true
|----Resource scheduler allowed ................true
|----Resource scheduler supported ...............true
|----CDP Network.................................true
\==+CDP Summary :
|----Cdp Version.............................2
|----Timeout.................................0
|----Time-to-live............................177
|----Samples.................................20131
|----Device Id...............................c2960G-lab-c18
|----Ip Address..............................10.112.106.86
|----Ip Prefix...............................0.0.0.0/0
|----Port Id.................................GigabitEthernet0/35
|----Capabilities............................40
|----Version.................................Cisco IOS Software, C2960 Software
|----Platform................................cisco WS-C2960G-48TC-L
|----Vlan....................................1032
|----Duplex..................................true
|----MTU.....................................0
|----System Name.............................
|----System OID..............................
|----Mgmt Ip Address.........................10.112.106.86

To set up the CDP information using the PowerCLI
$esxcli = Get-EsxCli -VMHost $myhost
$esxcli.network.vswitch.standard.set("both","1500","vSwitch0")

To set up the CDP information on ESXi 5.x using the esxcli command

# esxcli network vswitch standard set –c both –v vSwitch#

Note: Replace # with the vSwitch number.

Related Information

For more information on the VMware vSphere PowerCLI, see the vSphere PowerCLI community page.

To establish compatible virtual switch configuration, see VLAN configuration on virtual switches, physical switches, and virtual machines (1003806).VLAN configuration on virtual switches, physical switches, and virtual machines
Configuring the Cisco Discovery Protocol (CDP) with ESX/ESXi
Cisco 发现协议 (CDP) 网络信息
シスコ検出プロトコル（CDP）ネットワーク情報

Detectable by VMware SkylineTM

Actions

Copy

link to clipboard
copied!

Print

Language:
Chinese (Simplified)JapaneseEnglish

Attachments

Additional Resources

KB
•
End Of General Availability of the Free vSphere Hypervisor (ESXi 7.x and 8.x) (2107518)

KB
•
Download and Install VMware Fusion (2014097)

Results 1-2 of 2

Ask The Community

Get answers quickly from VMware experts in the community

Post Subject

CONTINUE IN COMMUNITIES

Related Products:

VMware vSphere ESXi

VMware VirtualCenter

VMware vCenter Server

VMware ESX Server

Related Versions:

VMware vSphere ESXi 5.5

VMware vSphere ESXi 5.1

VMware vSphere ESXi 5.0

VMware VirtualCenter 2.5.x

VMware vCenter Server 5.5.x

VMware vCenter Server 5.1.x

VMware vCenter Server 5.0.x

VMware vCenter Server 4.1.x

VMware vCenter Server 4.0.x

VMware ESXi 4.1.x Installable

VMware ESXi 4.1.x Embedded

VMware ESXi 4.0.x Installable

VMware ESXi 4.0.x Embedded

VMware ESXi 3.5.x Installable

VMware ESXi 3.5.x Embedded

VMware ESX Server 3.5.x

VMware ESX 4.1.x

VMware ESX 4.0.x

view all

Take Our Survey

Was this article helpful?

YES

NO

Copyright © 2005-2024 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.

Terms of Use

Your California Privacy Rights

Privacy

Accessibility

Cookie Settings

Support Assistant