Use it to identify Cisco neighbours, find their management address, and spot native VLAN and duplex mismatches.
CDP (Cisco Discovery Protocol)
CDP (Cisco Discovery Protocol) is a Cisco Layer 2 protocol that announces device ID, port, platform, software version, IP addresses, native VLAN and duplex to directly connected Cisco devices every 60 seconds.
1. show cdp neighbors (and show lldp neighbors) — is the expected neighbour on the expected port?
2. Wrong neighbour or port → cabling or documentation is wrong.
3. No neighbour → protocol off on either side, or a non-Cisco device without LLDP.
4. show cdp neighbors <if> detail — management address to reach the neighbour.
5. Watch logs for native VLAN and duplex mismatch messages from CDP.
protocol enabled on both ends → advertisements sent on the link → neighbour entry created → device name and remote port match the design
Verify the peer interface and service-specific VLAN/routing state using independent commands.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
cdp runPrimary Commands
Configuration and operational commands for this Topic.
cdp runReferenceEnable CDP globally.
Use when: Enable CDP globally when Cisco neighbor discovery is part of the design/policy.
Quick note: Verify with show cdp and show cdp interface; apply interface policy deliberately.
no cdp runConfigureDisable CDP globally.
Use when: Disable CDP globally when policy or design requires no Cisco discovery advertisements on the device.
Quick note: Prefer the narrowest policy scope that meets the requirement.
Cisco IOS / IOS XE · mixedcdp enableReferenceEnable CDP on an interface (CDP must also be enabled globally).
Use when: Enable CDP on a specific interface when global CDP is active and the link should participate in discovery.
Quick note: Verify both global and interface state plus the peer.
Cisco IOS / IOS XE · mixedno cdp enableConfigureDisable CDP on this interface, for example toward untrusted devices.
Use when: Disable CDP on a specific interface without disabling it globally elsewhere.
Quick note: Use for targeted policy boundaries and document the exception.
Cisco IOS / IOS XE · mixedShow Commands
Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.
show cdpShowDisplay global CDP settings.
Use when: Check whether CDP is globally active before troubleshooting individual neighbors.
Quick note: Continue with show cdp interface and neighbor output.
show cdp neighborsShowDisplay directly connected Cisco neighbors learned through CDP.
Use when: Quickly map directly connected Cisco/CDP-capable peers and local-to-remote ports.
Quick note: Use detail for advertised addressing/platform information, then verify forwarding separately.
Cisco IOS / IOS XE · mixedshow cdp neighbors detailShowDisplay Cisco neighbor information.
Use when: Topology discovery.
Quick note: Cisco-specific discovery.
IOS/IOS XE · mixedshow cdp interfaceShowDisplay CDP status per interface.
Use when: Confirm CDP is active on the intended local link when a neighbor is missing.
Quick note: If active locally, inspect peer CDP/interface state and cabling.
Cisco IOS / IOS XE · mixedshow cdp entry {* | <device-name>} [protocol | version]ReferenceShows everything CDP knows about one named neighbor (or all with *): addresses, platform, local and remote port, and software version.
Use when: You know the neighbor name and need its management IP, model or IOS version without reading the whole neighbor table.
Quick note: The name must match the Device ID as CDP shows it. A trailing * works as a wildcard, for example "show cdp entry core*".
Cisco IOS / IOS XE · state · verifiesVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification and output interpretation Verify boundary
Use show cdp neighbors for the concise neighbor table and show cdp neighbors detail when you need management address, software/platform detail, advertised capabilities and additional TLVs. Verify the local interface and remote port ID against the intended cabling or topology record. Use show cdp interface or equivalent status output to confirm where CDP is enabled and its timer/encapsulation state. A healthy neighbor entry should refresh within the expected timer and remain associated with the correct local interface. If an expected neighbor is absent, first separate “CDP disabled/not supported” from “link not operational”; interface state and counters are independent evidence. For discovery-based documentation, record both local and remote interface identities rather than relying only on device names.
Evidence · 4 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
The official Cisco source documents this command in a bounded Cisco product/release or feature context.
command output · Evidence referenceExpected CDP neighbor is absentThe expected directly connected Cisco/CDP-capable peer is not present in show cdp neighbors.
CDP shows a different device ID or remote Port ID than the topology/inventory expects.
command output · Evidence referenceCDP management address is advertised but unreachableDetailed CDP output contains a management IP address, but management connectivity to that address fails.
On by default globally and per interface. Disable per port with no cdp enable on edge and internet-facing ports, or globally with no cdp run. IP phones use CDP to learn the voice VLAN, so keep it on phone ports.
show cdp neighbors— neighbour, local and remote port, platform.show cdp neighbors <if> detail— IP address, software, native VLAN, duplex.show cdp interface <if>— CDP enabled and timers.show cdp traffic— CDP packets sent and received.
ReferenceImportant terms & boundaries6 sections · depth on demand
Key points
cdp runcontrols CDP globallycdp enablecontrols CDP on an interfaceshow cdp neighborsis the fastest topology summaryshow cdp neighbors detailadds management/platform/version and remote-port detail- CDP neighbor presence is not evidence of VLAN, STP, EtherChannel, IP or application forwarding.
CDP evidence boundary
CDP can reveal the neighboring Cisco device ID, platform, capabilities, local interface, remote port ID and often a management address/version in detailed output. Those fields are advertised metadata. Validate forwarding and reachability with the relevant interface, VLAN, STP, EtherChannel or IP commands.
In depth
CDP in detail
CDP advertises a set of TLVs to directly connected Cisco devices. Cisco's IOS XE system management guide lists them: Device-ID, Address, Port-ID, Capabilities, Version, Platform, IP Network Prefix, Native VLAN, Full or Half Duplex, VTP Management Domain, Location and Application. CDP version 2, advertised by default, adds error reporting for mismatched native VLANs and duplex settings. Advertisements go out every 60 seconds by default (cdp timer) and are held for 180 seconds (cdp holdtime).
Commands (system management guide)
| Command | Scope | Effect |
|---|---|---|
cdp run / no cdp run | Global | Enable or disable CDP on the device |
cdp enable / no cdp enable | Interface | Enable or disable CDP per interface |
cdp timer <s> | Global | Advertisement interval |
cdp holdtime <s> | Global | How long receivers keep the entry |
cdp advertise-v2 | Global | Version 2 advertisements (on by default) |
show cdp entry <name> | Exec | Detail for one neighbour |
show cdp traffic | Exec | Packet counts and checksum errors |
clear cdp table | Exec | Flush the neighbour table |
SW1# show cdp
Global CDP information:
Sending CDP packets every 60 seconds
Sending a holdtime value of 180 seconds
Sending CDPv2 advertisements is enabled
SW1# show cdp neighbors TenGigabitEthernet1/1/1 detail | include Device ID|IP address|Platform|Interface|Native VLAN|Duplex
Device ID: dist1.example.net
IP address: 10.255.0.21
Platform: cisco C9500-24Y4C, Capabilities: Router Switch IGMP
Interface: TenGigabitEthernet1/1/1, Port ID (outgoing port): TwentyFiveGigE1/0/3
Native VLAN: 99
Duplex: full
SW1(config)# interface GigabitEthernet1/0/48
SW1(config-if)# description Internet handoff
SW1(config-if)# no cdp enable
Behaviour worth knowing (guide)
| Behaviour | Consequence |
|---|---|
| Cisco devices never forward CDP | You only ever see direct neighbours, unless a non-Cisco switch sits in between |
| Changing an interface's encapsulation re-enables CDP | Re-apply no cdp enable after such a change |
| Trunks with a non-default native VLAN send CDP tagged with VLAN 1 | Relevant when connecting routers to such trunks |
| A neighbour without an IP on the link may report another interface's address | Check the detail before trusting the address |
| Disabled by default on ATM point-to-point PVCs | Enable on both ends if needed |
Security
CDP reveals platform, software version and addresses to anyone on the link. Keep it on internal infrastructure links and phone ports, and disable it on edge, guest and provider-facing ports.
Documented example, not captured output.
Quick reference
CDP (Cisco Discovery Protocol) is a Cisco Layer 2 protocol that advertises device name, platform, software version, interface and management addresses to directly connected neighbors every 60 seconds. It helps map topology and verify cabling.
show cdp neighbors
show cdp neighbors detail
no cdp run ! globally off
interface Gi0/0
no cdp enable ! off on untrusted ports
Documented example, not captured output.
CDP reveals useful information to attackers too; disable it on internet-facing and untrusted user ports, and use LLDP for multi-vendor discovery.
State model and protocol mechanics
Cisco Discovery Protocol sends periodic Layer 2 advertisements on enabled interfaces and learns corresponding advertisements from directly connected Cisco-capable neighbors. The learned record can include device ID, local interface, remote port ID, platform, capabilities, management/IP information, native VLAN or other TLVs depending on device and version. Because discovery happens at Layer 2, neighbors can appear even when IP addressing or routing is incomplete. Holdtime controls how long learned information remains valid in the absence of fresh advertisements, so an entry can persist briefly after the underlying device or link changes. CDP is therefore especially useful for establishing physical/logical adjacency identity: which local port connects to which remote device/port and what role the neighbor advertises. It is not a routing adjacency protocol and does not install IP reachability.
Limits and common misconceptions
CDP neighbor presence is local adjacency evidence only. It does not show that the neighbor is reachable by IP, that VLANs/trunks are correct, that routing protocols are established or that a management address is usable from the current VRF. Absence of CDP does not show there is no connected device because the protocol may be disabled or unsupported. Advertised capabilities describe what a device reports about itself and should not be mistaken for a complete security or functional assessment. Because CDP may disclose infrastructure information, enabling it on every interface is not automatically desirable. Keep physical/link discovery, IP reachability, routing state and service health as separate layers.
ReferenceConfiguration & state1 section · depth on demand
Design and configuration model
CDP can be enabled globally and disabled or enabled per interface. In a controlled Cisco infrastructure, decide deliberately where discovery information is operationally useful and where advertising device identity, software/platform or addressing information is undesirable. Infrastructure-facing links often benefit from discovery, while untrusted external/customer-facing interfaces may intentionally suppress it. Timer and holdtime defaults are usually adequate; changing them affects discovery freshness and protocol chatter but not forwarding itself. Avoid treating CDP as the source of truth for topology inventory without corroborating interface descriptions, LLDP where relevant, device inventory or configuration management, because cabling moves and stale holdtime entries can temporarily misrepresent current topology.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Switching → Layer 2 Discovery → CDP. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%Quick lookup tables
CDP detail field map
Common information exposed by detailed CDP output
| Field | Operational use | Caveat |
|---|---|---|
| Device ID | identify expected peer | naming may not equal DNS/reachability |
| Local interface | identify local attachment | does not prove forwarding state |
| Port ID | identify remote attachment | naming can vary by platform |
| Platform | identify device family | advertised metadata |
| Capabilities | infer device role | advertised capability, not service health |
| Management/IP address | candidate management identity | does not prove current IP reachability |
| Holdtime | neighbor aging timer | changes over time |
CDP · operational reference
Compact state and interpretation boundaries for fast lookup.
| CDP field | Useful meaning | Boundary |
|---|---|---|
| Device ID | Neighbor identity hint | Not authenticated identity |
| Local/Port ID | Direct interface relationship | Does not prove VLAN/routing correctness |
| Capability | Advertised device role | Not complete functional proof |
| Holdtime | Remaining learned lifetime | Entry can be briefly stale |
Deep reference
Additional depth
Exposure and policy note
Discovery protocols intentionally reveal topology and device metadata to a directly connected peer. On untrusted or policy-restricted interfaces, determine whether CDP should be disabled globally or per interface. Do not disable it blindly on infrastructure links where operations depend on neighbor discovery.