PracticeLabs
Week 3Lesson 7Required16 min estimated0% progress

CDP and LLDP Neighbor Discovery

Use CDP and LLDP to map directly connected neighbours, read the useful fields from the brief and detail outputs, and decide where discovery should be switched off for security.

Lesson orientation

What you'll learn (4 objectives)~16 min: video → lesson → check → apply → lab prep

Learning objectives

  • Explain the purpose of Layer 2 discovery and what neighbour information it reveals
  • Distinguish Cisco-proprietary CDP from open-standard LLDP, and know LLDP may need lldp run
  • Read show cdp neighbors and show cdp neighbors detail to identify a neighbour, its port, and its address
  • Verify LLDP neighbours and decide where to disable discovery on untrusted or edge ports

Terms you will see

CDPLLDPLLDP-MEDNeighbourDirectly connectedHoldtimeCapability codelldp run

Time breakdown

  • Read the notes10 min
  • CDP/LLDP neighbour explorer6 min

Assigned video

Opens on YouTube
Recommended video

Free CCNA | CDP & LLDP | Day 36 | CCNA 200-301 Complete Course

By Jeremy's IT Lab · Opens externally on YouTube

Assigned watch
~6 min

The link opens in a new browser tab. Return here when you finish watching.

Watch for these concepts

  • Which fields CDP reports for each neighbour
  • How the detail command adds the neighbour's IP address and IOS version
  • LLDP giving the same picture across vendors once lldp run is enabled

Go beyond the video

The assigned video introduces the idea. CCNA Practice Labs completes the learning path: clarify core concepts, explore how each device behaves, visualize the communication path, check your understanding, and prepare for hands-on lab work.

Watch the concept → understand it → visualize it → practice it → apply it.

What discovery does — and its one hard limit

CDP and LLDP are Layer 2 protocols that let a device advertise its identity to whatever is directly connected on each port. The scope word that matters is directly connected: discovery does not map the whole network, only your immediate neighbours, one hop away. That is exactly what you want when documenting cabling, confirming which switch an uplink lands on, or catching a cable plugged into the wrong port — and it is why discovery is not a substitute for a topology diagram.

  • Device ID or name of the neighbour
  • Your local interface and the neighbour's remote port
  • Platform and capabilities — is it a switch, a router, a phone?
  • In detail output, the neighbour's management IP address and software version

CDP versus LLDP

The distinction to hold onto
CDPLLDP
Full nameCisco Discovery ProtocolLink Layer Discovery Protocol
StandardCisco proprietaryOpen — IEEE 802.1AB
Default stateEnabled on Cisco gearOften off — enable with lldp run
Reach for it whenAn all-Cisco environmentA mixed-vendor environment

CDP works out of the box between Cisco devices, which is why you have already met it twice this week without configuring anything: it is what logs a native-VLAN mismatch on a trunk, and what tells an IP phone its voice VLAN. LLDP is the vendor-neutral equivalent you switch on when Cisco and non-Cisco gear — or a multi-vendor phone via LLDP-MED — need to discover each other.

Discovery leaks topology
Because discovery advertises device names, models, software versions and management addresses, it is useful to you and equally useful to an attacker. Best practice is to disable it on untrusted or edge ports — anything facing the internet, an ISP handoff, or an untrusted access area — so you are not handing out a map of your infrastructure. Turn it off per interface with no cdp enable, and no lldp transmit / no lldp receive for LLDP, while keeping it on internal switch-to-switch links where it earns its keep.

Reading the neighbour table

show cdp neighbors on SW1
SW1# show cdp neighbors
Capability Codes: R - Router, S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone

Device ID    Local Intrfce    Holdtme    Capability   Platform    Port ID
SW2          Gig 0/1          145        S            WS-C2960    Gig 0/1
R1           Gig 0/24         160        R            ISR4331     Gig 0/0/0
SEP0011AABB  Fas 0/10         132        H P          IP Phone    Port 1

Two columns are routinely misread. Local Intrfce is your port — the one on the switch you are logged into. Port ID is the neighbour's port at the far end. Reading them the wrong way round is how cabling documentation ends up backwards. The Capability column is a quick sanity check: an S where you expected an R means the cable does not go where you thought.

The brief table deliberately omits addresses and versions. show cdp neighbors detail adds the neighbour's management IP address and its IOS version, which is what you need before you can log into it or check whether it is running the software you expect. show lldp neighbors and show lldp neighbors detail give the same two views across mixed-vendor gear.

What you should retain

  • CDP and LLDP advertise identity to directly connected neighbours only — one hop, never the whole network.
  • CDP is Cisco proprietary and on by default; LLDP is the open IEEE 802.1AB standard and often needs lldp run.
  • show cdp neighbors gives device ID, your local port, the neighbour's port, and platform; detail adds IP and IOS version.
  • Local Intrfce is your port; Port ID is theirs.
  • Disable discovery on untrusted and edge ports with no cdp enable so it does not leak topology.
Pause and predictNot scored — nothing is recorded

Before you read on

Using the output above: (1) What is connected to SW1's Gi0/1, and to which of the neighbour's ports? (2) You need R1's IP address and IOS version, which are not shown — which command gives them? (3) SW1's Gi0/24 faces an ISP router you do not control. Should CDP stay enabled on that port?

Interactive tool
Required~6 min

CDP & LLDP Neighbor Explorer

Read the brief neighbour table, then expand to detail and find the management IP address and software version fields. Practising the brief-to-detail move is the point — it is the actual workflow when you inherit an undocumented wiring closet.

Study deeper

Topic guides extend this lesson — they do not replace the first-party walkthrough above.

Device Configuration & Verification

For the complete CDP and LLDP verification command set and the neighbour-mapping workflow