Check a site's cabling documentation against CDP and LLDP
Task
You are handed a small site's documentation and asked whether it is still right. Using only CDP and LLDP output on S1, check each documented link port by port, find the one link whose far end is documented wrongly, and record each neighbour's model and management address from the detail output. Then turn LLDP on, see what it adds, watch a CDP entry age out after CDP is turned off on one interface, and read a native VLAN mismatch message correctly: the first interface named is local, the one after with is the neighbour's.
Topology
Devices
| Device | Model | Role |
|---|---|---|
| R1 | ISR4331 | site router |
| S1 | 2960-24TT | core access switch, where you run the checks |
| S2 | 2960-24TT | second-floor switch |
| PC1 | PC-PT | second-floor PC |
Links
| From | To |
|---|---|
| R1 G0/0/1 | S1 Gi0/1 |
| S1 Fa0/24 | S2 Fa0/23 |
| PC1 Fa0 | S2 Fa0/1 |
Addressing
| Device | Interface | Address | Default gateway |
|---|---|---|---|
| R1 | G0/0/1 | 192.168.1.1/24 | none |
| S1 | Vlan1 (management) | 192.168.1.2/24 | 192.168.1.1 |
| S2 | Vlan1 (management) | 192.168.1.3/24 | 192.168.1.1 |
| PC1 | NIC | 192.168.1.10/24 | 192.168.1.1 |
Steps
- Cable the devices exactly as the Links table lists: Copper Cross-Over between S1 and S2, Copper Straight-Through for the rest. When a router first boots, Packet Tracer asks
Would you like to enter the initial configuration dialog? [yes/no]:. Answernoand press Enter to reach theRouter>prompt. Then copy this documentation into your notes, with an empty column for what you find: S1 Gi0/1 goes to R1 G0/0/1; S1 Fa0/24 goes to S2 Fa0/24; PC1 sits on S2 Fa0/1; R1 is an ISR4331 at 192.168.1.1. Someone moved one cable during an outage and never updated the drawing. - Configure R1, S1 and S2. The S1-S2 link is a static trunk at both ends; the management SVIs give each switch an address that CDP will advertise.
Router> enable
Router# configure terminal
Router(config)# hostname R1
R1(config)# interface GigabitEthernet0/0/1
R1(config-if)# ip address 192.168.1.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# end
Switch> enable
Switch# configure terminal
Switch(config)# hostname S1
S1(config)# interface FastEthernet0/24
S1(config-if)# switchport mode trunk
S1(config-if)# exit
S1(config)# interface Vlan1
S1(config-if)# ip address 192.168.1.2 255.255.255.0
S1(config-if)# no shutdown
S1(config-if)# exit
S1(config)# ip default-gateway 192.168.1.1
S1(config)# end
Switch> enable
Switch# configure terminal
Switch(config)# hostname S2
S2(config)# interface FastEthernet0/23
S2(config-if)# switchport mode trunk
S2(config-if)# exit
S2(config)# interface Vlan1
S2(config-if)# ip address 192.168.1.3 255.255.255.0
S2(config-if)# no shutdown
S2(config-if)# exit
S2(config)# ip default-gateway 192.168.1.1
S2(config)# end
Give PC1 its address and gateway from the Addressing table, and from PC1 run ping 192.168.1.1 to prove the path works before you start checking it. 3. Read the neighbour table on S1. CDP is on by default, so nothing needs enabling:
S1# show cdp neighbors
Check each row against the documentation, one link at a time. Local Intrfce is S1's own port; Port ID is the neighbour's port. R1 should appear on local Gig 0/1 with Port ID Gig 0/0/1 and capability R: that link matches. S2 appears on local Fas 0/24, which matches, but with Port ID Fas 0/23, not Fa0/24: the S2 end of that link is documented wrongly, and S1's end is right. PC1 does not appear at all, because CDP lists only directly connected neighbours and a PC sends none. 4. Get the detail the plain table leaves out:
S1# show cdp neighbors detail
S1# show cdp
From the detail output, record R1's entry address 192.168.1.1, its Platform field and its software version, and S2's address 192.168.1.3. Compare R1's Platform with the documented ISR4331. From show cdp, note the timers: advertisements every 60 seconds and a holdtime of 180 seconds. Run show cdp neighbors a few times and watch the Holdtme column count down from 180 and jump back as each update arrives. 5. Now try LLDP. Run show lldp neighbors on S1 first: LLDP is off globally until you turn it on, so it reports that LLDP is not enabled or lists nothing. Turn it on at both switches:
S1# configure terminal
S1(config)# lldp run
S1(config)# end
S2# configure terminal
S2(config)# lldp run
S2(config)# end
Wait at least 30 seconds, LLDP's send interval, then run show lldp neighbors on S1. S2 appears on local Fa0/24 with Port ID Fa0/23, agreeing with CDP, and its capability is B: LLDP reports a switch as a MAC bridge, because IEEE 802.1AB has no separate switch code. R1 is missing from the LLDP table because LLDP is not running on R1; the two protocols are independent. 6. Break CDP on one link. On R1, stop CDP on the interface that faces S1, leaving it running on the rest of the router:
R1# configure terminal
R1(config)# interface GigabitEthernet0/0/1
R1(config-if)# no cdp enable
R1(config-if)# end
On S1, run show cdp neighbors every 30 seconds (Packet Tracer's Fast Forward Time button at the bottom speeds this up). R1's Holdtme now only falls: a value well below 120 means updates have stopped arriving, and after about 180 seconds the R1 row disappears. Restore it with cdp enable on R1's GigabitEthernet0/0/1 and confirm R1 returns within about a minute. 7. Break the trunk's native VLAN at one end and read the message CDP raises:
S2# configure terminal
S2(config)# vlan 99
S2(config-vlan)# exit
S2(config)# interface FastEthernet0/23
S2(config-if)# switchport trunk native vlan 99
S2(config-if)# end
Within a minute, S1's console shows a line that starts %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on FastEthernet0/24 (1), with S2 FastEthernet0/23 (99). Read it the lesson 10 way: S1's own Fa0/24 uses native VLAN 1, and the neighbour S2's Fa0/23 uses 99. Confirm with show interfaces trunk on both switches, then put S2 back on native VLAN 1, because this site's design uses the default:
S2# configure terminal
S2(config)# interface FastEthernet0/23
S2(config-if)# switchport trunk native vlan 1
S2(config-if)# end
- Correct the documentation in your notes: S1 Fa0/24 goes to S2 Fa0/23, and add each device's management address and the platform each one reported. Write one line on which protocol you would rely on for a link to another vendor's switch, and why.
Verify
S1# show cdp neighbors
Expected output: a row for R1 with local interface Gig 0/1 and Port ID Gig 0/0/1, and a row for S2 with local interface Fas 0/24 and Port ID Fas 0/23.
S1# show cdp neighbors detail
Expected output: R1's entry lists the IP address 192.168.1.1, and S2's entry lists 192.168.1.3.
S1# show lldp neighbors
Expected output: one row, Device ID S2, local interface Fa0/24, capability B, Port ID Fa0/23.
S2# show interfaces trunk
Expected output: Fa0/23 shows trunking with native vlan 1, the same as S1's Fa0/24.
Save your work
Save the topology as ccna-lab10-cdp-lldp.pkt (File > Save As).
Notes
Packet Tracer abbreviates ports differently in CDP and LLDP output (Fas 0/24 in one, Fa0/24 in the other); both name the same port. The exact Platform string Packet Tracer reports for its ISR4331 varies by release, which is why you record it rather than compare it with a fixed value.
This is an independent study companion for the Cisco CCNA 200-301 v2.0 exam and is not produced by or endorsed by Cisco. Cisco, CCNA and IOS are trademarks of Cisco Systems, Inc.
This is an independent study companion for Cisco CCNA 200-301 and is not produced by or endorsed by CompTIA.