// Lesson 23 of 49 · Switching and VLANs
CDP and LLDP
CDP (Cisco Discovery Protocol) and LLDP (Link Layer Discovery Protocol, IEEE 802.1AB) let a device announce itself to its directly connected neighbours. They are the fastest way to answer "what is plugged into this port?".
| CDP | LLDP | |
|---|---|---|
| Standard | Cisco proprietary | Open standard |
| Default on Cisco IOS | Enabled | Usually disabled |
| Advertisement interval | 60 s | 30 s |
| Hold time | 180 s | 120 s |
Both work at Layer 2: they need no IP addressing and do not cross routers.
Use them
SW1# show cdp neighbors
Device ID Local Intrfce Holdtme Capability Platform Port ID
R1 Gig 1/0/24 143 R B S I ISR4331 Gig 0/0/0
SW2 Gig 1/0/23 152 S I C9200L Gig 1/0/23
SW1# show cdp neighbors detail ! includes the neighbour's IP and IOS version
LLDP:
SW1(config)# lldp run
SW1# show lldp neighbors
SW1# show lldp neighbors detail
Control them
SW1(config)# no cdp run ! disable CDP globally
SW1(config)# interface GigabitEthernet1/0/1
SW1(config-if)# no cdp enable ! disable on one port
SW1(config-if)# no lldp transmit
SW1(config-if)# no lldp receive
Discovery protocols reveal model, software version and addresses — useful to attackers. A common policy is to disable them on ports facing users, guests or the internet and keep them on links between your own infrastructure. IP phones and APs often rely on them (for the voice VLAN or PoE negotiation), so test before disabling.
Key points
- CDP (Cisco, on by default) and LLDP (standard, enable with
lldp run). - They show only directly connected neighbours.
show cdp neighbors detailreveals the neighbour's IP address.- Disable them on untrusted edge ports.
Sign in to save your lesson progress across devices. You can read every published lesson without an account.