R1#
如实验结果所示,路由器R1只显示出与它直连的路由器R2和交换机SW1,而不会显示与交换机SW1直接相连的R3的路由信息。
下面列出show cdp neighbor命令为每个设备显示的信息。
Device ID: 直连设备的主机名
Local interface :要接收CDP分组的端口或接口(直接控制的本地设备)
Holdtime :如果没有接收到其他CDP分组,路由器在丢弃接收到的信息之前将要保存的时间量。
Capability :邻居设备的类型,如路由器,交换机或中继器。
Platform :CISCO设备类型在上面的输出中cisco 2500和catalyst 2912是直连在路由器R1上的设备。
Port ID :与路由器R1直接相连的设备在发送更新时所用的接口。
另一个提供相邻设备信息的命令为show cdp neighbor命令,此命令可以在路由器或交换机上运行,它显示连接到此设备上的每个设备的详细信息,下面为命令输出的例子。
R1#show cdp neighbor detail
-------------------------
Device ID: SW1
Entry address(es):
IP address: 50.50.50.1
Platform: cisco WS-C2912-XL, Capabilities: Trans-Bridge Switch
Interface: Ethernet0, Port ID (outgoing port): FastEthernet0/1
Holdtime : 239 sec
Version :
Cisco Internetwork Operating System Software
IOS (tm) C2900XL Software (C2900XL-C3H2S-M), Version 12.0(5)WC14, RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2006 by cisco Systems, Inc.
Compiled Thu 16-Feb-06 14:39 by antonino
-------------------------
Device ID: R2
Entry address(es):
IP address: 10.10.10.2
Platform: cisco 2500, Capabilities: Router
Interface: Serial0, Port ID (outgoing port): Serial0
Holdtime : 126 sec
Version :
--More--
CDP-EV: Bad version number in header
CDP-PA: Packet received from SW1 on interface Ethernet0
**Entry found in cache**
Cisco Internetwork Operating System Software
IOS (tm) 3000 Software (IGS-I-L), Version 11.0(3), RELEASE SOFTWARE (fc1)
Copyright (c) 1986-1995 by cisco Systems, Inc.
Compiled Tue 07-Nov-95 15:04 by deannaw
R1#
通过这条命令给出了直连设备的主机名、相关型号、类型、本地发出更新的接口和对方接收CDP更新信息的接口,保持时间以及IOS的版本号等。
说明:你只能看到直连设备的IP地址。
Show cdp entry *命令与show cdp neighbor details命令所显示的为相同的信息。下面是show cdp entry *命令的路由器输出的例子。
R1#show cdp entry *
-------------------------
Device ID: SW1
Entry address(es):
IP address: 50.50.50.1
Platform: cisco WS-C2912-XL, Capabilities: Trans-Bridge Switch
Interface: Ethernet0, Port ID (outgoing port): FastEthernet0/1
Holdtime : 204 sec
Version :
Cisco Internetwork Operating System Software
IOS (tm) C2900XL Software (C2900XL-C3H2S-M), Version 12.0(5)WC14, RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2006 by cisco Systems, Inc.
Compiled Thu 16-Feb-06 14:39 by antonino
Device ID: R2
Entry address(es):
IP address: 10.10.10.2
Platform: cisco 2500, Capabilities: Router
Interface: Serial0, Port ID (outgoing port): Serial0
Holdtime : 121 sec