CDP and LLDP
How does a switch know what model of router sits on the other end of a cable? It asks. CDP and LLDP are Layer 2 discovery protocols that send periodic messages so neighbouring devices can learn one another’s identity, platform, and interface — invaluable for building a network map, and a quiet leak of reconnaissance data if you leave them running where they should not be.
- Contrast CDP (Cisco proprietary) with LLDP (IEEE 802.1AB, vendor-neutral).
- Explain that both operate at Layer 2 and discover directly connected neighbours only.
- Use show cdp neighbors and show cdp neighbors detail.
- Recall the CDP timers: hello every 60 s, hold time 180 s.
- Enable LLDP with lldp run and verify with show lldp neighbors.
- Explain the security risk and the mitigation commands: no cdp run, no lldp transmit.
What discovery protocols are for
Both CDP and LLDP run on the Data Link layer and advertise information about the local device to whatever sits on the directly connected wire. Deliveries are one hop only: discovery messages are never forwarded by a switch, which is exactly why show cdp neighbors is always a picture of your physical neighbours rather than of routes or VLANs. The information exchanged travels as Type-Length-Value (TLV) records — device name, platform, capabilities, software version, and local interface identifiers.
A discovery protocol answers questions that matter during design and troubleshooting: Which switch am I connected to? What model and IOS version is it running? Which of its ports faces me? Cisco phone deployment leans on it too — an IP phone uses the CDP “voice VLAN” TLV to learn which VLAN to join (Lesson 13), so disabling CDP on a phone port can break voice traffic even though everything looks configured.
CDP: the Cisco-proprietary neighbour protocol
Cisco Discovery Protocol (CDP) is Cisco’s own Layer 2 discovery protocol. It is enabled by default on Cisco routers, switches, and access points, and because it only understands other Cisco gear, it works with any transport — it is media- and protocol-independent and can run even over links that are not IP-routed. The messages are multicast to the well-known address 01:00:0C:CC:CC:CC, so every CDP-enabled neighbour on the shared segment receives them.
CDP has two transports on modern IOS: CDPv1 and CDPv2. The exam rarely differentiates them — what matters is that CDP is Cisco proprietary, so a mixed-vendor network needs LLDP instead. This one contrast — proprietary versus open standard — is the difference the syllabus really tests.
CDP verification commands
The CDP command family is compact and appears verbatim on the syllabus. Learn these four:
S1# show cdp neighbors 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 R1 Gig 0/24 173 R ISR4331 Gig 0/0 S2 Gig 0/23 154 S C9300 Gig 0/24
Each row says: who my neighbour is (Device ID), which of my ports faces it (Local Interface), how long I will keep this entry if messages stop (Hold Time), what kind of device it is (Capability), its model (Platform), and which of its ports faces me (Port ID).
S1# show cdp neighbors detail ------------------------- Device ID: R1 Entry address(es): IP address: 192.168.10.1 Platform: Cisco ISR4331/K9, Capabilities: Router Interface: GigabitEthernet0/24, Port ID (outgoing port): GigabitEthernet0/0 Software: IOS-XE Software, Version 16.9 Advertisement version: 2
show cdp neighbors detail is the same table, expanded: it includes the neighbour’s
IP address, IOS version, and software, which makes it the perfect reconnaissance and mapping tool.
Support commands include show cdp (global timer/hold state) and
show cdp entry <device> (detail for one neighbour only).
show cdp neighbors is the compact per-port table; show cdp neighbors detail
adds IP addresses, platform, and software version. If an answer options question asks which command
reveals a neighbour’s IP address, the answer is the detail variant —
the basic table does not show it.
LLDP: the IEEE 802.1AB standard
Link Layer Discovery Protocol (LLDP) is the vendor-neutral alternative defined in IEEE 802.1AB. Where CDP restricts you to Cisco neighbours, LLDP interoperates across vendors, which is why mixed networks enable it. Its mechanics are the same in spirit: multicast at Layer 2, TLV-structured messages, one-hop only, and periodically refreshed neighbour tables. It uses the multicast MAC 01:80:C2:00:00:0E.
LLDP is stricter about direction than CDP: each port has separate transmit and
receive halves. That granularity is what makes it easy to harden — you can stop
advertising (no lldp transmit) while still listening, or shut the whole protocol down.
Cisco also supports LLDP-MED, which extends LLDP with the media-endpoint features
(such as voice VLAN hints) that CDP already provided for phones.
LLDP configuration and verification
S1(config)# lldp run ! enable LLDP globally S1(config)# interface gigabitethernet 0/24 S1(config-if)# lldp transmit ! fine-grained control per direction S1(config-if)# lldp receive S1(config-if)# end S1# show lldp neighbors Capability codes: (R) Router, (B) Bridge, (T) Telephone, (C) DOCSIS Cable Device (W) WLAN Access Point, (P) Repeater, (S) Station, (O) Other Device ID Local Intf Hold-time Capability Port ID R1 Gig 0/24 120 R Gig 0/0
Note the difference on the wire: LLDP is not enabled by default on Cisco gear,
while CDP is. If a lab or exam scenario uses a Cisco switch talking to a Linux host or a third-party
access point, the realistic fix is lldp run — CDP will never be answered.
Timers and TLV details
Two timer numbers are canonical for the exam:
| Protocol | Default transmit interval | Default hold time |
|---|---|---|
| CDP | 60 seconds | 180 seconds (three received advertisements) |
| LLDP | 30 seconds | 120 seconds (four received advertisements) |
The hold time is how long the table keeps a neighbour after its last message. If CDP messages stop (cable unplugged, peer disabled CDP), the entry stays for up to 180 seconds before the device is declared gone. The relationship is why the number “three missed hellos” appears in troubleshooting narratives — 60 × 3 = 180.
The security downside
Discovery protocols are informative and dangerous in equal measure. The problem is best described in one sentence: whatever you advertise, an attacker connected to the same segment can listen to. CDP and LLDP leak the platform, IOS version, hostname, and interfaces — a perfect target list for an attacker choosing an exploit specific to your exact IOS build. On access ports that face unknown devices (public switch ports, guest Wi-Fi uplinks, ISP handoffs), the protocol is normally disabled:
S1(config)# no cdp run ! disable CDP globally S1(config)# interface gigabitethernet 0/1 S1(config-if)# no cdp enable ! disable CDP on one interface only S1(config-if)# no lldp transmit ! stop LLDP advertisements (keep listening if you wish) S1(config-if)# no lldp receive
There are two levels of mitigation on the exam: global
(no cdp run turns the protocol off everywhere, and lldp run is symmetric) and
per-interface (no cdp enable, no lldp transmit/no lldp
receive). A question that says “a port on an untrusted network edge must not reveal
switch details to callers” is looking for exactly these commands.
no cdp run. LLDP is off by default and enabled with
lldp run. Also remember the phone dependency: disabling CDP on a port that serves a
Cisco IP phone may stop the phone from learning its voice VLAN (Lesson 13).
The vocabulary you need
Every term below appears in the lesson text above. Select one to read its definition, then use the quiz at the end to check what stuck.
Review
Check what you have learned with these review questions.
Sources & references
- Cisco. CCNA (200-301) Exam Topics. cisco.com.
- IETF. Request for Comments (RFCs). rfc-editor.org.
- IANA. Internet Assigned Numbers Authority registries. iana.org.
Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.