文章详情

短信预约-IT技能 免费直播动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

实验3:CDP命令操作

2023-01-31 01:54

关注

 

 Cisco Discovery Protocol (CDP)从名字我们就可以看出这是Cisco专有的了,建议大家学习CCNA的时候尽量熟悉全拼 不要简单的记下缩写!

CDP可以收集相邻的设备的硬件和协议信息
CDP有两个全局参数 ,可以进行设置
CDP timer(CDP定时器) 和 CDP holdtime(保持时间)
CDP定时器是多长时间将CDP数据包传输到所有接口的时间量。
CDP保持时间是设备保留从相邻设备接收到的数据包的时间量。

下面介绍下CDP的几个命令和区别
show cdp neighbors :作用是显示有关直连设备的信息,其中包括设备的主机名,接收数据包的端口或接口,保持时间,邻居设备的性能,设备类型和连接的端口ID
show cdp neighbors detail 显示的就比较详细了
和以上比较多了,直连设备的IP地址和IOS版本号。

show cdp entry * 与 show cdp neighbors detail 相同。

show cdp entry * protocols 显示直连邻居的IP地址。
show cdp entry * version 显示直连邻居的IOS版本。
show cdp traffic 显示了设备发送和接收的CDP数据包。
show cdp interface 显示每个接口使用的CDP信息,包括线路的封装类型,定时器和保持时间。

关闭CDP服务 no cdp run ,关闭某个接口的CDP 进入接口模式下 no cdp enable

当大家看完以上的命令的时候,想象一下,给你一个路由器 然后需要你根据CDP的
信息来配置IP和线缆的连接类型 以及设备类型 ,大家应该能做出来吧!下面我们来做以上实验

Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#host ccna1                                   设置路由器名
ccna1(config)#enable password cisco1            设置password
ccna1(config)#enable secret cisco2                   设置secret
ccna1(config)#line vty 0 4
ccna1(config-line)#login
% Login disabled on line 66, until 'password' is set
% Login disabled on line 67, until 'password' is set
% Login disabled on line 68, until 'password' is set
% Login disabled on line 69, until 'password' is set
% Login disabled on line 70, until 'password' is set
ccna1(config-line)#pass cisco3                            设置vty密码
ccna1(config-line)#exit
ccna1(config)#service password-encryption
ccna1(config)#int s1/1/0
ccna1(config-if)#ip add 202.119.249.1 255.255.255.0                    设置s0
ccna1(config-if)#clock rate 56000
ccna1(config-if)#no shut

