CDP (Cisco Discovery Protocol)
Cheat sheet · https://pcornel.dk/topic.php?topic=596
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 trafficclear 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
| 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 |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=596