Search This Blog

Oct 1, 2010

Lab 4: CDP

Objective:   To understand how the Cisco Discovery Protocol functions and what it takes
for Cisco devices to be discovered.




Lab Equipment:   We will be using Router 1 & Router 4.  To select Router 1 click on the
click on the button Router1 at the top of your screen. 
1. On Router 1, enter global configuration mode 
Router>enable
Router#conf t
Router(config)# 

2. On Router 1, and change the hostname to R1
Router(config)#hostname R1 
R1(config)# 

3. Select Router 4 by clicking on the button Router4 at the top of your screen, and change
the hostname to R4 
Router>enable 
Router#conf t 
Router(config)#hostname R4
R4(config)#
Note:  By default, all interfaces are shutdown (disabled). 

4. Enable the Serial 0 interface on R1.
R1(config)#interface Serial 0 
R1(config-if)#no shutdown 

5. Now enable the Serial 0 interface on R4
R4(config)#interface Serial 0 
R4(config-if)#no shutdown 

6. Enable the Ethernet 0 interface on R1.
R1(config)#interface Ethernet 0 
R1(config-if)#no shutdown
CDP allows devices to share basic configuration information.  CDP will operate without
any protocol specific information configured.  CDP is enabled by default on all
interfaces. CDP is a Data link Protocol occurring at Layer 2 of the OSI model.   This is
important to understand because CDP is not routable.  It can only traverse to directly
connected devices.

7. On R1, type the command to give the status of all interfaces that are running CDP.
R1(config-if)#exit 
R1(config)#exit 
R1#show cdp interface
The sample output below shows that both interfaces are up and sending CDP packets.

Serial0 is up, line protocol is up
Encapsulation HDLC
Sending CDP packets every 60 seconds
Holdtime is 180 seconds 
<output omitted> 
R1# 
Now that the router has interfaces that are broadcasting and receiving CDP updates we
can use CDP to find out about directly connected neighbors. 

8. On R1, type the command to provide information about directly connected neighbors.
R1#show cdp neighbors
Below is some sample output
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater

Device ID     Local Interface      Holdtme      Capability      Platform      Port ID
R4                      Serial 0                148                  R                1700         Serial 0

R1#
The first device on the list for R1 is R4 via the Serial0 link.  R1 is receiving CDP updates
from R4, the updates tell R1 to hold on to the information for a specified amount of time.
 At the time this command was pressed there were 148 seconds left in the hold time for
R1's update.  If that time expires before receiving another update R1's information will be
removed from the table.  R4 is a 1000 series router; this is shown in the platform column.
 The final column, Port ID, is the port on the other device from which the updates are
being sent. 

9. On R1, type the command to provide more detailed information about directly
connected neighbors.
R1#show cdp neighbors detail
Below is some sample output
Device ID: R4
Entry address(es):
Platform: cisco 2501, Capabilities: Router
Interface: Serial0, Port ID (outgoing port): Serial0
Holdtime : 162 sec
Version :
Cisco Internetwork Operating System Software
Software, Version 12.0(16), RELEASE SOFTWARE (fc2)
Copyright (c) 1986-2001 by cisco Systems, Inc.
Compiled Fri 02-Mar-01 17:34 by dchih

This command shows devices one at a time. It is used to display Network Layer address
information. At this point there are no configured IP, IPX or AppleTalk addresses so this
field is blank. The command also displays IOS version information. Notice that the
devices are listed in order. If one wants to find out information about a device further
down the list, one would need to scroll down using the space bar.

10. On R1, type the command to provide information about the specific device "R4"
R1#show cdp entry R4
The below is sample output
Device ID: R4
Entry address(es):
Platform: cisco 1000, Capabilities: Router
Interface: Serial0, Port ID (outgoing port): Serial0
Holdtime : 148 sec
Version :
Cisco Internetwork Operating System Software
Software, Version 12.0(16), RELEASE SOFTWARE (fc2)
Copyright (c) 1986-2001 by cisco Systems, Inc.
Compiled Fri 02-Mar-01 17:34 by dchih
R1# 
This command gives the same information as the show cdp neighbor detail command, but
allows a single device to be specified.  Also notice that this is one of the only case-
sensitive commands that exist.

11. On R1, type the command to see how often CDP updates are being sent and how long
a recipient is to hold on to the update.
R1#show cdp
The below is sample output
Global CDP information:
Sending CDP packets every 60 seconds
Sending a holdtime value of 180 seconds  
Sending CDPv2 advertisements is enabled

12. On R1, type the command to adjust the amount of seconds between CDP updates to
45.
R1#conf t 
R1(config)#cdp timer 45 
 Besides the update interval, the holdtime value may also be adjusted.  This value tells the
recipient of the update how long to hold on to the CDP information in the update.  It is
also a global parameter. 

13. On R1, type the command to adjust the holdtime timer to 60 seconds.
R1#conf t 
R1(config)#cdp holdtime 60

14. On R1, type the command to verify the changes made.
R1#show cdp
The below is sample output
R1#sh cdp
Global CDP information:
Sending CDP packets every 45 seconds
Sending a holdtime value of 60 seconds 
Sending CDPv2 advertisements is enabled
R1# 
If there are no other directly connected Cisco devices on the network, or to simply
conserve bandwidth, CDP can be disabled. 

15. On R1, type the command to disable CDP for the ENTIRE router.
R1#conf t 
R1(config)#no cdp run 

16. On R1, type the command to turn CDP back on for the ENTIRE router.
R1#conf t 
R1(config)#cdp run
At times you may wish to disable CDP for a specific interface, for example a very low-
bandwidth interface, or security reasons. 

17. On R1, Disable CDP for only the specific interface Ethernet 0.
R1(config)#interface Ethernet 0 
R1(config-if)#no cdp enable

18. On R1, type the command to verify that Ethernet 0 is no longer sending CDP updates
(You can verify that the interface Ethernet 0 is not sending cdp updates because it does
not show up as an entry in the output).
R1#show cdp interface
Below is sample output from the command.
R1#show cdp interface
Serial0 is up, line protocol is up
Encapsulation HDLC
Sending CDP packets every 45 seconds
Holdtime is 60 seconds  

Basic Lab Summary
This lab is designed to introduce the Cisco Discovery Protocol (CDP) and some of its
available commands.
The Cisco Discovery Protocol (CDP) Discovery Protocol
CDP allows devices to share basic configuration information without even configuring
any protocol specific information and is enabled by default on all interfaces.
CDP is a Datalink Protocol occurring at Layer 2 of the OSI model.   
This is important to understand because CDP is not routable and can only traverse to
directly connected devices.
CDP allows you to view information such Operating System Version, Protocol
Information, and much more.   
This can be very handy for troubleshooting a variety of problems.
CDP Configuration by default it is enabled on the router and all interfaces.