show cdp neighbors
Lists directly connected Cisco devices discovered with CDP: device ID, local and remote port, capability and platform.
Written by a working field network engineer · CCNA, Security+, CySA+
Cisco Discovery Protocol tells you what is on the other end of each cable: the neighbor’s name, model and which of its ports you are plugged into. It is the fastest way to map an unfamiliar network or confirm cabling.
Example output
R1#show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,
D - Remote, C - CVTA, M - Two-port Mac Relay
Device ID Local Intrfce Holdtme Capability Platform Port ID
SW1 Gig 0/0 151 S I WS-C2960+ Gig 0/1
R2 Gig 0/1 163 R B S I CISCO2911 Gig 0/1
Total cdp entries displayed : 2Reference output: hand-written in standard Cisco IOS format for this example network, not captured from a device.
Useful variants
sh cdp neishow cdp neighbors GigabitEthernet0/1show cdp interface
What each column or field means
| Field | Meaning |
|---|---|
Device ID | The neighbor’s hostname. |
Local Intrfce | Your port the neighbor is connected to. |
Holdtme | Seconds before the entry is removed if no further CDP message arrives (default 180, messages every 60). |
Capability | What the neighbor is: R router, S switch, H host, P phone, I IGMP. |
Platform | The neighbor’s hardware model. |
Port ID | The neighbor’s port at the other end of the cable. |
When it doesn’t look right
No neighbors at all.
CDP may be disabled globally (no cdp run) or on the interface (no cdp enable), or the neighbor is not a Cisco device. Use LLDP for other vendors.
A neighbor you expected is missing on one port.
The link is down at Layer 2, or CDP is disabled on that interface. CDP needs a working data link but no IP addressing.
Port ID does not match your documentation.
The cable has moved. CDP is right; update the description and documentation.
Related commands
Try it yourself
- CDP & LLDP Neighbor Discovery (Pro)
- Free lab on this topic: Switch Management VLAN
- Or build the example network in the free Sandbox
Learn it in the CCNA path
- Device Discovery (CDP & LLDP) (2. Network Access)
- Learn what is on the other end of a link (Prerequisite review: CCNA topics from the CCNP courses)
Topic
Device Management — Read the configuration and software version, save changes, discover neighbors with CDP and LLDP, and check logging and time.