CDP and LLDP — Layer 2 discovery
Two L2 protocols let neighboring devices announce who they are and what ports they're on. CDP is vendor-proprietary; LLDP is the IEEE standard (802.1AB). This chapter covers both, including configuration, verification, and which is on by default.
What you'll learn
- Enable and disable CDP and LLDP globally and per-interface.
- Read 'show cdp/lldp neighbors' output.
- Decide when to disable discovery for security.
Why discovery protocols exist
When you walk into a wiring closet with a half-labelled patch panel, CDP and LLDP tell you what's on the other end of every cable: device name, model, firmware version, port ID, IP address, VLAN, and PoE draw. They are Layer 2 multicast frames that no device forwards: the switch, router or AP at the other end of the cable reads each one and drops it, so you only ever see devices at the other end of your own cables.
IP phones use CDP/LLDP-MED to learn their voice VLAN automatically from the upstream switch. Many wireless controllers use them to map APs back to their physical switch port.
CDP — a proprietary device-discovery protocol
CDP is on by default on the devices that support it, sends an advertisement every 60 s (default), and ages out neighbors after 180 s (holdtime). It uses MAC 01:00:0c:cc:cc:cc.
Each advertisement carries the device's name, the port it left from, its capabilities (router, switch, phone…), its platform and its addresses — on real equipment also its software version and native VLAN. One global command, cdp run, turns it on or off for the whole device; cdp enable turns it on or off for one interface.
! Global toggle (cdp run is the default)
R1(config)# cdp run
R1(config)# no cdp run
! Per interface
R1(config-if)# cdp enable
R1(config-if)# no cdp enable
! Verify
R1# show cdp neighbors
R1# show cdp neighbors detail
R1# show cdp interface
R1# show cdp entry R29 more sections in this chapter, plus a 4-question quiz and a hands-on lab.
Modules 2–8 are part of the Course & Lab Pass and All-Access Max — start with a free account
You can see the title, summary, learning objectives and the opening sections. The rest of this chapter, like all of modules 2–8, comes with the Course & Lab Pass and All-Access Max. A free account opens Module 1: How Networks Work end-to-end and saves your labs — start there, no card required.
- Read every chapter in Module 1 — How Networks Work
- Save labs of up to 5 devices
- Save up to 3 topologies
- See the full course syllabus + chapter titles
Free account · no card required · compare plans any time