CDP vs LLDP — Cisco's Neighbor Discovery vs the Vendor-Neutral Way
The two Layer-2 discovery protocols on every Cisco lab: CDP (Cisco proprietary, on by default) and LLDP (IEEE 802.1AB, off by default). When to use which, security implications, and the show commands the CCNA tests.
Why discovery protocols exist
When you inherit a network, the first thing you want to know is what’s connected where. Cable-tracing 200 ports is not the answer. Instead, every modern switch and router broadcasts small periodic frames announcing “I am R1, connected via Gi0/0, running IOS 15.6, my mgmt IP is 10.0.0.1” — and any listening peer records that info in a table.
That’s what CDP and LLDP do. They are pure Layer-2 (frames never leave the local segment) discovery protocols. They don’t route packets; they don’t affect data flow. They just let neighbours identify each other.
CDP vs LLDP — the CCNA-blueprint comparison
| Property | CDP | LLDP |
|---|---|---|
| Standard | Cisco proprietary (1994) | IEEE 802.1AB (2005) |
| Where it works | Cisco-only devices | Any vendor that implements it |
| Default on Cisco IOS | On (globally + per interface) | Off (needs lldp run) |
| Frame type | SNAP-encapsulated multicast frame | Ethertype 0x88CC multicast frame |
| Multicast MAC | 01:00:0C:CC:CC:CC | 01:80:C2:00:00:0E |
| Advertise interval | 60s (default) | 30s (default) |
| Hold time | 180s (3× interval) | 120s (4× interval) |
| Info in each frame | Device ID, IP, capabilities, IOS version, platform, port ID, duplex | Same categories via TLVs — mandatory TLVs cover chassis+port+TTL; optional TLVs add sys-name, sys-desc, mgmt-addr, port-desc |
| Security concern | Leaks IOS version to anyone on the wire | Same leak risk |
| On the exam | Config + verify + show output | Same |
Config — the four commands you actually type
Global toggles (both protocols default to what real IOS ships with):
R1(config)# cdp run ! default on Cisco
R1(config)# no cdp run ! turn off entire device
R1(config)# lldp run ! turn on globally (default off)
R1(config)# no lldp run ! turn off globally
Per-interface toggles (finer control — leave enabled on network-facing ports, disable on user access ports):
R1(config)# interface GigabitEthernet0/0
R1(config-if)# cdp enable ! default on (redundant)
R1(config-if)# no cdp enable ! turn CDP off on this port only
R1(config-if)# lldp transmit ! send LLDP frames out this port
R1(config-if)# lldp receive ! process incoming LLDP frames
R1(config-if)# no lldp transmit ! stop announcing on this port
Try any of these on our live console — the engine accepts them and reflects the state in show running-config.
Show commands the exam loves
! CDP — what's on the wire
R1# show cdp neighbors ! one-line-per-neighbor summary
R1# show cdp neighbors detail ! full detail per neighbor (IP, IOS ver, platform)
R1# show cdp entry R2 ! zoom to one specific neighbor
R1# show cdp interface ! which interfaces have CDP active + timers
R1# show cdp ! global CDP state + timers
! LLDP — mirror set of commands
R1# show lldp neighbors
R1# show lldp neighbors detail
R1# show lldp interface
R1# show lldp
Sample show cdp neighbors from a real lab:
Capability 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
SW1 Gig 0/0 156 S I WS-C2960 Gig 0/1
R2 Gig 0/1 171 R C1841 Gig 0/0
When to use which
Use CDP when:
- Every device is Cisco.
- You want the richest per-neighbor info (Cisco tags include IOS version and platform strings LLDP omits).
- You’re already troubleshooting a Cisco outage — CDP is on by default so it’s already running.
Use LLDP when:
- Mixed vendors on the same wire (Juniper, Arista, Aruba, Fortinet — they all speak LLDP, not CDP).
- Third-party network monitoring (LibreNMS, Observium, PRTG) — most parse LLDP by preference.
- 802.1AB TLVs are what LLDP-MED (Media Endpoint Discovery) rides on top of — IP phones use LLDP-MED to auto-configure their voice VLAN, PoE class, and QoS marking. If you have Cisco phones on non-Cisco switches, LLDP-MED is what makes them work.
Use both in production — the cost of both being on is a few frames per minute, and it protects you when a new device joins the network that speaks only one.
The security angle (and why some ops disable it)
CDP and LLDP both broadcast your device’s IOS/software version, hostname, and management IP in plaintext, unauthenticated, to any device on the local segment. An attacker who plugs a laptop into a wall port learns:
- Every neighbouring device hostname
- Its IOS version (map to known CVEs)
- Its management IP (target for further scans)
- Its uplink port (blast radius planning)
Rule of thumb for hardening:
- Disable CDP/LLDP on user access ports — no legitimate need for a user laptop to learn switch topology.
- Keep enabled on trunks + backbone links — network engineers need this to troubleshoot.
- If you have Cisco IP phones, keep CDP on on the phone port (the phones use CDP to learn the voice VLAN) — or move the phone fleet to LLDP-MED.
R1(config)# interface range Gi0/1 - 24
R1(config-if-range)# no cdp enable
R1(config-if-range)# no lldp transmit
R1(config-if-range)# no lldp receive
Common troubleshooting recipes
“Why isn’t my new switch showing up as a CDP neighbour?”
- Is CDP enabled globally on both ends?
show cdpon each — look for “CDP is enabled globally”. - Is CDP enabled per-interface?
show cdp interface Gi0/0. - Is the link L2? CDP frames don’t cross Layer-3 boundaries. Two switches trunked together see each other; two routers with a subnet between them don’t (each router is one hop away — CDP is single-hop).
- Is the neighbour running very old software? CDPv1 vs CDPv2 mismatch can hide capability info.
“LLDP shows nothing on Cisco to Cisco” LLDP is off by default on Cisco. Run lldp run globally on both ends. Give it 60 seconds (LLDP hello interval + first neighbour learn).
The #1 mistake
Assuming CDP is enough because “we’re all Cisco”. Cisco acquires other companies (Meraki), Cisco spins out hardware to third parties, and one contractor’s Aruba AP shows up on the wire — and suddenly your neighbour discovery has a blind spot. Enable LLDP globally in addition to CDP on the backbone. The cost is negligible; the discovery blind spot is real.
Related
- CDP + LLDP — the topic page — reference table +
showoutput samples + a hands-on CLI lab - Layer 2 hardening — Port Security, DHCP Snooping, and DAI in one lab — the other L2 knobs that lock down user access ports
Get posts like this by email.
One short, opinionated tutorial per week. Unsubscribe in one click.
Personal reply from a senior network engineer. No third-party tracking. Unsubscribe any time.
