How to using the Cisco CDP protocol in Switch or Router
How to using the Cisco CDP protocol
CDP is a Cisco proprietary protocol that allows devices connected Cisco devices identify and exchange information. CDP is enabled by default on Cisco equipment. The procedure to enable the CDP protocol is simple, you can activate the protocol in general or individual interfaces.
Router1#configure terminal
Router1(config)#cdp run
Router1(config-if)#exit
Router1(config)#interface FastEthernet0/0
Router1(config-if)#no cdp enable
Router1(config-if)#exit
Router1(config)#interface FastEthernet1/0
Router1(config-if)#cdp enable
Router1(config-if)#end
Router1#
Router1(config)#cdp run
Router1(config-if)#exit
Router1(config)#interface FastEthernet0/0
Router1(config-if)#no cdp enable
Router1(config-if)#exit
Router1(config)#interface FastEthernet1/0
Router1(config-if)#cdp enable
Router1(config-if)#end
Router1#
The show cdp neighbors command provides summary information on adjacent equipment using CDP, including: name of the remote computers, including the model, as well as the local interface is connected to the remote computer and computer interface remote is connected to the local computer.
Router1#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
Router2 Ser 0/0 179 R 2621 Ser 0/1
Switch1 Fas 1/0 152 T S WS-C2960 F0/2
Router1#
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
Router2 Ser 0/0 179 R 2621 Ser 0/1
Switch1 Fas 1/0 152 T S WS-C2960 F0/2
Router1#
It is important to note that CDP is a layer 2 protocol, so it is possible to obtain information from remote computers if they do not have a configured IP address. For a more detailed response, you can add the word detail.
Router1#show cdp neighbors detail
-------------------------
Device ID: Router2
Entry address(es):
IP address: 10.1.1.2
Platform: cisco 2621, Capabilities: Router
Interface: Serial0/0, Port ID (outgoing port): Serial0/1
Holdtime : 136 sec
Version :
Cisco Internetwork Operating System Software
IOS (tm) C2600 Software (C2600-IK9O3S-M), Version 12.2(13), RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2002 by cisco Systems, Inc.
Compiled Tue 19-Nov-02 22:27 by john
advertisement version: 2
Device ID: Switch1
Entry address(es):
IP address: 172.25.1.4
Platform: WS-C2924, Capabilities: Trans-Bridge Switch
Interface: FastEthernet1/0, Port ID (outgoing port): FastEthernet0/12
Holdtime : 116 sec
Version :
Cisco Internetwork Operating System Software
IOS (tm) C2900XL Software (C2900XL-C3H2S-M), Version 12.0(5)WC3b, RELEASE SOFTWARE
(fc1)
Copyright (c) 1986-2002 by cisco Systems, Inc.
Compiled Fri 15-Feb-02 10:14 by john
advertisement version: 2
Duplex: full
Router1#
-------------------------
Device ID: Router2
Entry address(es):
IP address: 10.1.1.2
Platform: cisco 2621, Capabilities: Router
Interface: Serial0/0, Port ID (outgoing port): Serial0/1
Holdtime : 136 sec
Version :
Cisco Internetwork Operating System Software
IOS (tm) C2600 Software (C2600-IK9O3S-M), Version 12.2(13), RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2002 by cisco Systems, Inc.
Compiled Tue 19-Nov-02 22:27 by john
advertisement version: 2
Device ID: Switch1
Entry address(es):
IP address: 172.25.1.4
Platform: WS-C2924, Capabilities: Trans-Bridge Switch
Interface: FastEthernet1/0, Port ID (outgoing port): FastEthernet0/12
Holdtime : 116 sec
Version :
Cisco Internetwork Operating System Software
IOS (tm) C2900XL Software (C2900XL-C3H2S-M), Version 12.0(5)WC3b, RELEASE SOFTWARE
(fc1)
Copyright (c) 1986-2002 by cisco Systems, Inc.
Compiled Fri 15-Feb-02 10:14 by john
advertisement version: 2
Duplex: full
Router1#
This output indicates the IP address of adjacent devices and their interfaces, their version of IOS or CatOS. Both devices support CDP version 2, which was introduced since version 12.0(3)T.
0 Comments:
Post a Comment