Reviewed: No
- Purpose: Used to share information between directly connected devices, such as hostname, IP address, and device type.
- Layer 2 Operation: These protocols function at Layer 2, meaning they don't use IP addresses.
- Protocols:
- CDP (Cisco Discovery Protocol): Cisco proprietary protocol.
- LLDP (Link Layer Discovery Protocol): Industry-standard protocol, IEEE 802.1AB.
- Default State:
- Enabled by default on Cisco devices (routers, switches, firewalls, IP phones).
- Uses multicast MAC address
0100.0CCC.CCCC
.
- Message Timers:
- Message Interval: 60 seconds.
- Holdtime: 180 seconds (entry removed if no message is received in this time).
- Version: CDP v2 is used by default.
- View CDP Status:
show cdp
– Shows CDP status, including message interval and holdtime.show cdp traffic
– Displays CDP packet statistics.show cdp interface
– Shows CDP status per interface, including message timer and holdtime.
- View Neighbor Information:
show cdp neighbors
– Lists CDP neighbors and their details.- Columns:
- Device ID: Hostname of the neighbor.
- Local Interface: Interface on this device (e.g., G0/0).
- Holdtime: Time before the neighbor is removed.
- Capabilities: Type of device (e.g., R for Router, S for Switch).
- Platform: Model of the neighboring device.
- Port ID: Interface on the neighboring device.
- Detailed Neighbor Information:
show cdp neighbors detail
– Displays additional details like software version, IP address, native VLAN, and duplex settings.show cdp entry <neighbor>
– Shows detailed information for a specific neighbor.
- Enable/Disable CDP:
- Global:
cdp run
to enable,no cdp run
to disable. - Interface:
cdp enable
to enable,no cdp enable
to disable.
- Global:
- Configure Timers:
- Message Timer:
cdp timer <seconds>
(default 60). - Holdtime:
cdp holdtime <seconds>
(default 180).
- Message Timer:
- LLDP Overview:
- Industry-standard protocol supported by various vendors (Cisco, Juniper, Palo Alto).
- Disabled by default on Cisco devices.
- Multicast MAC Address:
0180.C200.000E
. - Message Interval: 30 seconds.
- Holdtime: 120 seconds.
- Additional Timer:
- Reinitialization Timer: Prevents rapid enable/disable (default 2 seconds).
- View LLDP Status:
show lldp
– Shows LLDP status and timers.show lldp traffic
– Displays LLDP packet statistics.show lldp interface
– Shows LLDP status for each interface (Tx and Rx).
- View Neighbor Information:
show lldp neighbors
– Lists LLDP neighbors.show lldp neighbors detail
– Displays detailed neighbor information, similar to CDP.show lldp entry <neighbor>
– Shows detailed information for a specific LLDP neighbor.
- Enable/Disable LLDP:
- Global:
lldp run
to enable,no lldp run
to disable. - Interface:
lldp transmit
– Enable transmission of LLDP messages.lldp receive
– Enable reception of LLDP messages.
- Global:
- Configure Timers:
- Message Timer:
lldp timer <seconds>
(default 30). - Holdtime:
lldp holdtime <seconds>
(default 120). - Reinitialization Timer:
lldp reinit <seconds>
(default 2).
- Message Timer:
- CDP: Cisco proprietary, enabled by default on Cisco devices, shares more detailed information (e.g., VTP settings).
- LLDP: Industry-standard, requires manual configuration on Cisco devices, compatible with non-Cisco devices.
- Security Risk: Both protocols can share sensitive network information (hostname, IP, etc.). Many admins disable them to reduce security risks.
- Use Cases: CDP is useful in all-Cisco environments, while LLDP is necessary in multi-vendor environments.
- CDP Capture: Shows the multicast MAC address, CDP version, and detailed device information.
- LLDP Capture: Shows similar information but uses a different multicast MAC address and slightly different fields.
- CDP Timers:
- Commands:
show cdp
andshow cdp interface
display CDP timers.
- Commands:
- CDP Default State:
- CDP enabled on interfaces by default (
cdp enable
) and uses a 60-second message timer.
- CDP enabled on interfaces by default (
- LLDP Capabilities:
- A multilayer switch (SW1) shows system capabilities
B, R
(Bridge and Router).
- A multilayer switch (SW1) shows system capabilities
- LLDP Configuration:
- LLDP requires separate
lldp transmit
andlldp receive
commands for each interface. - LLDP can be used to discover the OS version of a neighboring device.
- LLDP requires separate