show cdp neighbors
Displays information about directly connected Cisco devices discovered via CDP, used to verify neighbor relationships and gather device details.
show cdp neighborsWhen to Use This Command
- Verify that a new switch is properly connected and recognized by an adjacent router.
- Troubleshoot connectivity issues by checking if expected neighbors appear in the CDP table.
- Document the network topology by listing all CDP neighbors and their interfaces.
- Identify unknown devices connected to a port by checking the device ID and platform.
Command Examples
Basic CDP Neighbor Display
show cdp neighborsCapability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
Device ID Local Intrfce Holdtme Capability Platform Port ID
RouterA Gig 0/0/0 172 R ISR4331 Gig 0/0/0
SwitchB Gig 0/0/1 145 S C2960 Gig 0/1
PhoneC Gig 0/0/2 120 P IP Phone Port 1Device ID: Hostname of the neighbor. Local Intrfce: Local interface connected to neighbor. Holdtme: Seconds remaining before CDP entry expires (max 180). Capability: Device type (R=Router, S=Switch, P=Phone). Platform: Hardware model. Port ID: Neighbor's interface connected to us.
Detailed CDP Neighbor Information
show cdp neighbors detail------------------------- Device ID: RouterA Entry address(es): IP address: 192.168.1.1 Platform: Cisco ISR4331, Capabilities: Router Interface: GigabitEthernet0/0/0, Port ID (outgoing port): GigabitEthernet0/0/0 Holdtime : 172 sec Version : Cisco IOS Software, ISR Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 16.9.4, RELEASE SOFTWARE (fc2) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2019 by Cisco Systems, Inc. advertisement version: 2 VTP Management Domain: '' Native VLAN: 1 Duplex: full Management address(es): IP address: 192.168.1.1
Provides IP address, IOS version, VTP domain, native VLAN, duplex, and management address. Useful for verifying software versions and IP connectivity.
Understanding the Output
The output lists all CDP neighbors discovered on directly connected interfaces. The Device ID is the hostname of the neighbor. Local Intrfce is the local interface through which the neighbor is reachable. Holdtme is the remaining time in seconds before the entry is aged out (default 180 seconds). Capability indicates the device type: R for Router, S for Switch, H for Host, P for Phone, etc. Platform shows the hardware model. Port ID is the neighbor's interface that connects to the local device. In a healthy network, you should see expected neighbors with holdtimes decreasing from 180. Missing neighbors or holdtimes consistently low may indicate connectivity issues or CDP misconfiguration. The detail output adds IP addresses, IOS version, and interface details for deeper troubleshooting.
CCNA Exam Tips
CCNA exam may ask which command to verify Layer 2 connectivity between directly connected Cisco devices.
Remember that CDP is Cisco proprietary and enabled by default; it only works with Cisco devices.
The holdtime default is 180 seconds; a low holdtime may indicate a flapping link.
Capability codes are important: know that 'R' is Router, 'S' is Switch, 'P' is Phone.
Common Mistakes
Assuming CDP works with non-Cisco devices; it is Cisco proprietary.
Forgetting that CDP is enabled globally by default but can be disabled per interface.
Confusing CDP with LLDP; LLDP is IEEE standard and used in multivendor environments.
Related Commands
show cdp neighbors detail
Displays detailed information about directly connected Cisco devices discovered via CDP, including IP addresses, IOS version, platform, and interface details, useful for verifying neighbor relationships and troubleshooting Layer 2 connectivity.
show lldp neighbors
Displays information about directly connected LLDP-capable devices, including device ID, local interface, hold time, capability, and port ID, used to verify LLDP neighbor discovery and troubleshoot Layer 2 connectivity.
Practice for the CCNA 200-301
Test your knowledge with hundreds of CCNA practice questions covering all exam domains.
Practice CCNA Questions