Configure and Verify Layer 2 Discovery Protocols (CDP, LLDP)
Key Concepts
- Layer 2 Discovery Protocols
- CDP (Cisco Discovery Protocol)
- LLDP (Link Layer Discovery Protocol)
- Configuration Commands
- Verification Commands
Layer 2 Discovery Protocols
Layer 2 discovery protocols are used to discover information about neighboring devices on the same local network segment. These protocols help network administrators gather details about connected devices, such as device type, IP address, and capabilities, without needing to manually inspect each device.
CDP (Cisco Discovery Protocol)
CDP is a proprietary Cisco protocol that runs at Layer 2 of the OSI model. It allows Cisco devices to discover information about directly connected Cisco devices, such as device type, software version, and IP address. CDP is enabled by default on Cisco devices.
Example: When a Cisco switch is connected to a Cisco router, CDP allows the switch to discover the router's IP address, model number, and software version.
LLDP (Link Layer Discovery Protocol)
LLDP is an open standard protocol defined by the IEEE 802.1AB standard. It operates at Layer 2 and is designed to be vendor-neutral, allowing devices from different manufacturers to discover each other. LLDP provides similar information to CDP, such as device type, capabilities, and management addresses.
Example: A switch from one vendor can use LLDP to discover a router from another vendor, obtaining details like the router's IP address and model number.
Configuration Commands
To configure CDP and LLDP on Cisco devices, use the following commands:
- CDP:
enable configure terminal cdp run interface [interface-name] cdp enable - LLDP:
enable configure terminal lldp run interface [interface-name] lldp transmit lldp receive
Example: To enable CDP on a Cisco switch, you would enter:
enable
configure terminal
cdp run
interface GigabitEthernet0/1
cdp enable
Verification Commands
To verify the configuration and gather information about neighboring devices, use the following commands:
- CDP:
show cdp neighbors show cdp neighbors detail - LLDP:
show lldp neighbors show lldp neighbors detail
Example: To verify CDP neighbors on a Cisco switch, you would enter:
show cdp neighbors
Conclusion
Understanding and configuring Layer 2 discovery protocols like CDP and LLDP is essential for network administrators. These protocols provide valuable information about connected devices, simplifying network management and troubleshooting. By following the configuration and verification commands, you can effectively use CDP and LLDP to gather critical details about your network infrastructure.