BuildTheNet

Opening your workspace

Your learning content and tools are loading.

Device Management

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 : 2

Reference output: hand-written in standard Cisco IOS format for this example network, not captured from a device.

Useful variants

What each column or field means

FieldMeaning
Device IDThe neighbor’s hostname.
Local IntrfceYour port the neighbor is connected to.
HoldtmeSeconds before the entry is removed if no further CDP message arrives (default 180, messages every 60).
CapabilityWhat the neighbor is: R router, S switch, H host, P phone, I IGMP.
PlatformThe neighbor’s hardware model.
Port IDThe 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

Learn it in the CCNA path

Topic

Device Management — Read the configuration and software version, save changes, discover neighbors with CDP and LLDP, and check logging and time.

All 57 commands