Reference

Switching

CDP and LLDP

CDP is a Cisco proprietary Layer 2 discovery protocol and LLDP is the IEEE 802.1AB open standard equivalent, both used to learn about directly connected neighbor devices.

What you need to know

  • CDP is enabled globally by default on Cisco devices and sends advertisements every 60 seconds with a holdtime of 180 seconds.
  • LLDP is disabled by default on most Cisco IOS devices and must be enabled globally with lldp run.
  • CDP and LLDP operate at Layer 2 and function across trunk links but not across routed Layer 3 boundaries.
  • CDP should be disabled on ports facing untrusted or external networks for security reasons.
  • show cdp neighbors detail reveals native VLAN mismatches and IP addressing of directly connected devices.
  • LLDP has separate transmit (lldp transmit) and receive (lldp receive) controls per interface.
  • Both protocols can be disabled per-interface even when enabled globally, using no cdp enable or no lldp transmit/receive.

Configuration commands

CommandModePurpose
cdp runconfigEnable CDP globally (enabled by default).
no cdp runconfigDisable CDP globally on the device.
no cdp enableconfig-ifDisable CDP on a specific interface.
cdp timer 30configChange the CDP advertisement interval to 30 seconds.
cdp holdtime 90configChange how long a receiver keeps CDP information before aging it out.
lldp runconfigEnable LLDP globally.
lldp transmitconfig-ifEnable LLDP advertisements out this interface.
lldp receiveconfig-ifEnable processing of received LLDP advertisements on this interface.

Verify it

  • show cdp neighbors
  • show cdp neighbors detail
  • show cdp interface
  • show lldp neighbors
  • show lldp neighbors detail
  • show lldp interface

Common mistakes

  • Assuming LLDP is enabled by default like CDP, then finding no neighbors are discovered.
  • Leaving CDP enabled on interfaces facing the internet or untrusted third parties.
  • Confusing CDP/LLDP neighbor information with actual Layer 3 reachability; discovery does not imply routing works.
  • Not realizing a trunk native VLAN mismatch only shows up as a CDP console warning, not a hard failure.
  • Disabling CDP globally when only a single interface needed it disabled.

Practise CDP and LLDP in a real CLI

Generated labs, graded against the simulated network state.

Start a free lab