Syntax Checker
Command | Explanation |
---|---|
show cdp |
Displays CDP status (enabled/disabled, timers, etc.) |
show cdp neighbors |
Lists directly connected Cisco devices with basic info |
show cdp neighbors detail |
Shows detailed info about neighbors (IP address, platform, etc.) |
show cdp interface |
Shows interfaces on which CDP is running |
show cdp traffic |
Displays statistics about CDP packets sent/received |
cdp run |
Globally enables CDP on the device |
no cdp run |
Globally disables CDP on the device |
cdp enable |
Enables CDP on a specific interface |
no cdp enable |
Disables CDP on a specific interface |
show cdp entry * |
Displays detailed information for all CDP neighbors |
show cdp entry [device-id] |
Displays detailed info for a specific neighbor |
show cdp events |
Displays CDP-related system events/logs (IOS-dependent) |
Command | Explanation |
---|---|
show lldp |
Displays LLDP global status |
show lldp neighbors |
Lists directly connected LLDP-capable devices |
show lldp neighbors detail |
Displays detailed LLDP info (IP, capabilities, etc.) |
show lldp interface |
Shows LLDP status per interface |
show lldp traffic |
Displays statistics about LLDP packets |
lldp run |
Globally enables LLDP |
no lldp run |
Globally disables LLDP |
lldp transmit |
Enables LLDP advertisement on an interface |
no lldp transmit |
Disables LLDP advertisement on an interface |
lldp receive |
Allows LLDP reception on an interface |
no lldp receive |
Disables LLDP reception on an interface |
1. Discovering Devices with CDP and LLDP
“Automate network topology mapping and device discovery using CDP and LLDP protocols for real-time insights”
2. Synchronizing Time with NTP
“Ensure precise time synchronization across network devices with NTP for accurate log correlation.”
3. Monitoring Devices with SNMP
“Monitor network performance and automate alerts using SNMP for proactive device management.”
4. Capturing Logs with Syslog
“Centralize network logging with Syslog for comprehensive visibility and rapid troubleshooting.”
5. Managing Configurations and Backups
“Automate network configuration backups and version control for consistency and disaster recovery.”
6. IOS Image Management and Recovery
“Manage network device software versions with proper testing and recovery mechanisms for upgrades.”
Network Management
A Practical Guide to Discovering, Maintaining, and Monitoring Your Network
Discovering Devices with CDP and LLDP
show cdp neighbors
or show cdp neighbors detail
.lldp run
command and then use show lldp neighbors
to reveal a structured view of adjacent devices. This provides a powerful, hardware agnostic way to map network topology, verify cabling, and streamline documentation, without the need for manual inspection. In modern enterprise and data center environments where mixed vendor hardware is the norm, LLDP is not just helpful, it’s essential for effective network visibility and troubleshooting.In any well-managed network, visibility is key, and neighbor discovery protocols are among the most fundamental tools for gaining it. Whether it’s identifying a new device connection, verifying cable runs, or troubleshooting connectivity issues, your network devices can automatically share critical information about their neighbors. CDP and LLDP provide the mechanisms to discover and map your network topology without manual intervention.

