Network Topology Mapping with CDP and LLDP

Overview

This lab simulates the use of Cisco Discovery Protocol (CDP) and Link Layer Discovery Protocol (LLDP) to map and document a network topology consisting of routers, switches, and PCs. The exercise begins with leveraging CDP to discover directly connected Cisco devices and their interfaces, enabling the creation of accurate interface and IP address labels for a multi-device network. It progresses to disabling CDP on end-user ports and enabling LLDP across all inter-network device connections to support future multi-vendor environments. Key tasks include interpreting CDP neighbor tables, identifying active connections using interface status commands, applying no cdp enable on access ports, and configuring lldp transmit and lldp receive on appropriate interfaces. The lab emphasizes practical discovery techniques, highlights differences between CDP and LLDP, and concludes with simulation mode validation using LLDP, STP, and EIGRP message exchanges.

Skills Demonstrated
Using CDP to discover directly connected Cisco devices
Mapping network topologies by analyzing CDP neighbor and interface status
Identifying and labeling interfaces using CLI commands
Disabling CDP selectively on end-device interfaces
Enabling LLDP globally and per-interface on Cisco devices
Understanding LLDP’s role in multi-vendor environments
Practicing interface-based discovery with LLDP show commands
Configuring transmit and receive settings for LLDP interfaces
Interpreting MAC address tables and interface states
Tools Used
Cisco Packet Tracer
Router CLI
Switch CLI
CDP Show Commands
LLDP Configuration Commands
IPCONFIG Command
Interface Status Command

1. Network Topology

For this lab, the topology consists of three LAN segments interconnected by three routers (R1, R2, and R3).

The goal of this lab will be to:

  • Use CDP to identify and label the missing IP addresses and interface IDs of the devices in the network
  • Disable CDP on the switch interfaces connected to PCs
  • Disable CDP globally on each network device and enable LLDP and the Tx/Rx on the interfaces

2. Using CDP and LLDP to Identify and Label Missing IP Addresses and Interface IDs

First I'm going to start with the LAN connected to R1.

I run /ipconfig on PC1 to get the IP address, subnet mask, and default gateway and get the following output:

C:\>ipconfig

FastEthernet0 Connection:(default port)

   Connection-specific DNS Suffix..:
   Link-local IPv6 Address.........: FE80::201:63FF:FE8A:B6E0
   IPv6 Address....................: ::
   IPv4 Address....................: 192.168.1.1
   Subnet Mask.....................: 255.255.255.0
   Default Gateway.................: ::
                                     192.168.1.254

Now, on SW1, I run the following commands for show cdp neighbors:

SW1> en
SW1# show cdp neighbors

I get the following output:

SW1#show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
Device ID    Local Intrfce   Holdtme    Capability   Platform    Port ID
R1           Gig 0/1          168            R       C2900       Gig 0/2

Now, on R1, I run the same show cdp neighbors command and get the following output:

R1#show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
Device ID    Local Intrfce   Holdtme    Capability   Platform    Port ID
R2           Gig 0/1          122            R       C2900       Gig 0/0
SW1          Gig 0/2          122            S       2960        Gig 0/1
R3           Gig 0/0          122            R       C2900       Gig 0/1

Having all the information needed, I can now determine the IP addresses and interface IDs of the network connected to R1, including R1:

I repeat the same ipconfig command on PC2 and PC3 and the show cdp neighbors on SW2, R2, SW3, and R3 in order to get the IP addresses and interface IDs of the other two LANs:


3. Disable CDP on Switch Interfaces Connected to PCs

Now I'm going to disable CDP on the switch interfaces connected to the PCs.

I run the following command on SW1:

SW1> en
SW1# conf t
SW1(config)# int f0/10
SW1(config-if)# no cdp enable

I run the following command on SW2:

SW2> en
SW2# conf t
SW2(config)# int f0/24
SW2(config-if)# no cdp enable
```s

I run the following command on SW3:

```bash
SW3> en
SW3# conf t
SW3(config)# int f0/1
SW3(config-if)# no cdp enable

4. Disable CDP Globally and Enable LLDP Globally and enable Tx/Rx

Lastly, I'm going to disable CDP and enable LLDP

I run the following commands on SW1:

SW1> en
SW1# conf t
SW1(config)# no cdp run
SW1(config)# lldp run
SW1(config)# int g0/1
SW1(configif)# lldp transmit
SW1(configif)# lldp receive

Then I run the following commands on R1:

R1> en
R1# conf t
R1(config)# no cdp run
R1(config)# lldp run
R1(config)# int range g0/0 - 2
R1(config-if-range)# lldp transmit
R1(config-if-range)# lldp receive

I run the same commands on SW2, R2, SW3, and R3.

Now that LLDP is enabled across the network, when I run show lldp neighbors on R1 we can see that the hold-time has changed to 120 seconds which is LLDP's holdtime and it shows its neighbors:

R1#show lldp neigh
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
R3                  Gig0/0         120        R               Gig0/1
SW1                 Gig0/2         120        B               Gig0/1
R2                  Gig0/1         120        R               Gig0/0

Total entries displayed: 3

The entire network has now been configured for LLDP.