You're connected to a switch port, but what's actually at the other end? Neighbour discovery protocols allow network devices to advertise useful information to directly connected neighbours — making them extremely handy for understanding and troubleshooting a network.
Network devices often need a quick way to discover what is directly connected to them.
Neighbour discovery protocols advertise information such as:
CDP stands for Cisco Discovery Protocol.
It is Cisco's proprietary Layer 2 neighbour discovery protocol and is commonly supported on Cisco network equipment.
Because discovery operates between directly connected devices, useful neighbour information can often be obtained even when Layer 3 addressing is incomplete or misconfigured.
LLDP stands for Link Layer Discovery Protocol.
Unlike Cisco-proprietary CDP, LLDP is defined by the IEEE 802.1AB standard and is designed for multi-vendor environments.
Cisco proprietary protocol commonly used between Cisco devices.
IEEE standards-based protocol designed to work across equipment from different vendors.
The exact information available depends on the device and protocol, but neighbour advertisements can reveal useful details such as:
| Information | Why it helps |
|---|---|
| Device ID / system name | Identifies the neighbouring device |
| Local interface | Shows which of your ports reaches it |
| Remote port ID | Shows the neighbour's connected interface |
| Platform | Can identify the neighbouring hardware type |
| Capabilities | Indicates functions such as switching or routing |
| Management address | May provide an address useful for managing the neighbour |
One of the first commands worth remembering is:
SW1# show cdp neighbors
Device ID Local Intrfce Holdtme Capability Platform Port ID
SW2 Gig 0/1 143 S I C9200 Gig 0/24
R1 Gig 0/2 156 R S I ISR4331 Gig 0/0
From this output we can quickly see:
For more information:
SW1# show cdp neighbors detail
Device ID: SW2
Entry address(es):
IP address: 192.168.99.12
Platform: cisco C9200, Capabilities: Switch IGMP
Interface: GigabitEthernet0/1
Port ID (outgoing port): GigabitEthernet0/24
The detailed output may include information such as the neighbour's management IP address and software/platform details.
CDP can be controlled globally:
# Enable CDP globally
SW1(config)# cdp run
# Disable CDP globally
SW1(config)# no cdp run
Or on an individual interface:
SW1(config)# interface gigabitEthernet 0/1
# Enable CDP on this interface
SW1(config-if)# cdp enable
# Disable CDP on this interface
SW1(config-if)# no cdp enable
cdp run controls CDP globally, while
cdp enable controls it on an interface.
On Cisco IOS, LLDP can be enabled globally with:
SW1(config)# lldp run
Interfaces can independently control whether they transmit and receive LLDP advertisements:
SW1(config)# interface gigabitEthernet 0/1
SW1(config-if)# lldp transmit
SW1(config-if)# lldp receive
And either function can be disabled:
SW1(config-if)# no lldp transmit
SW1(config-if)# no lldp receive
The LLDP equivalent is:
SW1# show lldp neighbors
Capability codes:
R - Router, B - Bridge
Device ID Local Intf Hold-time Capability Port ID
SW2 Gi0/1 120 B Gi0/24
CORE-RTR Gi0/2 120 R Gi0/0
For additional information:
SW1# show lldp neighbors detail
| Feature | CDP | LLDP |
|---|---|---|
| Full name | Cisco Discovery Protocol | Link Layer Discovery Protocol |
| Type | Cisco proprietary | Open standard |
| Standard | Cisco | IEEE 802.1AB |
| Scope | Direct neighbours | Direct neighbours |
| Main verification | show cdp neighbors | show lldp neighbors |
| Detailed verification | show cdp neighbors detail | show lldp neighbors detail |
Imagine you've logged into a switch you've never seen before. Its interface descriptions are useless and there is no current network diagram.
You could start with:
SW1# show cdp neighbors
or:
SW1# show lldp neighbors
Within seconds you may be able to identify which ports connect to other switches, routers, access points, phones or other infrastructure.
Confirm CDP or LLDP is enabled globally on the device.
Check whether discovery has been disabled on the particular interface.
Check lldp transmit and lldp receive.
A non-Cisco neighbour may support LLDP but not Cisco CDP.
Neighbour discovery cannot fix a dead link. Verify interface and physical link status too.
CDP and LLDP describe directly connected devices, not arbitrary devices several network hops away.
Neighbour discovery is extremely useful for network administrators, but the information advertised can reveal details about network devices and topology.
For that reason, organisations may choose to disable discovery protocols on interfaces where advertisements are unnecessary or inappropriate.
show cdp neighbors provides a CDP neighbour summary.
show cdp neighbors detail provides additional information.
show lldp neighbors provides an LLDP neighbour summary.
# CDP verification
show cdp neighbors
show cdp neighbors detail
# CDP global control
cdp run
no cdp run
# CDP interface control
cdp enable
no cdp enable
# Enable LLDP globally
lldp run
# LLDP interface control
lldp transmit
lldp receive
no lldp transmit
no lldp receive
# LLDP verification
show lldp neighbors
show lldp neighbors detail
One Ethernet link between switches is useful. Several links can provide more bandwidth and resilience — but simply connecting them creates a Layer 2 problem. Next we'll learn how EtherChannel combines multiple physical links into one logical connection.