Both CDP and LLDP operate at Layer 2, sending periodic advertisements to directly connected neighbors. These protocols enable automatic topology discovery, providing administrators with real-time visibility into network connections and device capabilities.
Cisco Discovery Protocol (CDP)
CDP is Cisco’s proprietary Layer 2 protocol, enabled by default on Cisco devices, and allows devices to send and receive information about their neighbors. These advertisements contain vital pieces of information that help administrators understand their network topology.
CDP Information Elements
Comprehensive Device Information Shared Through Periodic Advertisements
Information Type | Description | Example |
---|---|---|
Device ID | Hostname of the device | Switch-Core-01 |
Port ID | Local and remote interface | GigabitEthernet0/1 |
Capabilities | Device type and functions | Router, Switch, IGMP |
Platform | Hardware model | WS-C3850-24T |
IP Address | Management IP addresses | 192.168.1.10 |
Software Version | IOS version information | 15.2(4)E7 |
VTP Domain | VLAN Trunking Protocol domain | CORP_DOMAIN |
# Enable CDP globally (default on Cisco devices)
Router(config)# cdp run
# Configure CDP timers
Router(config)# cdp timer 60 # Advertisement interval (default: 60 seconds)
Router(config)# cdp holdtime 180 # Hold time before aging out (default: 180 seconds)
# Interface-specific configuration
Router(config)# interface gigabitethernet0/1
Router(config-if)# cdp enable
Device ID Local Intrfce Holdtme Capability Platform Port ID
Core-SW-01 Gig 0/1 157 R S I WS-C3850 Gig 0/24
Access-SW-02 Gig 0/2 143 S I WS-C2960 Gig 0/1
Router-WAN Gig 0/3 168 R ISR4331 Gig 0/0/0
Link Layer Discovery Protocol (LLDP)
The Link Layer Discovery Protocol (LLDP) is the open-standard alternative that shines in multi-vendor ecosystems. Designed for interoperability, LLDP enables devices from various manufacturers to advertise their identity and capabilities across directly connected Layer 2 links.
LLDP Standard Information Elements
TLV Type | Description | Mandatory |
---|---|---|
Chassis ID | Unique chassis identifier | Yes |
Port ID | Port identifier | Yes |
TTL | Time to Live | Yes |
System Name | Device hostname | Optional |
System Description | Device description | Optional |
System Capabilities | Device capabilities | Optional |
Management Address | IP address for management | Optional |
Broad Compatibility and Platform Support
LLDP isn’t just for network switches—it’s an open standard supported across platforms and operating systems:
Network Devices
- Cisco: IOS, IOS-XE, IOS-XR, NX-OS
- Juniper: Junos
- HP/Aruba: ArubaOS, ProCurve
- Arista: EOS
- Dell: OS6, OS9, OS10
- Extreme Networks: ExtremeXOS
- Fortinet: FortiOS
Virtual Platforms
- VMware: ESXi vSphere Distributed Switch
- Citrix: XenServer
- Microsoft: Hyper-V
- Linux: Open vSwitch
- pfSense: FreeBSD-based firewall
# Enable LLDP globally
Router(config)# lldp run
# Configure LLDP timers
Router(config)# lldp timer 30 # Advertisement interval (default: 30 seconds)
Router(config)# lldp holdtime 120 # Hold time multiplier (default: 4x timer)
# Interface-specific configuration
Router(config)# interface gigabitethernet0/1
Router(config-if)# lldp transmit
Router(config-if)# lldp receive
# Enable LLDP globally
Switch(config)# lldp global-enable
# Configure per-interface
Switch(config)# interface 1/1/1
Switch(config-if)# lldp config-notification
Switch(config-if)# lldp config-tlv-select basic-mgmt
Local Intf: Gi0/1
Chassis id: 00:23:04:ee:be:00
Port id: 24
Port Description: GigabitEthernet1/0/24
System Name: HP-2930F-Stack
System Description: HP 2930F-24G-4SFP+ Switch
System Capabilities: B (Bridge)
Management Addresses:
IP: 192.168.1.50
Protocol Comparison and Modern Discovery Tools
CDP vs LLDP Feature Comparison
Protocol Comparison for Network Discovery
Feature | CDP | LLDP |
---|---|---|
Standard | Cisco Proprietary | IEEE 802.1AB (Open) |
Vendor Support | Cisco Only | Multi-vendor |
Default State | Enabled | Usually Disabled |
Advertisement Interval | 60 seconds | 30 seconds |
Hold Time | 180 seconds | 120 seconds |
Information Richness | Very Detailed | Standardized Set |
VTP Domain Info | Yes | No |
Power Management | Limited | PoE information |
Network Management Integration
Protocol Support in Popular Network Management Tools
Tool | CDP Support | LLDP Support | Key Features |
---|---|---|---|
SolarWinds NPM | Yes | Yes | Automatic topology mapping |
PRTG | Yes | Yes | Real-time monitoring |
LibreNMS | Yes | Yes | Open-source, multi-vendor |
Observium | Yes | Yes | Auto-discovery, graphing |
Nagios | Plugin | Plugin | Alerting, status monitoring |
Best Practices for Network Discovery Implementation
# Disable on untrusted interfaces
interface gigabitethernet0/1
description "Internet Connection"
no cdp enable
no lldp transmit
no lldp receive
# Internal interfaces - enable both protocols
interface range gigabitethernet0/1-24
cdp enable
lldp transmit
lldp receive
# External interfaces - disable for security
interface gigabitethernet0/25
description "DMZ Connection"
no cdp enable
no lldp transmit
no lldp receive
# Automated topology discovery script
#!/bin/bash
for device in $(cat device_list.txt); do
ssh $device "show cdp neighbors detail" >> topology_$(date +%Y%m%d).txt
ssh $device "show lldp neighbors detail" >> topology_$(date +%Y%m%d).txt
done
# Global CDP/LLDP configuration
cdp run
lldp run
# Service timestamps for event correlation
service timestamps log datetime localtime show-timezone msec
# Configure timers
cdp timer 60
cdp holdtime 180
lldp timer 30
# Interface configuration for access ports
interface range gigabitethernet0/1-24
description Access Ports
cdp enable
lldp transmit
lldp receive
# Uplink interfaces
interface range gigabitethernet0/25-28
description Uplink Ports
cdp enable
lldp transmit
lldp receive
# External interface (security hardened)
interface gigabitethernet0/29
description Internet Connection
no cdp enable
no lldp transmit
no lldp receive
#!/bin/bash
# Network discovery across multiple vendors
cisco_discovery() {
ssh admin@$1 "show cdp neighbors detail; show lldp neighbors detail"
}
hp_discovery() {
ssh admin@$1 "show lldp info remote-device"
}
juniper_discovery() {
ssh admin@$1 "show lldp neighbors detail"
}
# Execute discovery based on vendor
for device in $(cat network_devices.txt); do
vendor=$(grep $device vendor_mapping.txt | cut -d: -f2)
case $vendor in
cisco) cisco_discovery $device ;;
hp) hp_discovery $device ;;
juniper) juniper_discovery $device ;;
esac
done
Conclusion
Effective neighbor discovery implementation transforms your network from a collection of isolated devices into a well-documented, easily manageable infrastructure. Network administrators can enable LLDP with a simple lldp run
command and then use show lldp neighbors
to reveal a structured view of adjacent devices. This provides a powerful, hardware-agnostic way to map network topology, verify cabling, and streamline documentation, without the need for manual inspection.
In modern enterprise and data center environments where mixed vendor hardware is the norm, LLDP is not just helpful, it’s essential for effective network visibility and troubleshooting. While CDP remains valuable in Cisco-centric environments, implementing both protocols strategically, with proper security considerations, creates a foundation for comprehensive network management.
Start with basic neighbor discovery on critical devices, then gradually expand coverage while implementing security best practices for edge connections. The combination of automated discovery and proper documentation ensures you maintain visibility and control over your network infrastructure.