Cisco发现协议
Cisco Discovery Protocol
深圳职业技术学院计算机系网络专业
教学目标( Objectives )
1. Cisco发现协议特征(Feature of Cisco Discovery Protocol )
命令(CDP Command )
3.开启和关闭CDP(Enable and disable CDP)
4. 远程登录(telnet )
Cisco发现协议( Cisco Discovery Protocol )
提供的专有的命令
CDP runs on all Cisco equipment
2.获得直接连接的设备的信息摘要
The primary use of CDP is to discover all Cisco devices that are directly connected to a local device.
3.运行在数据链路层
Cisco Discovery Protocol (CDP) is a Layer 2 protocol
版本1在版本后会自动启动
CDP Version 1 is enabled by default with Cisco IOS (Release later).
更新周期60秒
CDP update timer is 60s
过期周期180秒
CDP hold timer is 180s
用CDP发现邻居(Discovering Neighbors with CDP)
信息摘要包括(Summary information includes):
设备ID(Device ID)
本地接口(Local Interface )
保持时间(Holdtime )
功能(Capability )
平台(Platform )
端口ID(Port ID )
VTP域名(VTP Management Domain Name (CDPv2 only) )
本征VLAN(Native VLAN (CDPv2 only) )
全双工/半双工(Full/Half-Duplex (CDPv2 only) )
CDP
show cdp
CDP
CDP
Using the show cdp neighbor Command
RouterA#sh 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
RouterB Ser 0 148 R 2522 Ser 1
SwitchA Eth 0 167 T S 1900 2
SwitchB
RouterA
RouterB
SwitchA
S0
S1
Using the show cdp entry Command
RouterA#sh cdp entry *
-------------------------
Device ID: RouterB
Entry address(es):
IP address:
Platform: cisco 2522, Capabilities: Router
Interface: Serial0, Port ID (outgoing port): Serial1
Holdtime : 168 sec
Version :
Cisco Internetwork Operating System Software
IOS (tm) 2500 Software (C2500-JS-L), Version (3), RELEASE SOFTWARE (fci)
Copyright (c) 1986-1999 by cisco Systems, Inc.
Compiled Mon 08-Feb-99 18:18 by phanguye
SwitchB
RouterA
RouterB
SwitchA
S0
S1
CDP其它命令(Additional CDP Commands)
RouterA#sh cdp traffic
CDP counters :
Packets output: 56, Input: 38
Hdr syntax: 0, Chksum error: 0, Encaps failed: 3
No memory: 0, Invalid packet: 0, Fragmented: 0
RouterA#sh cdp interface
BRI0 is administratively down, line protocol is down
Encapsulation HDLC
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
SwitchB
RouterA
RouterB
SwitchA
S0
S1
开启和关闭CDP(Enable and disable CDP)
1. 在全局配置模式下使用(no)cdp run 命令开启或关闭所由接口的CDP功能。默认情况下,CDP被全局开启。
The cdp run command is used to enable CDP globally on the router. By default, CDP is globally enabled.
2.在接口模式下使用(no) cdp enable 命令可以开启或关闭某个特定接口的CDP功能。
CDP could be enabled on each of the devices interfaces by using the cdp enable command.
配置周期(Configuring Timer)
Router(config)#cdp timer 5
Router(config)# cdp holdtime 15
用telnet连接到远程主机
(Using Telnet to Connect to Remote Devices)
Remote device
SwitchB
RouterA
RouterB
SwitchA
S0
S1
RouterA#telnet
Trying ... Open
-------------------------------------------------
Catalyst 1900 Management Console
Copyright (c) Cisco Systems, Inc. 1993-1998
All rights reserved.
Enterprise Edition Software
Ethernet Address: 00-90-86-73-33-40
PCA Number: 73-2239-06
PCA Serial Number: FAA02359H8K
Model Number: WS-C1924-EN
System Serial Number: FAA0237X0FQ
.
.
RouterB>
查看telnet连接(Viewing Telnet Connections)
SwitchB
RouterA
RouterB
SwitchA
S0
S1
RouterA#sh session
Conn Host Address Byte Idle Conn Name
1 0 1
* 2 0 0
RouterA#sh user
Line User Host(s) Idle Location
* 0 con 0 3
2
11 vty 0 idle 1
挂起telnet会话(Suspending a Telnet Session)
SwitchB
RouterA
RouterB
SwitchA
S0
S1
RouterB#<Ctrl-Shift-6> x
RouterA#sh session
Conn Host Address Byte Idle Conn Name
1 0 1
RouterA#resume 1
RouterB#
关闭telnet会话(Closing a Telnet Session)
RouterA#disconnect
Closing connection to [confirm]
RouterA#clear line 11
[confirm]
[OK]
Closing a session opened by a remote device
Closing the current session opened by you
SwitchB
RouterA
RouterB
SwitchA
S0
S1
思考题(Questions)
1.CDP有哪些特征?
2.CDP的功能是什么?
3.用CDP可以看到邻居的哪些信息?
4.用什么命令可以在接口下控制CDP的启动?
5.哪个符号是我们获得帮助时最常用的?
6.telnet默认支持几个用户同时登录?
Slide 1 of 1
Purpose:
Emphasize: CDP is media- and protocol-independent and runs on all Cisco-manufactured equipment including routers, access servers, switches and some managed hubs. With CDP, network management applications can retrieve the device type and SNMP agent address of neighboring devices. This capability enables applications to send SNMP queries to neighboring devices.
CDP allows network management applications to dynamically discover Cisco devices that are neighbors. CDP runs on all media that support Subnetwork Access Protocol, including LAN and Frame Relay. CDP runs over the data link layer only, not the network layer. Therefore, two systems that support different network-layer protocols can learn about each other.
Cached CDP information is available to network management applications. Cisco devices never forward a CDP packet. When new information is received, old information is discarded. The holdtime determines how long to keep existing information from a neighbor.
Slide 1 of 1
Purpose:
Emphasize: This graphic shows the show cdp neighbors command initiated from a router, which displays a summary of the capabilities and access details for the CDP neighbors. The show cdp neighbors detail command shows detailed information about the same devices.
Note: If the neighbor is a Cat 1900 switch, the switch mac address is also displayed. If the switch is a 2900xl, its mac address is not displayed.
Slide 1 of 1
Purpose:
Emphasize: The example shows what information can be obtained about RouterA’s neighbor. CDP is one way to learn about other Cisco devices on the network.
Slide 1 of 1
Purpose:
Emphasize:
Note: The holdtime indicates how long the neighbor information will be kept in the local CDP table.
Slide 1 of 1
Purpose:
Emphasize: Another way to learn about a remote device is to connect to it. Telnet, a virtual terminal protocol that is part of the TCP/IP protocol suite, allows connections to remote hosts. By default, a router can have up to five simultaneous incoming Telnet sessions. With Cisco’s implementation of TCP/IP, you need not enter the connect or telnet command to establish a Telnet connection. If you prefer, you can just enter the learned host name, the router will resolve the hostname using DNS or a local host table. To end a Telnet session, use the exit or logout EXEC command.
These are alternate commands for the operations listed on the graphic:
Initiate a session:
Denver> connect paris
Denver> paris
Denver>
Resume a session (enter session number or name):
Denver> 1
Paris>
End a session:
Paris> exit
Note: The Cat 1900 can accept incoming telnet connections but can not initiate an outgoing telnet session.
Slide 1 of 1
Purpose:
Emphasize:
Note: This output was taken from a 2522. Line 11 = VTY 0.
You can send messages to one or all terminal lines. A common reason for doing this is to inform users of an impending shutdown. To send a message to other terminals, issue the following command:
send {line-number | *}
Syntax Description
line-number Specifies the line number to which the message will be sent.
* Indicates that the message will be sent to all lines.
The system prompts for the message, which can be up to 500 characters long. End the message by entering Ctrl-Z. Enter Ctrl-C to abort the command.
Slide 1 of 1
Purpose:
Emphasize: The key stoke sequence for Ctrl-Shift-6 and x.
Slide 1 of 1
Purpose:
Emphasize:
Note: Disconnect without the session number disconnect that last active session.