Pcornel
Networking · Switching › Layer 2 Discovery

CDP (Cisco Discovery Protocol)

Cheat sheet · https://pcornel.dk/topic.php?topic=596

Back to the Topic

Answer

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.

Remember

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.

First checks

  • 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.

Commands

show cdp entry {* | <device-name>} [protocol | version]
Shows everything CDP knows about one named neighbor (or all with *): addresses, platform, local and remote port, and so…
show cdp neighbors detail
Display Cisco neighbor information.
cdp run
Enable CDP globally.
no cdp run
Disable CDP globally.
cdp enable
Enable CDP on an interface (CDP must also be enabled globally).
no cdp enable
Disable CDP on this interface, for example toward untrusted devices.
show cdp
Display global CDP settings.
show cdp neighbors
Display directly connected Cisco neighbors learned through CDP.
show cdp interface
Display CDP status per interface.
show cdp entry <name>
show cdp traffic
clear cdp table

Verify in this order

protocol enabled on both ends → advertisements sent on the link → neighbour entry created → device name and remote port match the design

Where it usually breaks

media/optics → administrative state → carrier/line protocol → negotiation → error/drop counters → neighbor discovery → upper-layer adjacency

CDP detail field map

FieldOperational useCaveat
Device IDidentify expected peernaming may not equal DNS/reachability
Local interfaceidentify local attachmentdoes not prove forwarding state
Port IDidentify remote attachmentnaming can vary by platform
Platformidentify device familyadvertised metadata
Capabilitiesinfer device roleadvertised capability, not service health
Management/IP addresscandidate management identitydoes not prove current IP reachability
Holdtimeneighbor aging timerchanges over time

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=596

Confirmation

Confirm action

Continue?