In this lesson, we will discuss layer 2 discovery protocol.
- CDP (Cisco Discovery Protocols)
- LLDP (Link Layer Discovery Protocol)
The main function of these protocols to collect and share information with neighbor devices. Shared information includes host name, IP address and device type etc. When a device receive a CDP/LLDP message, it adds the neighbor information in the neighbor table and discards the message. It doesn’t forward the message to other devices. So, this way you can see only directly connected devices can become CDP/LLDP neighbors.
CDP (Cisco Discovery Protocol)
It is a Cisco proprietary protocol. By default, CDP enables on all Cisco devices (router, switches, firewall).
CDP message timer = 60 sec, CDP holddown timer = 180 sec
After sending CDP message, it waits for 180 sec, if there is no response in this time from neighbor side then it deletes the neighbor from neighbor table.
CDP messages are periodically sent (after 60 second) to multicast address 0100.0ccc.cccc
By default, CDP enable on device. To disable the CDP, use no cdp run command in global configuration mode.
R1(config) # no cdp run -—to disable the cdp
R1(config) # cdp run -—to enable the cdp
By default CDP is enable on each interface, to disable cdp use no cdp enable command in interface mode.
R1(config-if) no cdp enable —-— to disable the cdp
R1(config-if) cdp enable —-— to enable the cdp
R1# show cdp neighbors –— this command will show a list of lldp neighbors and some basic information.
LLDP (Link Layer Discovery Protocol)
It is an industry standard protocol. By default, LLDP is disable on all devices.
LLDP message timer = 30 sec and LLDP hold-down timer =120 sec.
LLDP messages use multicast MAC address = 0180.C200.000E.
A device can run CDP and LLDP at the same time.
Here are the some useful commands-
- R1(config)# lldp run –— to enable the lldp on device.
2. R1(config)# no lldp run –— to disable the lldp on device.
3. R1(config-if)# lldp transmit –— allow interface to transmit lldp messages.
4. R1(config-if)# lldp receive –— allow interface to receive lldp messages.
5. R1# show lldp neighbors –— this command will show a list of lldp neighbors and some basic information.