show cdp neighbors displays the Cisco Discovery Protocol neighbor table, revealing directly connected devices and the local and neighboring interfaces used to connect them. section 1.1.1 section 1.3
Read the principal columns as follows:
- Device ID identifies the neighbor; Local Intrfce identifies the local device’s port. section 1.1.1
- Port ID identifies the neighbor’s outgoing port, allowing both ends of a link to be matched. section 1.1.1
- Holdtme counts down from the default 180 seconds until the neighbor entry expires without another advertisement. section 1.1.1
- Capability and Platform identify device roles and hardware models. section 1.1.1
Mapping an undocumented network
Run show cdp neighbors on multiple remotely accessed devices, then connect each Local Intrfce to the corresponding neighbor Port ID to reconstruct the topology. section 1.1.2
R1# show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge #1
S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone, #1
D - Remote, C - CVTA, M - Two-port Mac Relay #1
Device ID Local Intrfce Holdtme Capability Platform Port ID
SW1 Gig 0/0 158 R S I WS-C2960C Gig 0/1 #2
#1 Codes used in the Capability column
#2 SW1 is R1’s CDP neighbor.
Inspect annotated IOS output showing capability codes and the relationship between local and neighbor interfaces. section 1.1.1
