Jeremy’s IT Lab lecture video:
Commands
Commands List
Layer 2 Protocols Show Commands
12. Layer 2 Discovery Protocols
12.1 CDP
- show cdp
-->Shows global CDP information, like the timer, holdtime, and advertisement version- show cdp traffic
-->Shows CDP traffic statistics- show cdp interface
-->Shows full CDP information about the interfaces running the CDP protocol, along with a basic summary at the end- show cdp interface interface-id
-->Shows full CDP information about the specified interface running the CDP protocol- show cdp neighbors
-->Shows brief information about all connected CDP neighbors- show cdp neighbors detail
-->Shows detailed information about all connected CDP neighbors- show cdp entry host-name
-->Similar toshow cdp neighbors detail, but only shows detailed information for the specified host12.2 LLDP
Link to original
- show lldp
-->Shows global lldp information, like the timer, holdtime, and reinit timer- show lldp traffic
-->Shows LLDP traffic statistics- show lldp interface
-->Shows full LLDP information about the interfaces running the LLDP protocol, such as transmit and receive status and state- show lldp interface interface-id
-->Shows full LLDP information about the specified interface running the LLDP protocol- show lldp neighbors
-->Shows brief information about all connected LLDP neighbors- show lldp neighbors detail
-->Shows detailed information about all connected LLDP neighbors- show lldp entry host-name
-->Similar toshow lldp neighbors detail, but only shows detailed information for the specified hostLayer 2 Protocols Global Commands
Layer 2 Discovery Protocols Global
1. CDP
- cdp run
-->Enables CDP globally- cdp timer seconds
-->Sets the CDP message timer- cdp holdtime seconds
-->Sets the CDP message holdtime- cdp advertise-v2
-->Changes CDP version to V22. LLDP
Link to original
- lldp run
-->Enables LLDP globally- lldp timer seconds
-->Sets the LLDP message timer- lldp holdtime seconds
-->Sets the LLDP message holdtime- lldp reinit seconds
-->Sets the LLDP reinit timerLayer 2 Protocols Interface Commands
Layer 2 Discovery Protocols Interface
1. CDP
- cdp enable
-->Enables CDP on the current interface2. LLDP
Link to original
- lldp transmit
-->Enables LLDP transmission on the current interface- lldp receive
-->Enables LLDP receiving on the current interface
Layer 2 Discovery Protocols Info
Layer 2 discovery protocols like Cisco Discovery Protocol (CDP) and Link Layer Discovery Protocol (LLDP) are used to share information and discover information about neighboring (directly connected) devices.
- CDP is a Cisco proprietary protocol
- LLDP is an industry standard protocol
The shared information can include Layer 2 and 3 data, like the host name, IP address, device type, etc.
They are usually considered to be security risks and are often not used in networks.
Layer 2 Discovery Protocols - CDP and LLDP
CDP and LLDP can both be run at the same time on the current networking device without any conflicts.
Cisco Discovery Protocol (CDP)
CDP Info
CDP is a Cisco proprietary protocol that is:
- Enabled globally by default on Cisco devices, and enabled by default on each interface
- Sends messages to MAC Address: 0100.0ccc.cccc
- Timers:
- Message Timer: 60 seconds
- Holdtime: 180 seconds
- CDPv2 messages are sent by default
When a device receives a CDP message, it is processed and discarded afterwards. The device will NOT forward it to other devices.
CDP Show
show cdp- Shows the global message timer, holdtimer, and CDP version
show cdp traffic- Shows traffic statistics about CDP packets
show cdp interface- Shows each interfaces’ encapsulation type, message timer, holdtimer
- Gives a summary of CDP enabled interfaces at the end
show cdp neighbors- Shows a capability codes legend
- Displays all the connected CDP devices along with their information, including: Device ID, locally connected interface, current holdtime, capabilities, platform and port ID
show cdp neighbors detail- Shows detailed connected CDP devices information, including: All the previous information, version, OS, CDP version, configured holdtime, VTP information, IP addresses of the neighboring connected interface, duplex mode, native VLAN.
show cdp entry HOST-NAME- Same as
show cdp neighbors detail, but it shows information for the specified neighbor/host
- Same as
CDP Config
cdp run- Enables CDP globally
cdp enable- Enables CDP on the current interface
cdp timer SECONDS- Sets the CDP message timer
cdp holdtime SECONDS- Sets the CDP message holdtime
cdp advertise-v2- Changes CDP version to V2
Link Layer Discovery Protocol (LLDP)
CDP Info
LLDP is an industry standard protocol that is:
- Disabled globally by default on Cisco devices, so it must be manually enabled and also enabled on each interface
- Sends messages to MAC Address: 0180.c200.000e
- Timers:
- Message Timer: 30 seconds
- Holdtime: 120 seconds
- Reinitialization delay: 2 seconds
- LLDP has an initialization timer (2 seconds) that starts counting once LLDP is enabled (globally or on an interface), the timer will delay the actual initialization of LLDP.
When a device receives an LLDP message, it is processed and discarded afterwards. The device will NOT forward it to other devices.
LLDP Show
show lldp- Shows the global message timer, holdtimer, and initialization timer
show lldp traffic- Shows traffic statistics about LLDP packets
show lldp interface- Shows each interfaces’ transmit, transmit state, receive and receive state
show lldp neighbors- Shows a capability codes legend
- Displays all the connected LLDP devices along with their information, including: Device ID, locally connected interface, configured holdtime, capabilities, and port ID
show lldp neighbors detail- Shows detailed connected LLDP devices information, including: All the previous information, OS, current holdtime, system capabilities and enabled capabilities
show lldp entry HOST-NAME- Same as
show lldp neighbors detail, but it shows information for the specified neighbor/host
- Same as
CDP Config
lldp run- Enables LLDP globally
lldp transmit- Enables LLDP message transmission on the current interface
lldp receive- Enables LLDP message receiving on the current interface
lldp timer SECONDS- Sets the LLDP message timer
lldp holdtime SECONDS- Sets the LLDP message holdtime
lldp reinit SECONDS- Changes the LLDP reinitialization timer