Lukej2680 Tech Blog

CDP and LLDP

This lab demonstrates how to configure Cisco Discovery Protocol (CDP) on Cisco router and switch devices. It will also discuss Link Layer Discovery Protocol (LLDP) and the differences between CDP and LLDP.

Topology pic

In this lab:

  • Setting up initial router and switch configurations
  • Configuring and verifying CDP
  • Comparing LLDP

Setting up initial router and switch configurations
To start we configure the the hostnames and IP addresses on our routers:

R1

R1 Config Pic

R2

R2 Config Pic

As seen above I forgot to use the command no shutdown when configuring my R1. This leaves the interface in a an administratively down state meaning this interface is not in use.
To fix this we simply enter the no shut command to bring the interface administratively. Router interfaces are by default down however switch interfaces are by default up. This is why later in the lab you may see me forget to use the no shut command. That being said, best practice is still to always use no shut when configuring a link.

SW1

SW Config Pic

Here you can notice I set an IP for the switch. While a switch is a layer 2 device setting a ‘management IP’ address allows it to use services like ssh, telnet and CDP.

CDP Configuration
CDP is enabled by default on most Cisco devices. However if we wanted a device to not participate we use the no cap enable on the interface we don’t want to participate in cdp.
cdp off pic

Verification:

Now we go to R1, who is the device connected to SW1 on fa0/1, flush the CDP cache using no cdp run and verify the cache is empty using show cdp neighbors.
Because we turned cdp off on SW1 fa0/1 R1 was not able to populate it’s cdp neighbors table.
empty cdp table

To show what a populated table looks like here is R2’s.
You can see SW is in its table.
populated cdp table

Comparing LLDP
LLDP performs similar to CDP. The main difference between them is CDP is a Cisco properitery protocol while LLDP is open source. CDP will only discover Cisco devices as neighbors while LLDP can also discover Linux servers. There are more slight differences between the two, but you can configure the protocol on devices using the commands:

  • lldp run : starts the protocol
  • no lldp run : stops the protocol
  • no lldp trasmit : Do not participate in discovery, but still recieve neighbor updates
  • no lldp recieve : Do not recieve neighbor updates
  • show lldp neighbors : Display LLDP neighbors

This lab is a lab taken from Niel Andersons CCNA Udemy course. All work is mine however the lab itself is not my property.
All Labs were done using Cisco Packet Tracer.