CDP and LLDP
07 May 2022In 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
R2
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
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.
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.
To show what a populated table looks like here is R2’s.
You can see SW is in its 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 protocolno lldp run
: stops the protocolno lldp trasmit
: Do not participate in discovery, but still recieve neighbor updatesno lldp recieve
: Do not recieve neighbor updatesshow lldp neighbors
: Display LLDP neighbors