Cisco Discovery Protocol (CDP) is a Cisco proprietary Layer 2 (Data Link layer) protocol that was added to version 10.3 and later. CDP gathers and stores information regarding other neighboring devices on the network. It can be used in Ethernet, Token Ring, Serial, and FDDI media types. All Cisco devices, including hubs, support CDP. CDP runs on most Cisco manufactured devices that include Cisco routers, switches, hubs, bridges, and communication servers. CDP collects such information as the device name , device capabilities, hardware platform type, port type, and the port number through which CDP information is being sent out. CDP periodically sends multicasts using 0100.0ccc.cccc as the destination address on the frame header. Information about the router itself is sent on all the router's interfaces every 60 seconds by default. Any neighboring Cisco device that is directly connected adds the learned CDP information to a table called the CDP table. CDP-enabled neighboring devices then hold this information for the specified CDP hold-time (180 seconds, by default). The CDP command has several syntaxes which display different collected information. Let's take a look at each one of the syntaxes: DCSRTR# show cdp ? entry Information for specific neighbor entry interface CDP interface status and configuration neighbors CDP neighbor entries traffic CDP statistics Output modifiers <cr> The output above shows all the syntaxes available for the show cdp command. The show cdp entry CommandThis command shows all the entries learned from all the interfaces on the router or switch. The following display shows that the router is directly attached to a Cisco 2950 switch as shown in Figure 7.2. An asterisk after the show cdp entry command indicates "all" devices. DCSRTR# show cdp entry * Device ID: DCS-SAC-Sw1 Entry address(es): IP address: 10.1.10.1 Platform: cisco WS-C2950-24, Capabilities: Trans-Bridge Switch Interface: FastEthernet0, Port ID (outgoing port): FastEthernet0/1 Holdtime : 140 sec Version : Cisco Internetwork Operating System Software IOS (tm) C2950 Software (C2950-C3H2S-M), Version 12.0(5.3)WC(1), MAINTENANCE INT ERIM SOFTWARE Copyright (c) 1986-2001 by cisco Systems, Inc. Compiled Mon 30-Apr-01 07:56 by devgoyal advertisement version: 2 Protocol Hello: OUI=0x00000C, Protocol ID=0x0112; payload len=27, value=0000000 0FFFFFFFF010121FF0000000000000006525ACD80FF0001 VTP Management Domain: '' Figure 7.2. The configuration shown by the show cdp entry command.
This is the same command viewed from the attached 2950 switch. This output shows that the switch is directly attached to the Cisco router that the preceding output came from: DCS-SAC-Sw1# show cdp entry * Device ID: DCSRTR Entry address(es): IP address: 10.1.1.2 Platform: cisco 1710, Capabilities: Router Interface: FastEthernet0/1, Port ID (outgoing port): FastEthernet0 Holdtime : 149 sec Version : Cisco Internetwork Operating System Software IOS (tm) C1700 Software (C1710-K9O3SY-M), Version 12.2(4)XL, EARLY DEPLOYMENT RE LEASE SOFTWARE (fc1) TAC Support: http://www.cisco.com/tac Copyright (c) 1986-2001 by cisco Systems, Inc. Compiled Thu 15-Nov-01 18:45 by ealyon advertisement version: 2 The show cdp interface CommandThe show cdp interface command shows all the interfaces on the router or switch that are using the CDP protocol, the status of the interface, the encapsulation type, how often CDP packets are sent on the interface, and how long entries are held. The following output shows the interfaces on a Cisco 1710 router and displays the default settings on the interface. CSRTR# show cdp interface Ethernet0 is up, line protocol is up Encapsulation ARPA Sending CDP packets every 60 seconds Holdtime is 180 seconds FastEthernet0 is up, line protocol is up Encapsulation ARPA Sending CDP packets every 60 seconds Holdtime is 180 seconds DCSRTR# The show cdp neighbors CommandThe show cdp neighbors command displays all the connected neighbors, the Device ID, the interface connecting to the device, the device's capabilities, the type of device, and the port ID on the remote device that is connected to the switch. Here is an example of this command in use: DCSRTR# 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 DCS-SAC-Sw1 Fas 0 158 T S WS-C2950-2Fas 0/1 DCSRTR# The show cdp neighbors command has many syntaxes. For the exam you should be familiar with the output from the detail syntax, which is all shown below: DCSRTR# show cdp neighbors ? Async Async interface BVI Bridge-Group Virtual Interface CTunnel CTunnel interface Dialer Dialer interface Ethernet IEEE 802.3 FastEthernet FastEthernet IEEE 802.3 Lex Lex interface MFR Multilink Frame Relay bundle interface Multilink Multilink-group interface Tunnel Tunnel interface Vif PGM Multicast Host interface Virtual-Template Virtual Template interface Virtual-TokenRing Virtual TokenRing detail Show detailed information Output modifiers <cr> DCSRTR#show cdp neighbors detail Device ID: DCS-SAC-Sw1 Entry address(es): IP address: 10.1.10.1 Platform: cisco WS-C2950-24, Capabilities: Trans-Bridge Switch Interface: FastEthernet0, Port ID (outgoing port): FastEthernet0/1 Holdtime : 172 sec Version : Cisco Internetwork Operating System Software IOS (tm) C2950 Software (C2950-C3H2S-M), Version 12.0(5.3)WC(1), MAINTENANCE INT ERIM SOFTWARE Copyright (c) 1986-2001 by cisco Systems, Inc. Compiled Mon 30-Apr-01 07:56 by devgoyal advertisement version: 2 Protocol Hello: OUI=0x00000C, Protocol ID=0x0112; payload len=27, value=0000000 0FFFFFFFF010121FF0000000000000006525ACD80FF0001 VTP Management Domain: '' DCSRTR# Notice that in the output from the detail syntax above, the Platform, Device ID, the interface on the device being used, the IP address of the device, the device type, and the version of the IOS the attached device is using are all displayed. The show cdp traffic CommandThe output of this command shows the total CDP packets sent, CDP packets received, CDP version type, memory errors, and any CDP packet problems that were detected . An example of the output follows : CSRTR# show cdp traffic CDP counters : Total packets output: 45984, Input: 23303 Hdr syntax: 0, Chksum error: 0, Encaps failed: 0 No memory: 0, Invalid packet: 0, Fragmented: 0 CDP version 1 advertisements output: 0, Input: 0 CDP version 2 advertisements output: 45984, Input: 23303 DCSRTR# Configuring CDPThe CDP protocol can be disabled on all the routers' interfaces by using no cdp run command. It can be re-enabled by using the cdp run command as shown below: Password: DCSRTR> enable Password: DCSRTR# config terminal Enter configuration commands, one per line. End with CNTL/Z. DCSRTR(config)# no cdp run DCSRTR(config)# cdp run If you would like to disable CDP on a particular interface, use the no cdp enable command. To re-enable CDP, use the cdp enable command as shown below: Password: DCSRTR> enable Password: DCSRTR# config terminal Enter configuration commands, one per line. End with CNTL/Z. DCSRTR(config)# interface fastethernet0 DCSRTR(config-if)# no cdp enable DCSRTR(config-if)# cdp enable Both the CDP timer and holddown values are controlled at the global configuration interface. To set the CDP timer ”which controls how often CDP packets are sent ”use the cdp timer command and indicate how often in seconds you want CDP packets to be sent, as shown below: Password: DCSRTR> enable Password: DCSRTR# config terminal Enter configuration commands, one per line. End with CNTL/Z. DCSRTR(config)# cdp timer 150 DCSRTR(config)# The CDP hold-time timer also needs to be configured in Global configuration mode using the cdp holddown command follows by the hold-time that is indicated in seconds. The configured CDP timers should be configured the same on neighboring Cisco devices as the current router. An example of the command is shown below, setting the hold time to 300 seconds: Password: DCSRTR> enable Password: DCSRTR# config terminal Enter configuration commands, one per line. End with CNTL/Z. DCSRTR(config)# cdp holddown 300 DCSRTR(config)# The above output shows the CDP hold down timer being set to 300 seconds. This means that learned entries will not expire for 5 minutes. |