Discover Devices Using CDP (37.2.11)
Consider the lack of documentation in the topology shown in Figure 37-20. The network administrator only knows that R1 is connected to another device.
Figure 37-20 R1 Topology Before Discovery
With CDP enabled on the network, the show cdp neighbors command can be used to determine the network layout, as shown in Example 37-1.
Example 37-1 Discover Connected CDP Neighbors for R1
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,
D – Remote, C – CVTA, M – Two-port Mac Relay
Device ID Local Intrfce Holdtme Capability Platform Port ID
S1 Gig 0/0/1 179 S I WS-C3560- Fas 0/5
R1#
No information is available regarding the rest of the network. The show cdp neighbors command provides helpful information about each CDP neighbor device, including the following:
- Device identifiers—This is the host name of the neighbor device (S1).
- Port identifier—This is the name of the local and remote port (G0/0/1 and F0/5, respectively).
- Capabilities list—This shows whether the device is a router or a switch (S for switch; I for IGMP is beyond scope for this course)
- Platform—This is the hardware platform of the device (WS-C3560 for Cisco 3560 switch).
The output shows that there is another Cisco device, S1, connected to the G0/0/1 interface on R1. Furthermore, S1 is connected through its F0/5, as shown in Figure 37-21.
Figure 37-21 Topology from S1
The network administrator uses show cdp neighbors detail to discover the IP address for S1. As displayed in Example 37-2, the address for S1 is 192.168.1.2.
Example 37-2 Discover Detailed Information About S1
R1#
show cdp neighbors detail
Device ID: S1
Entry address(es):
IP address: 192.168.1.2
Platform: cisco WS-C3560-24TS, Capabilities: Switch IGMP
Interface: GigabitEthernet0/0/1, Port ID (outgoing port): FastEthernet0/5
Holdtime : 136 sec
Version :
Cisco IOS Software, C3560 Software (C3560-LANBASEK9-M), Version 15.0(2)SE7, R
RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2014 by Cisco Systems, Inc.
Compiled Thu 23-Oct-14 14:49 by prod_rel_team
advertisement version: 2
Protocol Hello: OUI=0x00000C, Protocol ID=0x0112; payload len=27,
value=00000000FFFFFFFF010221FF000000000000002291210380FF0000
VTP Management Domain: ”
Native VLAN: 1
Duplex: full
Management address(es):
IP address: 192.168.1.2
Total cdp entries displayed : 1
R1#
By accessing S1 either remotely through SSH or physically through the console port, the network administrator can determine what other devices are connected to S1, as displayed in the output of the show cdp neighbors command in Example 37-3.
Example 37-3 Discover Connected CDP Neighbors for S1
S1#
show cdp neighbors
Capability Codes: R – Router, T – Trans Bridge, B – Source Route Bridge
S – Switch, H – Host, I – IGMP, r – Repeater, P – Phone,
D – Remote, C – CVTA, M – Two-port Mac Relay
Device ID Local Intrfce Holdtme Capability Platform Port ID
S2 Fas 0/1 150 S I WS-C2960- Fas 0/1
R1 Fas 0/5 179 R S I ISR4331/K Gig 0/0/1
S1#
Another switch, S2, is revealed in the output. S2 is using F0/1 to connect to the F0/1 interface on S1, as shown in Figure 37-22.
Figure 37-22 Topology from S2
Again, the network administrator can use show cdp neighbors detail to discover the IP address for S2, and then remotely access it. After a successful login, the network administrator uses the show cdp neighbors command to discover if there are more devices, as shown in Example 37-4.
Example 37-4 Discover Connected CDP Neighbors for S2
S2#
show cdp neighbors
Capability Codes: R – Router, T – Trans Bridge, B – Source Route Bridge
S – Switch, H – Host, I – IGMP, r – Repeater, P – Phone,
D – Remote, C – CVTA, M – Two-port Mac Relay
Device ID Local Intrfce Holdtme Capability Platform Port ID
S1 Fas 0/1 141 S I WS-C3560- Fas 0/1
S2#
The only device connected to S2 is S1. Therefore, there are no more devices to discover in the topology. The network administrator can now update the documentation to reflect the discovered devices.