LLDP (Link Layer Discovery Protocol)
LLDP discovers directly connected network devices - shows what’s connected to each interface without needing network diagrams. Works across vendors (unlike Cisco’s proprietary CDP).
Enable LLDP Globally
Section titled “Enable LLDP Globally”LLDP is disabled by default on many devices.
Switch(config)# lldp runDisable LLDP Globally
Section titled “Disable LLDP Globally”Switch(config)# no lldp runEnable/Disable LLDP Per Interface
Section titled “Enable/Disable LLDP Per Interface”Disable LLDP on specific interface:
Switch(config)# interface GigabitEthernet0/1Switch(config-if)# no lldp transmitSwitch(config-if)# no lldp receiveRe-enable LLDP on interface:
Switch(config-if)# lldp transmitSwitch(config-if)# lldp receiveView LLDP Neighbors
Section titled “View LLDP Neighbors”Shows all directly connected devices.
Switch# show lldp neighborsTypical output:
Capability codes: (R) Router, (B) Bridge, (T) Telephone, (C) DOCSIS Cable Device (W) WLAN Access Point, (P) Repeater, (S) Station, (O) Other
Device ID Local Intf Hold-time Capability Port IDSW1 Gig0/1 120 B Gig0/1Main_L3 Gig1/1 120 R Gig1/0/2Edge Gig2/1 120 R Gig0/0/1
Total entries displayed: 3View Detailed LLDP Neighbor Information
Section titled “View Detailed LLDP Neighbor Information”Shows full details including IP addresses, VLANs, capabilities.
Switch# show lldp neighbors detailTypical output:
Local Intf: Gig0/1Chassis id: 0cd9.96e8.8a00Port id: Gig0/1Port Description: Connection to SW_CoreSystem Name: SW1System Description: Cisco IOS Software, Version 12.2(25r)
System Capabilities: BEnabled Capabilities: BManagement Addresses: IP: 10.30.0.4Auto Negotiation - supported, enabledPhysical media capabilities: 1000baseT(FD) 100base-TX(FD) 100base-TX(HD) 10base-T(FD) 10base-T(HD)Media Attachment Unit type: 30Vlan ID: 1
Total entries displayed: 1View LLDP Information for Specific Interface
Section titled “View LLDP Information for Specific Interface”Switch# show lldp neighbors GigabitEthernet0/1Or for detailed info:
Switch# show lldp neighbors GigabitEthernet0/1 detailView LLDP Statistics
Section titled “View LLDP Statistics”Shows LLDP packets transmitted/received and errors.
Switch# show lldp trafficTypical output:
LLDP traffic statistics: Total frames out: 3847 Total entries aged: 0 Total frames in: 3842 Total frames received in error: 0 Total frames discarded: 0 Total TLVs discarded: 0 Total TLVs unrecognized: 0View LLDP Configuration
Section titled “View LLDP Configuration”Shows global LLDP settings (timers, hold-time, etc.).
Switch# show lldpTypical output:
Global LLDP Information: Status: ACTIVE LLDP advertisements are sent every 30 seconds LLDP hold time advertised is 120 seconds LLDP interface reinitialisation delay is 2 secondsConfigure LLDP Timers
Section titled “Configure LLDP Timers”Change advertisement interval (default 30 seconds):
Switch(config)# lldp timer 60Change hold-time (how long neighbor info is kept, default 120 seconds):
Switch(config)# lldp holdtime 180Change reinitialization delay (default 2 seconds):
Switch(config)# lldp reinit 5LLDP vs CDP
Section titled “LLDP vs CDP”| Feature | LLDP | CDP |
|---|---|---|
| Standard | IEEE 802.1AB (industry standard) | Cisco proprietary |
| Vendor support | Multi-vendor | Cisco only |
| Default state | Often disabled | Enabled on Cisco devices |
| Commands | show lldp | show cdp |
Enable both for maximum compatibility:
Switch(config)# lldp runSwitch(config)# cdp runPractical Use Case: Network Documentation
Section titled “Practical Use Case: Network Documentation”Step 1: Connect to device via SSH
laptop> ssh admin@10.30.0.2Password: WELkom@1
SW_Core>Step 2: Enter privileged mode
SW_Core> enablePassword: WELkom@1SW_Core#Step 3: View all neighbors
SW_Core# show lldp neighbors
Device ID Local Intf Hold-time Capability Port IDSW3 Gig0/1 120 B Gig0/1SW2 Gig1/1 120 B Gig0/1SW1 Gig2/1 120 B Gig0/1Main_L3 Gig3/1 120 R Gig1/0/2Step 4: Get detailed info for specific connection
SW_Core# show lldp neighbors Gig0/1 detail
Local Intf: Gig0/1System Name: SW3Management Addresses: IP: 10.30.0.6Port id: Gig0/1Step 5: Verify interface is trunk or access
LLDP doesn’t show trunk/access mode - use this command:
SW_Core# show interfaces Gig0/1 switchport
Name: Gig0/1Switchport: EnabledAdministrative Mode: trunkOperational Mode: trunkAdministrative Trunking Encapsulation: dot1qOperational Trunking Encapsulation: dot1qNegotiation of Trunking: OnAccess Mode VLAN: 1 (default)Trunking Native Mode VLAN: 1 (default)Administrative Native VLAN tagging: enabledVoice VLAN: noneTrunking VLANs Enabled: 20,21,22,23,30Pruning VLANs Enabled: 2-1001Verify LLDP Status on Interface
Section titled “Verify LLDP Status on Interface”Check if LLDP is enabled on specific interface.
Switch# show lldp interface GigabitEthernet0/1Typical output:
GigabitEthernet0/1: Tx: enabled Rx: enabled Tx state: IDLE Rx state: WAIT FOR FRAMECommon LLDP Troubleshooting
Section titled “Common LLDP Troubleshooting”Neighbor not appearing?
- Verify LLDP is enabled globally:
show lldp - Check interface LLDP status:
show lldp interface - Ensure neighbor device has LLDP enabled
- Check physical connectivity
Clear LLDP table (force rediscovery):
Switch# clear lldp tableComplete Network Discovery Workflow
Section titled “Complete Network Discovery Workflow”Inventory all devices in network:
- Connect laptop to management VLAN (VLAN 30)
- SSH to core switch
- Run
show lldp neighborsto see connected devices - For each neighbor, SSH to that device
- Run
show lldp neighborson neighbor - Verify trunk/access with
show interfaces trunkorshow interfaces [interface] switchport - Document in table: Device, IP, Interface, Connected Device, Connected Interface, Trunk/Access
- Repeat for all devices
Example documentation table:
| Device | IP Address | Interface | Connected To | Remote Interface | Mode |
|---|---|---|---|---|---|
| SW_Core | 10.30.0.2 | Gig0/1 | SW3 | Gig0/1 | Trunk |
| SW_Core | 10.30.0.2 | Gig1/1 | SW2 | Gig0/1 | Trunk |
| SW_Core | 10.30.0.2 | Gig2/1 | SW1 | Gig0/1 | Trunk |
| SW_Core | 10.30.0.2 | Gig3/1 | Main_L3 | Gig1/0/2 | Trunk |