CDP and LLDP
Layer 2 discovery protocols: enable and scope CDP and LLDP, read neighbor tables, and use detail output safely.
CDP and LLDP compared
Layer 2 discovery protocols let neighbors exchange identity, capabilities and addressing directly over the link. CDP is Cisco proprietary; LLDP (802.1AB) is the vendor-neutral standard. They run on the wire regardless of IP configuration — useful for mapping, dangerous as an information leak on untrusted ports.
CDP versus LLDP
| Property | CDP | LLDP |
|---|---|---|
| Standard | Cisco proprietary | IEEE 802.1AB (open) |
| Default on Cisco | Enabled globally, per-interface on | Disabled until lldp run |
| Timer / holdtime | 60 s / 180 s | 30 s / 120 s |
| TLVs | Device ID, port ID, platform, IP, native VLAN, duplex, VTP domain | Chassis/port ID, system name/desc, management address, capabilities |
| Use | Cisco-only estates | Mixed-vendor networks, IP phone voice-VLAN delivery |
Discovery defaults worth memorizing
| Setting | CDP default | LLDP default |
|---|---|---|
| Advertisement timer | 60 seconds | 30 seconds |
| Holdtime | 180 seconds | 120 seconds |
| Global state on Cisco IOS | Enabled | Disabled |
| Per-interface control | cdp enable / no cdp enable | lldp transmit / lldp receive |
Values are platform defaults — verify against your device documentation.
Configuration
Enable LLDP globally and tune a port — Privileged EXEC → Global + interface configuration
Cisco IOS / IOS XE
configure terminal lldp run interface gigabitethernet1/0/24 lldp transmit lldp receive end
show lldp neighbors show lldp neighbors detail show lldp
- Neighbor table shows chassis ID, port ID, TTL and system name.
- Detail output reveals management IP, capabilities and VLAN info.
- Disable transmit on untrusted/user-facing ports — LLDP leaks topology details.
Changes device configuration.
Reading neighbor output
Capability Codes: R - Router, T - Trans Bridge, B - Source Route BridgeLetters reveal device function. S - Switch, H - Host, I - IGMP, r - Repeater, P - PhoneP marks IP phones — voice VLAN verification.Device ID Local Intrfce Holdtme Capability Platform Port IDLocal and remote port pair on each row.SW2 Gig 1/0/24 158 S C9300 Gig 1/0/24SW2 reachable via its Gi1/0/24 from your Gi1/0/24.SEP001A2B3C4D5E Gig 1/0/1 143 P IP Phone Port 1A phone — confirm it is in the voice VLAN.- Task
- Identify what is plugged into Gi1/0/7
show cdp neighbors detailon Gi1/0/7 returns a device ID, platform and IP address.- Capability letter shows whether it is a switch (S), router (R) or phone (P).
- The remote port ID tells you the far end's exact interface for the network diagram.
Discovery turns an unknown cable into a documented link in one command.
Common mistakes
- Expecting CDP on non-Cisco gear — use LLDP in mixed environments.
- Leaving discovery running on untrusted edge ports — it advertises management IPs and platform details.
- Confusing the holdtime counter with link health — an expired holdtime only means no recent advertisement.
- Assuming discovery proves VLAN/config correctness — it proves link-layer adjacency only.
Observation: Two directly-connected Cisco switches show no CDP entry for each other.
- CDP disabled globally or on the interface
- The link is not actually direct — an intermediate active device (hub switch or in-line device) sits between them
- Link down between them
| Check | Indicates |
|---|---|
show cdp | Global state and timers. |
show run interface → cdp enable | Per-interface disable overrides the global. |
Physical path and show interfaces status | If the link isn't L2-adjacent, discovery cannot cross it. |
Correction: Re-enable CDP/LLDP where appropriate, or correct the assumed topology.
Neighbor entries appear within one advertisement interval.
Related resources
Sources
- Cisco CCNA 200-301 v1.1 Exam Topics (official PDF) — reviewed 2026-11-02
- IEEE 802.1 Working Group (802.1AB LLDP) — reviewed 2026-11-02
- Cisco — Configuration Fundamentals Command Reference — reviewed 2026-11-02
Targets CCNA 200-301 v1.1 objectives. Supplemental blocks are labeled beyond exam scope.