%LINK-5-CHANGED: Interface Serial1/1/0, changed state to down
ccna1(config-if)#exit
ccna1(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
ccna1#

ccna2配置

Router>en
Router#Conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#host ccna2
ccna2(config)#enable password cisco1
ccna2(config)#enable secret cisco2
ccna2(config)#line vty 0 4
ccna2(config-line)#login
% Login disabled on line 66, until 'password' is set
% Login disabled on line 67, until 'password' is set
% Login disabled on line 68, until 'password' is set
% Login disabled on line 69, until 'password' is set
% Login disabled on line 70, until 'password' is set
ccna2(config-line)#password cisco3
ccna2(config-line)#exit
ccna2(config)#service password-encryption
ccna2(config)#int s1/1/0
ccna2(config-if)#ip add 202.119.249.2 255.255.255.0
ccna2(config-if)#no shut

%LINK-5-CHANGED: Interface Serial1/1/0, changed state to up
ccna2(config-if)#exit
ccna2(config)#int s1/1/1
ccna2(config-if)#ip add 202.119.248.1 255.255.255.0
ccna2(config-if)#clock rate 56000
ccna2(config-if)#no shut

%LINK-5-CHANGED: Interface Serial1/1/1, changed state to down
ccna2(config-if)#end
%SYS-5-CONFIG_I: Configured from console by console

ccna3配置

Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#host ccna3
ccna3(config)#enable password cisco1
ccna3(config)#enable secret cisco2
ccna3(config)#line vty 0 4
ccna3(config-line)#login
% Login disabled on line 66, until 'password' is set
% Login disabled on line 67, until 'password' is set
% Login disabled on line 68, until 'password' is set
% Login disabled on line 69, until 'password' is set
% Login disabled on line 70, until 'password' is set
ccna3(config-line)#pass cisco3
ccna3(config-line)#exit
ccna3(config)#service password-encryption
ccna3(config)#int s1/1/0
ccna3(config-if)#ip add 202.119.248.2 255.255.255.0
ccna3(config-if)#no shut

%LINK-5-CHANGED: Interface Serial1/1/0, changed state to up
ccna3(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1/0, changed state to upend
%SYS-5-CONFIG_I: Configured from console by console
ccna3#

主要内容ccna2上操作:
ccna2>en
Password:
ccna2#show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
Device ID    Local Intrfce   Holdtme    Capability   Platform    Port ID
ccna1        Ser 1/1/0        167            R       C2800       Ser 1/1/0
ccna3        Ser 1/1/1        161            R       C2800       Ser 1/1/0
ccna2#show cdp
Global CDP information:
    Sending CDP packets every 60 seconds
    Sending a holdtime value of 180 seconds
    Sending CDPv2 advertisements is enabled

ccna2#show cdp entry *

Device ID: ccna1
Entry address(es):
  IP address : 202.119.249.1
Platform: cisco C2800, Capabilities: Router
Interface: Serial1/1/0, Port ID (outgoing port): Serial1/1/0
Holdtime: 158

Version :
Cisco IOS Software, 2800 Software (C2800NM-ADVIPSERVICESK9-M), Version 12.4(15)T1, RELEASE SOFTWARE (fc2)
Technical Support:
http://www.cisco.com/techsupport
Copyright (c) 1986-2007 by Cisco Systems, Inc.
Compiled Wed 18-Jul-07 06:21 by pt_rel_team

advertisement version: 2
Duplex: full
---------------------------

Device ID: ccna3
Entry address(es):
  IP address : 202.119.248.2
Platform: cisco C2800, Capabilities: Router
Interface: Serial1/1/1, Port ID (outgoing port): Serial1/1/0
Holdtime: 152

Version :
Cisco IOS Software, 2800 Software (C2800NM-ADVIPSERVICESK9-M), Version 12.4(15)T1, RELEASE SOFTWARE (fc2)
Technical Support:
http://www.cisco.com/techsupport
Copyright (c) 1986-2007 by Cisco Systems, Inc.
Compiled Wed 18-Jul-07 06:21 by pt_rel_team

advertisement version: 2
Duplex: full

ccna2#show cdp entry ccna1

Device ID: ccna1
Entry address(es):
  IP address : 202.119.249.1
Platform: cisco C2800, Capabilities: Router
Interface: Serial1/1/0, Port ID (outgoing port): Serial1/1/0
Holdtime: 139

Version :
Cisco IOS Software, 2800 Software (C2800NM-ADVIPSERVICESK9-M), Version 12.4(15)T1, RELEASE SOFTWARE (fc2)
Technical Support:
http://www.cisco.com/techsupport
Copyright (c) 1986-2007 by Cisco Systems, Inc.
Compiled Wed 18-Jul-07 06:21 by pt_rel_team

advertisement version: 2
Duplex: full
---------------------------

ccna2#show cdp entry ccna3

Device ID: ccna3
Entry address(es):
  IP address : 202.119.248.2
Platform: cisco C2800, Capabilities: Router
Interface: Serial1/1/1, Port ID (outgoing port): Serial1/1/0
Holdtime: 129

Version :
Cisco IOS Software, 2800 Software (C2800NM-ADVIPSERVICESK9-M), Version 12.4(15)T1, RELEASE SOFTWARE (fc2)
Technical Support:
http://www.cisco.com/techsupport
Copyright (c) 1986-2007 by Cisco Systems, Inc.
Compiled Wed 18-Jul-07 06:21 by pt_rel_team

advertisement version: 2
Duplex: full
---------------------------

ccna2#show cdp entry ccna2

ccna2#un all
All possible debugging has been turned off

ccna2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
ccna2(config)#cdp run
ccna2(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
ccna2#show cdp interfac
Vlan1 is administratively down, line protocol is down
  Sending CDP packets every 60 seconds
  Holdtime is 180 seconds
FastEthernet0/0 is administratively down, line protocol is down
  Sending CDP packets every 60 seconds
  Holdtime is 180 seconds
FastEthernet0/1 is administratively down, line protocol is down
  Sending CDP packets every 60 seconds
  Holdtime is 180 seconds
Serial1/1/0 is up, line protocol is up
  Sending CDP packets every 60 seconds
  Holdtime is 180 seconds
Serial1/1/1 is up, line protocol is up
  Sending CDP packets every 60 seconds
  Holdtime is 180 seconds
 
ccna2#debug ?
  eigrp        EIGRP Protocol information
  frame-relay  Frame Relay
  ip           IP information

搞定。。。。。

阅读原文内容投诉

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     813人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     354人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     318人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     435人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     224人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-后端开发
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