Device Discovery with LLDP
Summary
This topic use LLDP to map a network topology. Start learning CCNA 200-301 for free right now!!
Table of Contents
LLDP Overview
The Link Layer Discovery Protocol (LLDP) does the same thing as CDP, but it is not specific to Cisco devices. As a bonus, you can still use it if you have Cisco devices. One way or another, you will get your network map.
LLDP is a vendor-neutral neighbor discovery protocol similar to CDP. LLDP works with network devices, such as routers, switches, and wireless LAN access points. This protocol advertises its identity and capabilities to other devices and receives the information from a physically-connected Layer 2 device.
Configure and Verify LLDP
Depending on the device, LLDP may be enabled by default. To enable LLDP globally on a Cisco network device, enter the lldp run command in the global configuration mode. To disable LLDP, enter the no lldp run command in the global configuration mode.
Similar to CDP, LLDP can be configured on specific interfaces. However, LLDP must be configured separately to transmit and receive LLDP packets.
To verify LLDP has been enabled on the device, enter the show lldp command in privileged EXEC mode.
Switch# conf t Enter configuration commands, one per line. End with CNTL/Z. Switch(config)# lldp run Switch(config)# interface gigabitethernet 0/1 Switch(config-if)# lldp transmit Switch(config-if)# lldp receive Switch(config-if)# end Switch# show lldp 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 seconds
Discover Devices by Using LLDP
Consider the lack of documentation in the topology shown in the figure. The network administrator only knows that S1 is connected to two devices.
With LLDP enabled, device neighbors can be discovered by using the show lldp neighbors command, as displayed in the output.
S1# show lldp neighbors 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 ID R1 Fa0/5 117 R Gi0/0/1 S2 Fa0/1 112 B Fa0/1 Total entries displayed: 2
The network administrator discovers that S1 has a router and a switch as a neighbors. For this output, the letter B for bridge also means switch.
From the results of show lldp neighbors, a topology from S1 can be constructed, as displayed in the figure.
When more details about the neighbors are needed, the show lldp neighbors detail command can provide information, such as the neighbor IOS version, IP address, and device capability.
S1# show lldp neighbors detail ------------------------------------------------ Chassis id: 848a.8d44.49b0 Port id: Gi0/0/1 Port Description: GigabitEthernet0/0/1 System Name: R1 System Description: Cisco IOS Software [Fuji], ISR Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 16.9.4, RELEASE SOFTWARE (fc2) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2019 by Cisco Systems, Inc. Compiled Thu 22-Aug-19 18:09 by mcpre Time remaining: 111 seconds System Capabilities: B,R Enabled Capabilities: R Management Addresses - not advertised Auto Negotiation - not supported Physical media capabilities - not advertised Media Attachment Unit type - not advertised Vlan ID: - not advertised ------------------------------------------------ Chassis id: 0025.83e6.4b00 Port id: Fa0/1 Port Description: FastEthernet0/1 System Name: S2 System Description: Cisco IOS Software, C2960 Software (C2960-LANBASEK9-M), Version 15.0(2)SE4, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2013 by Cisco Systems, Inc. Compiled Wed 26-Jun-13 02:49 by prod_rel_team Time remaining: 107 seconds System Capabilities: B Enabled Capabilities: B Management Addresses - not advertised Auto Negotiation - supported, enabled Physical media capabilities: 100base-TX(FD) 100base-TX(HD) 10base-T(FD) 10base-T(HD) Media Attachment Unit type: 16 Vlan ID: 1 Total entries displayed: 2
Syntax Checker – Configure and Verify LLDP
Practice configuring and verifying LLDP.
Complete the following steps to configure LLDP on R1:
- Enter global configuration mode and enable LLDP globally.
- Enter interface configuration mode for g0/0/0. Use g0/0/0 as the interface designation.
- Disable the sending of LLDP messages on the interface.
- Disable the receiving of LLDP messages on the interface.
- Use the end command to return to global configuration mode.
R1#configure terminal R1(config)#lldp run R1(config)#interface g0/0/0 R1(config-if)#no lldp transmit R1(config-if)#no lldp receive R1(config-if)#end *Oct 2 16:19:16.167: %SYS-5-CONFIG_I: Configured from console by console
You are now logged into S1. Display the list of LLDP neighbors.
S1#show lldp neighbors 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 ID R1 Fa0/5 115 R Gi0/0/1 Total entries displayed: 1
Display more details from the list of LLDP neighbors on S1.
S1#show lldp neighbors detail ------------------------------------------------ Chassis id: 848a.8d44.49b0 Port id: Gi0/0/1 Port Description: GigabitEthernet0/0/1 System Name: R1 System Description: Cisco IOS Software [Fuji], ISR Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 16.9.4, RELEASE SOFTWARE (fc2) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2019 by Cisco Systems, Inc. Compiled Thu 22-Aug-19 18:09 by mcpre Time remaining: 114 seconds System Capabilities: B,R Enabled Capabilities: R Management Addresses - not advertised Auto Negotiation - not supported Physical media capabilities - not advertised Media Attachment Unit type - not advertised Vlan ID: - not advertised Total entries displayed: 1
You have successfully configured and verified LLDP on the router.
Packet Tracer – Use LLDP to Map a Network
In this Packet Tracer activity, you will complete the following objectives:
- Build the Network and Configure Basic Device Settings
- Network Discovery with CDP
- Network Discovery with LLDP
Ready to go! Keep visiting our networking course blog, give Like to our fanpage; and you will find more tools and concepts that will make you a networking professional.