Configure and verify Layer 2 discovery protocols (Cisco Discovery Protocol and LLDP)

📘 CCNA 200-301 v1.1

2.3 Configure and verify Layer 2 discovery protocols (Cisco Discovery Protocol and LLDP)

1. What are Layer 2 Discovery Protocols?

Layer 2 Discovery Protocols are network protocols that help network devices identify and learn about directly connected devices.
They allow switches, routers, IP phones, and other network devices to share basic information with their neighbors automatically.

These protocols work at Layer 2 (Data Link Layer) of the OSI model, so they do not require IP addresses to operate — they use frames, not packets.


🔹 2. Purpose of Discovery Protocols in IT Networks

In real IT networks, engineers use discovery protocols to:

  • Find out which devices are connected to each switch port.
  • Troubleshoot network connections.
  • Document or verify network topology.
  • Identify device types and interfaces automatically (for example, Cisco IP phones connected to switches).

They help in day-to-day network operations by making network discovery and maintenance easier.


🔹 3. Two Discovery Protocols You Must Know

There are two main Layer 2 discovery protocols for the CCNA exam:

ProtocolFull NameVendorDefault EnabledLayerStandard
CDPCisco Discovery ProtocolCisco proprietaryYes (on Cisco devices)Layer 2Proprietary
LLDPLink Layer Discovery ProtocolOpen standard (IEEE 802.1AB)No (must be enabled manually)Layer 2IEEE 802.1AB

🔹 4. Cisco Discovery Protocol (CDP)

a. Definition:

CDP is a Cisco proprietary Layer 2 protocol that is used by Cisco devices (like switches, routers, IP phones) to share information with other Cisco devices directly connected on the same network segment.

b. Information shared by CDP:

Each Cisco device advertises the following details to its neighbors:

InformationDescription
Device IDHostname of the device
IP AddressManagement or interface IP
Port IDInterface used for connection
PlatformDevice type/model (e.g., Cisco 2960)
CapabilitiesWhether it’s a router, switch, phone, etc.
Software versionIOS version running

c. CDP Operation:

  • CDP sends advertisements (CDP packets) every 60 seconds by default.
  • Devices store the received information in a CDP neighbor table.
  • Each CDP entry has a holdtime (default 180 seconds) — if no new CDP message is received before the timer expires, that neighbor is removed from the table.

d. CDP Configuration Commands

➤ Enable CDP (Globally)

Switch(config)# cdp run

➤ Disable CDP (Globally)

Switch(config)# no cdp run

➤ Enable/Disable CDP on an Interface

Switch(config-if)# cdp enable
Switch(config-if)# no cdp enable

e. CDP Verification Commands

CommandDescription
show cdpShows CDP status (enabled/disabled, timer values)
show cdp neighborsLists all directly connected Cisco neighbors
show cdp neighbors detailShows detailed info (IP, IOS version, platform, capabilities)
show cdp interfaceDisplays interfaces where CDP is active

f. CDP Example Output

Switch# show cdp neighbors
Device ID    Local Intf   Holdtime   Capability   Platform   Port ID
R1           Fa0/1        141        R S I        2811       Fa0/0

Explanation:

  • Device ID: R1 (neighbor’s hostname)
  • Local Intf: Fa0/1 (your switch interface)
  • Port ID: Fa0/0 (neighbor’s interface)
  • Platform: Cisco 2811 router
  • Capability: Router, Switch, IP (R S I)

g. Security Consideration:

CDP can reveal detailed device information (like model, software version), which can be misused if attackers connect to the network.
👉 Therefore, disable CDP on interfaces not used for network management (like user-facing ports or internet connections).


🔹 5. Link Layer Discovery Protocol (LLDP)

a. Definition:

LLDP (Link Layer Discovery Protocol) is an open-standard discovery protocol defined in IEEE 802.1AB.
It works similarly to CDP but can be used between different vendors (e.g., Cisco switch and HP switch).


b. LLDP Information Shared:

Like CDP, LLDP advertises:

  • Device name (System name)
  • Port ID
  • Port description
  • System capabilities
  • Management IP address

c. LLDP Operation:

  • LLDP frames are sent every 30 seconds by default.
  • Each device maintains an LLDP neighbor table.
  • Holdtime (time neighbor entry remains valid): 120 seconds by default.

d. LLDP Configuration Commands

➤ Enable LLDP (Globally)

Switch(config)# lldp run

➤ Disable LLDP (Globally)

Switch(config)# no lldp run

➤ Enable/Disable LLDP on Interface

Switch(config-if)# lldp transmit
Switch(config-if)# lldp receive
Switch(config-if)# no lldp transmit
Switch(config-if)# no lldp receive

(You can choose to only send, only receive, or both.)


e. LLDP Verification Commands

CommandDescription
show lldpDisplays LLDP global status
show lldp neighborsLists LLDP neighbors
show lldp neighbors detailShows detailed info including system name, IP, capabilities
show lldp interfaceDisplays interfaces with LLDP enabled

f. Example Output

Switch# show lldp neighbors
Device ID       Local Intf   Holdtime   Capability   Port ID
HP-Switch1      Gi0/1        110        B,R          Gi0/24

Explanation:

  • Device ID: HP-Switch1 (neighbor’s hostname)
  • Local Intf: Gi0/1 (your switch interface)
  • Capability: Bridge (Switch), Router
  • Port ID: Gi0/24 (neighbor’s interface)

🔹 6. CDP vs LLDP (Comparison Table)

FeatureCDPLLDP
TypeCisco proprietaryIEEE 802.1AB (open standard)
Supported DevicesCisco onlyCisco + other vendors
Default Status on CiscoEnabledDisabled
Timer (advertisement)60 seconds30 seconds
Holdtime180 seconds120 seconds
Commandscdp run / no cdp runlldp run / no lldp run
Interface controlcdp enable / no cdp enablelldp transmit/receive
Works atLayer 2 (Data Link)Layer 2 (Data Link)

🔹 7. Practical Use in IT Networks

  • Network Mapping: Automatically identify connections between routers, switches, and IP phones.
  • VoIP Networks: Switches use CDP/LLDP to detect IP phones and assign correct VLANs (e.g., voice VLANs).
  • Troubleshooting: If a link goes down, you can use show cdp neighbors or show lldp neighbors to confirm what device is (or was) connected to that interface.
  • Multi-vendor environments: LLDP ensures interoperability between different vendor devices.

🔹 8. Common Exam Tips

CDP is enabled by default on Cisco devices; LLDP is not — you must enable LLDP manually.
✅ Both operate at Layer 2 and do not require IP addresses.
✅ Remember CDP timer = 60s, Holdtime = 180s, and LLDP timer = 30s, Holdtime = 120s.
Disable CDP/LLDP on untrusted or user-facing interfaces for security.
✅ Know how to verify neighbors and interpret output in exam simulations.


🔸 Summary

Key PointDescription
PurposeDiscover directly connected devices on the same Layer 2 network
ProtocolsCDP (Cisco only), LLDP (multi-vendor)
LayerData Link (Layer 2)
Use CasesTroubleshooting, network mapping, VoIP configuration
Exam FocusCommands, output interpretation, differences, timers, and security practices

Leave a Reply

Your email address will not be published. Required fields are marked *

Buy Me a Coffee