Layer 2 Discovery
Cheat sheet · https://pcornel.dk/topic.php?topic=595
Answer
Layer 2 discovery protocols let directly connected devices announce themselves: CDP (Cisco) and LLDP (IEEE 802.1AB) send the device name, port, platform, addresses and capabilities to the neighbour on each link.
Remember
They only see direct neighbours. CDP is on by default on Cisco devices; LLDP must often be enabled with lldp run. Turn them off on ports towards untrusted networks, since they disclose platform and software details.
First checks
show cdp neighbors— neighbour device, local port, remote port, platform.show cdp neighbors <if> detail— addresses, software version, native VLAN, duplex.show lldp neighbors— the same for LLDP neighbours.show lldp neighbors <if> detail— system name, port description, management address, capabilities.show cdp interface/show lldp interface— where the protocols run.
Commands
show cdp neighbors- Summary
show lldp neighbors- Summary
show cdp neighbors detail- Detail
show lldp neighbors detail- Detail
show cdp- Global protocol
show lldp- Global protocol
show cdp interface- Interface protocol
show lldp interface- Interface protocol
show cdp neighbors <int>show lldp neighbors <int>
Verify in this order
protocol enabled on both ends → advertisements sent on the link → neighbour entry created → device name and remote port match the design
Where it usually breaks
physical/link dependency → local object state → peer/control state → policy → forwarding/adjacency → end-to-end result
CDP vs LLDP
| Property | CDP | LLDP |
|---|---|---|
| Standard | Cisco proprietary | IEEE 802.1AB |
| Scope | directly connected link | directly connected link |
| Typical use | Cisco-centric topology discovery | vendor-neutral topology discovery |
| Global enable | cdp run | lldp run |
| Summary | show cdp neighbors | show lldp neighbors |
| Detail | show cdp neighbors detail | show lldp neighbors detail |
| Proves | advertisement received from direct peer | advertisement received from direct peer |
| Does not prove | VLAN/IP/end-to-end forwarding | VLAN/IP/end-to-end forwarding |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=595