Use it to confirm what is plugged into a port, map the physical topology, and find cabling mistakes.
Layer 2 Discovery
1. show cdp neighbors (and show lldp neighbors) — is the expected neighbour on the expected port?
2. Wrong neighbour or port → cabling or documentation is wrong.
3. No neighbour → protocol off on either side, or a non-Cisco device without LLDP.
4. show cdp neighbors <if> detail — management address to reach the neighbour.
5. Watch logs for native VLAN and duplex mismatch messages from CDP.
protocol enabled on both ends → advertisements sent on the link → neighbour entry created → device name and remote port match the design
Move to the service boundary: interface errors → EtherChannel if present → VLAN/trunk/STP → L3/routing/policy as applicable.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
- Treating a learned neighbor as evidence that production traffic can pass.
- Treating a missing neighbor as evidence that the cable is broken before checking protocol enablement.
- Assuming CDP and LLDP use the same standards, defaults or TLVs.
- Leaving discovery enabled on interfaces where the security/design policy says it should be disabled.
- Trusting an advertised management address as evidence of current IP reachability.
- Ignoring the remote-port identifier when tracing cabling.
Operational reference
Fast context before you go deeper.
Evidence · 2 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
The expected neighbor is learned on the correct direct link, but production traffic across the link still fails.
command output · Evidence referenceDiscovery metadata differs from source-of-truth inventoryReceived system/port metadata does not match the documented topology.
Subtopics
Go one level deeper into this subject.
CDP reference for Cisco neighbor discovery, device/port identity, capabilities, management addressing, timers and the difference between adjacency evidence and service reachability.
Subtopic LLDPLLDP reference for standards-based Layer 2 neighbor discovery, transmit/receive control, chassis/port identity, capabilities and topology interpretation.
show cdp neighbors— neighbour device, local port, remote port, platform.show cdp neighbors <if> detail— addresses, software version, native VLAN, duplex.show lldp neighbors— the same for LLDP neighbours.show lldp neighbors <if> detail— system name, port description, management address, capabilities.show cdp interface/show lldp interface— where the protocols run.
ReferenceWhy it matters1 section · depth on demand
Why it matters
Use discovery information to identify what is physically connected to a switch/router interface, validate cabling and peer identity, map local-to-remote ports, and accelerate first-hop troubleshooting before changing VLAN, STP or routing configuration.
ReferenceHow it works1 section · depth on demand
How discovery works
CDP and LLDP periodically send link-local advertisements on an interface. The receiving neighbor records the advertised identity and capabilities until the hold time expires. These advertisements do not discover devices beyond the directly connected link and do not participate in VLAN forwarding, spanning-tree calculation, EtherChannel negotiation or IP routing.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
Layer 2 discovery with CDP and LLDP
Discovery protocols tell a device who is on the other end of each link. Cisco's IOS XE system management guide describes CDP as a Layer 2, media- and network-independent protocol. It sends periodic advertisements to multicast address 01:00:0C:CC:CC:CC, by default every 60 seconds, and Cisco devices never forward them. Receivers keep the information for the hold time and discard it after three missed advertisements. LLDP (IEEE 802.1AB) does the same job between devices from different vendors.
CDP and LLDP compared
| CDP | LLDP | |
|---|---|---|
| Standard | Cisco proprietary | IEEE 802.1AB |
| Default interval | 60 s | 30 s (Cisco default) |
| Default hold time | 180 s | 120 s (Cisco default) |
| Endpoint extensions | Voice VLAN, power | LLDP-MED: network policy, power, location, inventory |
| Typical use | Cisco-to-Cisco links, Cisco phones | Multi-vendor links, third-party phones and APs |
What discovery answers
| Question | Command |
|---|---|
| What's connected to this port? | show cdp neighbors <int>, show lldp neighbors <int> |
| Which IP manages that neighbour? | show cdp neighbors detail, show lldp neighbors detail |
| Is the cabling as documented? | Compare local and remote ports with the cable plan |
| Do native VLAN and duplex match? | CDP version 2 reports mismatches |
SW1# show cdp neighbors
Device ID Local Intrfce Holdtme Capability Platform Port ID
dist1.example.net Ten 1/1/1 142 R S I C9500-24Y Twe 1/0/3
SEP0011AA22BB33 Gig 1/0/7 131 H P M IP Phone Port 1
SW1# show lldp neighbors
Device ID Local Intf Hold-time Capability Port ID
ap-2f-07 Gi1/0/12 110 B,R 0011.22aa.0712
Total entries displayed: 1
%CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on TenGigabitEthernet1/1/1 (1), with dist1 TwentyFiveGigE1/0/3 (99).
Discovery and exposure
Both protocols send device details in clear text: hostname, platform, software version and addresses. Run them on infrastructure and phone ports. Disable them where they face untrusted networks, such as Internet edges, provider handoffs and guest ports, with no cdp enable and no lldp transmit per interface.
Limits
A neighbour entry proves only that a discovery frame arrived recently. It doesn't prove IP reachability, VLAN consistency or that traffic flows.
Documented example, not captured output.
Quick reference
Layer 2 discovery protocols let directly connected devices identify each other. They are invaluable for tracing cables and building topology maps, and IP phones rely on them for VLAN and power information. The same details are useful to an attacker, so the protocols should be enabled where they help and disabled where devices face untrusted networks.
Layer 2 discovery protocols:
| Protocol | Standard | Notes |
|---|---|---|
| CDP | Cisco proprietary | Enabled by default on Cisco devices |
| LLDP | IEEE 802.1AB | Multi-vendor; LLDP-MED adds voice VLAN, PoE, location |
show cdp neighbors detail
lldp run
show lldp neighbors detail
interface Gi1/0/1
no cdp enable ! on untrusted/internet-facing ports
They reveal device type, software version, IP and VLANs — useful for operations, useful for attackers too. Disable on edges toward untrusted networks; keep on infrastructure links.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Switching → Layer 2 Discovery. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%Quick lookup tables
CDP vs LLDP
Fast comparison of the two discovery protocols
| Property | CDP | LLDP |
|---|---|---|
| Standard | Cisco proprietary | IEEE 802.1AB |
| Scope | directly connected link | directly connected link |
| Typical use | Cisco-centric topology discovery | vendor-neutral topology discovery |
| Global enable | cdp run | lldp run |
| Summary | show cdp neighbors | show lldp neighbors |
| Detail | show cdp neighbors detail | show lldp neighbors detail |
| Proves | advertisement received from direct peer | advertisement received from direct peer |
| Does not prove | VLAN/IP/end-to-end forwarding | VLAN/IP/end-to-end forwarding |
Layer 2 discovery troubleshooting boundary
Fast order for a missing or unexpected neighbor
| Boundary | Check | Healthy indication | If unhealthy |
|---|---|---|---|
| Physical/interface | interface state/cabling | intended link is operational | fix physical/interface state |
| Global protocol | show cdp / show lldp | intended protocol globally active | enable or follow policy |
| Interface protocol | show cdp interface / show lldp interface | protocol active in intended direction | correct interface discovery state |
| Neighbor | summary/detail | expected device and remote port learned | compare peer protocol/interface |
| Service | VLAN/STP/EtherChannel/IP checks | service state matches design | troubleshoot the actual forwarding layer |