Network Access // Lesson 04

CDP &
LLDP.

You're connected to a switch port, but what's actually at the other end? Neighbour discovery protocols allow network devices to advertise useful information to directly connected neighbours — making them extremely handy for understanding and troubleshooting a network.

CDP LLDP Neighbour discovery Cisco IOS Troubleshooting
01 // The idea

Meet your neighbours.

Network devices often need a quick way to discover what is directly connected to them.

Neighbour discovery protocols advertise information such as:

Key point: CDP and LLDP discover directly connected neighbours. They are not routing protocols and do not build end-to-end paths through the network.
02 // CDP

Cisco Discovery Protocol.

CDP stands for Cisco Discovery Protocol.

It is Cisco's proprietary Layer 2 neighbour discovery protocol and is commonly supported on Cisco network equipment.

SW1 Gi0/1
SW2 Gi0/24

Because discovery operates between directly connected devices, useful neighbour information can often be obtained even when Layer 3 addressing is incomplete or misconfigured.

03 // LLDP

The standards-based alternative.

LLDP stands for Link Layer Discovery Protocol.

Unlike Cisco-proprietary CDP, LLDP is defined by the IEEE 802.1AB standard and is designed for multi-vendor environments.

CDP

Cisco Discovery Protocol

Cisco proprietary protocol commonly used between Cisco devices.

LLDP

Link Layer Discovery Protocol

IEEE standards-based protocol designed to work across equipment from different vendors.

Easy exam association:

CDP = Cisco proprietary.
LLDP = IEEE 802.1AB standard.
04 // What do we learn?

Useful neighbour information.

The exact information available depends on the device and protocol, but neighbour advertisements can reveal useful details such as:

Information Why it helps
Device ID / system name Identifies the neighbouring device
Local interface Shows which of your ports reaches it
Remote port ID Shows the neighbour's connected interface
Platform Can identify the neighbouring hardware type
Capabilities Indicates functions such as switching or routing
Management address May provide an address useful for managing the neighbour
05 // CDP verification

show cdp neighbors.

One of the first commands worth remembering is:

SW1# show cdp neighbors

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
SW2              Gig 0/1           143        S I         C9200     Gig 0/24
R1               Gig 0/2           156        R S I       ISR4331   Gig 0/0

From this output we can quickly see:

Practical example: if you know you're on SW1 but don't know which port connects to SW2, this command can answer the question in seconds.
06 // More detail

show cdp neighbors detail.

For more information:

SW1# show cdp neighbors detail

Device ID: SW2
Entry address(es):
  IP address: 192.168.99.12

Platform: cisco C9200, Capabilities: Switch IGMP
Interface: GigabitEthernet0/1
Port ID (outgoing port): GigabitEthernet0/24

The detailed output may include information such as the neighbour's management IP address and software/platform details.

07 // CDP control

Enable or disable CDP.

CDP can be controlled globally:

# Enable CDP globally
SW1(config)# cdp run

# Disable CDP globally
SW1(config)# no cdp run

Or on an individual interface:

SW1(config)# interface gigabitEthernet 0/1

# Enable CDP on this interface
SW1(config-if)# cdp enable

# Disable CDP on this interface
SW1(config-if)# no cdp enable
Know the difference: cdp run controls CDP globally, while cdp enable controls it on an interface.
08 // LLDP configuration

Enable LLDP.

On Cisco IOS, LLDP can be enabled globally with:

SW1(config)# lldp run

Interfaces can independently control whether they transmit and receive LLDP advertisements:

SW1(config)# interface gigabitEthernet 0/1
SW1(config-if)# lldp transmit
SW1(config-if)# lldp receive

And either function can be disabled:

SW1(config-if)# no lldp transmit
SW1(config-if)# no lldp receive
LLDP's separate transmit and receive controls are worth remembering. An interface can be configured to advertise, listen, both, or neither.
09 // LLDP verification

show lldp neighbors.

The LLDP equivalent is:

SW1# show lldp neighbors

Capability codes:
  R - Router, B - Bridge

Device ID        Local Intf     Hold-time   Capability   Port ID
SW2              Gi0/1         120         B            Gi0/24
CORE-RTR         Gi0/2         120         R            Gi0/0

For additional information:

SW1# show lldp neighbors detail
10 // CDP vs LLDP

Side by side.

Feature CDP LLDP
Full name Cisco Discovery Protocol Link Layer Discovery Protocol
Type Cisco proprietary Open standard
Standard Cisco IEEE 802.1AB
Scope Direct neighbours Direct neighbours
Main verification show cdp neighbors show lldp neighbors
Detailed verification show cdp neighbors detail show lldp neighbors detail
11 // Real-world use

You inherit an undocumented switch.

Imagine you've logged into a switch you've never seen before. Its interface descriptions are useless and there is no current network diagram.

You could start with:

SW1# show cdp neighbors

or:

SW1# show lldp neighbors

Within seconds you may be able to identify which ports connect to other switches, routers, access points, phones or other infrastructure.

This makes neighbour discovery particularly useful when mapping, documenting and troubleshooting an unfamiliar network.
12 // Troubleshooting

Why can't I see my neighbour?

CHECK 01

Protocol enabled?

Confirm CDP or LLDP is enabled globally on the device.

CHECK 02

Interface enabled?

Check whether discovery has been disabled on the particular interface.

CHECK 03

LLDP direction?

Check lldp transmit and lldp receive.

CHECK 04

Protocol mismatch?

A non-Cisco neighbour may support LLDP but not Cisco CDP.

CHECK 05

Physical connection?

Neighbour discovery cannot fix a dead link. Verify interface and physical link status too.

CHECK 06

Direct neighbour?

CDP and LLDP describe directly connected devices, not arbitrary devices several network hops away.

13 // Security

Useful information can also be sensitive.

Neighbour discovery is extremely useful for network administrators, but the information advertised can reveal details about network devices and topology.

For that reason, organisations may choose to disable discovery protocols on interfaces where advertisements are unnecessary or inappropriate.

Think about exposure: discovery protocols are useful inside a managed network, but you should understand what information is being advertised and where.
14 // Exam traps

Things worth remembering.

  • CDP is Cisco proprietary.
  • LLDP is the IEEE 802.1AB standards-based alternative.
  • Both are used to discover directly connected neighbours.
  • They are not routing protocols.
  • show cdp neighbors provides a CDP neighbour summary.
  • show cdp neighbors detail provides additional information.
  • show lldp neighbors provides an LLDP neighbour summary.
  • CDP can be controlled globally and per interface.
  • LLDP supports separate transmit and receive controls on an interface.
  • Discovery protocols are useful for topology mapping and troubleshooting.
15 // Quick reference

Commands to remember.

# CDP verification
show cdp neighbors
show cdp neighbors detail

# CDP global control
cdp run
no cdp run

# CDP interface control
cdp enable
no cdp enable

# Enable LLDP globally
lldp run

# LLDP interface control
lldp transmit
lldp receive
no lldp transmit
no lldp receive

# LLDP verification
show lldp neighbors
show lldp neighbors detail
16 // Test yourself

CDP & LLDP quick quiz

1. Which statement correctly describes CDP?

2. Which IEEE standard defines LLDP?

3. Which command displays a summary of directly connected CDP neighbours?

4. Which command globally enables LLDP on Cisco IOS?

5. What type of devices do CDP and LLDP primarily discover?

6. Which LLDP commands control advertisements on an interface?

7. Why might LLDP be preferred in a mixed-vendor network?

Score: 0 / 7