Wednesday, May 29, 2024

Cisco 121 - CDP & LLDP

CDP = Cisco Discovery Protocol
LLDP = Link Layer Discovery Protocol

CDP is Cisco proprietary.
LLDP came later and is industry standard.

They are very similar and do the same things.  They are Layer 2 (Ethernet) discovery protocols that share info and discover info about neighboring (connected) devices.

CDP:

Enabled by default.
Both globally and on each interface.

Sent to MAC 0100.0CCC.CCCC
Devices don't forward CCDP frames.
By default sent every 60 seconds.
Holdtime = 180 seconds.  If no updates within 180 seconds, remove the neighbor from the CDP neighbor table.
Default is CDPv2.

R1#show cdp
^Displays basic info about CDP (timers, version)

R1#show cdp traffic
^Shows how many CDP messages sent/received

R1#show cdp interface
^Displays which interfaces CDP is enabled on

R1#show cdp neighbors
^Lists neighbors and some basic info on each

R1#show cdp neighbors detail
^More details

R1#show cdp entry <name>
^Same info as above but for specified neighbor

R1(config)#[no] cdp run
^Disable or enable CDP on device

R1(config-if)#[no] cdp enable
^Disable or enable CDP on specific interface.
Recall by default CDP is enabled globally (on the device) and on each interface.

R1(config)#cdp timer <seconds>
Recall default is 60

R1(config)#cdp holdtime <seconds>
Recall default is 180 seconds after which neighbor is removed from CDP neighbor table

R1(config)#[no] cdp advertise-v2
Disable/enable CDP v2.
If v2 is disabled, device will use v1.


LLDP:

Disabled by default.
Must be manually enabled on Cisco devices.
You can run both CDP and LLDP simultaneously.
Sent to MAC C180.C200.000E

Sent every 30 seconds. (CDP is 60)
Holdtime is 120 seconds. (CDP is 180)

Reinitialization delay - Delays the actual initialization of LLDP on an interface by 2 seconds by default.

R1(config)#lldp run
^ Enables LLDP

R1(config-if)#lldp transmit
R1(config-if)#lldp lldp receive
^ Must turn on both transmit and receive on each interface.

R1(config)#lldp timer <seconds>
R1(config)#lldp holdtime <seconds>
R1(config)#lldp reinit <seconds>


[These are my notes from Jeremy's excellent CCNA course which can be viewed here.]