When working on a network with limited access to documentation you can easily discovery neighboring Cisco devices using CDP. This lab will discuss and demonstrate the functions of Cisco Discovery Protocol (CDP).
Cisco Discovery Protocol is used every single day by network engineers world wide to document and understand physical network topologies with no documentation at all. CDP operates at Layer 2 of the OSI model and exchanges device information between MOST Cisco devices such as IP address(es), physical link connectivity, port identifiers, IOS version of neighboring devices, device capabilities, native VLAN, duplex and VTP management domain.
In this lab you will familiarize yourself with the following commands;
Command | Description |
---|---|
show cdp | Shows CDP hello timer, holdtime and current CDP version running being advertised. |
show cdp neighbors | Shows directly connect Cisco device information including hostname, local and remote port(s), Device capabilities and platform. |
show cdp neighbors detail | Shows detailed information about directly connected Cisco devices such as IOS Version, VTP management domain, native VLAN and duplex. |
clear cdp table | Clears the devices CDP table on the local device and relearns all directly connected Cisco devices by inspecting received CDP frames on local interfaces. |
cdp timer <10-45> | Manually sets the CDP advertisement timer (hello timer) to the specified time in seconds. This command is configured in global configuration mode. |
cdp holdtime <10-45> | Manually sets the CDP holdtime (dead timer) timer to the specified time in seconds. This command is configured in global configuration mode. |
Step 1. – Using only R1, determine which IOS feature set and version is running on SW1. To determine this information you will execute the show cdp neighbor detail command in user or privileged mode on R1 as shown below.
R1>show cdp neighbors detail
-------------------------
Device ID: Router
Entry address(es):
Platform: Cisco 3640, Capabilities: Router Switch IGMP
Interface: FastEthernet0/0, Port ID (outgoing port): FastEthernet0/1
Holdtime : 134 sec
Version :
Cisco IOS Software, 3600 Software (C3640-JK9O3S-M), Version 12.4(13a),
RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2007 by Cisco Systems, Inc.
Compiled Tue 06-Mar-07 20:25 by prod_rel_team
advertisement version: 2
VTP Management Domain: ''
Duplex: full
R1>
As shown above by the underlined statements; SW1 is running ENTERPRISE/FW/IDS PLUS IPSEC 3DES Version 12.4(13a).
Step 2. – Using only SW1, determine the IP address of R1 learned via CDP. To obtain this information you will use the show cdp neighbors detail command on SW1 in either user or privileged mode as shown below;
SW1#show cdp neighbors detail
-------------------------
Device ID: R1
Entry address(es):
IP address: 192.168.255.1
Platform: Cisco 3725, Capabilities: Router Switch IGMP
Interface: FastEthernet0/1, Port ID (outgoing port): FastEthernet0/0
Holdtime : 168 sec
Version :
Cisco IOS Software, 3700 Software (C3725-ADVENTERPRISEK9-M), Version
12.4(15)T14, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2010 by Cisco Systems, Inc.
Compiled Tue 17-Aug-10 12:08 by prod_rel_team
advertisement version: 2
VTP Management Domain: ''
Duplex: full
SW1#
As shown above by the underlined statements; R1 has the IP address 192.168.255.1 assigned to the interface which the CDP frame was sent out.
Step 3. – Using only R1, determine the port R1 is connected to on SW1. To obtain this information you can use either the show cdp neighbors or show cdp neighbors detail command.
R1#show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater
Device ID Local Intrfce Holdtme Capability Platform Port ID
SW1 Fas 0/0 125 R S I 3640 Fas 0/1
R1#
As shown above by the underlined statements; R1 FastEthernet0/0 interface is connected to SW1’s FastEthernet0/1 port.
Step 4. – Using only R1, determine what the Native VLAN and VTP Domain is on the switchport that R1 is directly connected to. This information is obtained by using the show cdp neighbors detail command as shown below;
R1>show cdp neighbors detail
-------------------------
Device ID: SW1
Entry address(es):
IP address: 192.168.255.254
Platform: Cisco 3640, Capabilities: Router Switch IGMP
Interface: FastEthernet0/0, Port ID (outgoing port): FastEthernet0/1
Holdtime : 157 sec
Version :
Cisco IOS Software, 3600 Software (C3640-JK9O3S-M), Version 12.4(13a),
RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2007 by Cisco Systems, Inc.
Compiled Tue 06-Mar-07 20:25 by prod_rel_team
advertisement version: 2
VTP Management Domain: ''
Duplex: full
R1>
As shown above by the underlined statements; the VTP Domain is blank. This is called “NULL” which simply means that no VTP domain has been configured on the switch that advertised that CDP Frame. The native VLAN number on the switch’s port that R1 is directly connected to is VLAN 1.
Step 5. – Clear the CDP table on R1 and verify that it has been cleared; afterwards verify that R1 relearns about SW1. To clear the CDP table, use the clear cdp table command in privileged mode as shown below followed by the verification;
R1#show cdp neighbors Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge S - Switch, H - Host, I - IGMP, r - Repeater Device ID Local Intrfce Holdtme Capability Platform Port ID SW1 Fas 0/0 173 R S I 2650XM Fas 1/0 R1#clear cdp table R1#show cdp neighbors Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge S - Switch, H - Host, I - IGMP, r - Repeater Device ID Local Intrfce Holdtme Capability Platform Port ID R1#
Step 6. – Change the default timers on both R1 and SW1 from 60/180 to 15/45 and verify your configuration changes. To make these changes you will use the cdp timer and cdp holdtime commands in global configuration. To verify the changes made use the show cdp command in user or privileged mode as shown below;
R1>enable R1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R1(config)#cdp timer 15 R1(config)#cdp holdtime 45 R1(config)#end %SYS-5-CONFIG_I: Configured from console by console R1#show cdp Global CDP information: Sending CDP packets every 15 seconds Sending a holdtime value of 45 seconds Sending CDPv2 advertisements is enabled R1#