侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

CCNA实验:配置CDP协议

2023-04-04 星期二 / 0 评论 / 0 点赞 / 69 阅读 / 2995 字

第一步:R1上的预配置R1(config)#int s1/2R1(config-if)#ip add 10.1.1.1 255.255.255.0R1(config-if)#no shR1(confi

.


第一步:R1上的预配置
R1(config)#int s1/2
R1(config-if)#ip add 10.1.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#
第二步:R2上的预配置
R2(config)#
R2(config)#int s2/1
R2(config-if)#ip add 10.1.1.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#
实验过程:
第一步:在R1上使用sh cdp nei查看R1周围的思科设备
R1#sh cdp nei
R1#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
R2 Ser 1/2 163 R 3640 Ser 2/1
//现在可以看到R2中,以及R1连接R2的接口
第二步:为了进一步查看cisco设备的详细信息,可以使用如下方式:
R1#
R1#sh cdp nei detail
Device ID: R2
Entry address(es):
IP address: 10.1.1.2
Platform: cisco 3640, Capabilities: Router
Interface: Serial1/2, Port ID (outgoing port): Serial2/1
Holdtime : 160 sec

Version :
Cisco Internetwork Operating System Software
IOS (tm) 3600 Software (C3640-D-M), Version 12.0(4), RELEASE SOFTWARE (fc1)
Copyright (c) 1986-1999 by cisco Systems, Inc.
Compiled Thu 15-Apr-99 10:31 by ccai

R1#
//在这里我们可以邻居的什么信息?
接口信息和版本等信息
第三步:思科路由器为什么会得到周围邻居的信息呢
R1#sh cdp traffic (通过这个命令可以看到收到的发送出去的数据包的数量)
CDP counters :
Packets output: 13, Input: 12
Hdr syntax: 0, Chksum error: 0, Encaps failed: 0
No memory: 0, Invalid packet: 0, Fragmented: 0
R1#

第四步:为了查看到cdp工作的过程,我们对cdp包进行了调试
R1#
R1#debug cdp packets (对cdp包进行调试)
CDP packet info debugging is on
R1#clear cdp table(清除cdp缓存表)
R1#clear cdp counters(清除cdp的计数器)
00:23:03: CDP-PA: Packet received from R2 on interface Serial1/2
(可以看到有cdp包从s1/2接口发送出去)
00:23:03: Entry NOT found in cache
00:23:08: CDP-PA: Packet sent out on Serial1/2
(收到了cdp包)
第五步:到R1上关闭cdp协议
R1(config)#int s1/2
R1(config-if)#no cdp enable
R1#sh cdp int s1/2
//现在查看不到s1/2上的cdp运行情况了
//现在只是关闭了s1/2接口上的cdp,但是其它接口默认情况下还是运行cdp协议的

第七步:现在再查看R1上的cdp邻居信息
R1#sh cdp nei
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
R1#
//看不到任何信息

.

广告 广告

评论区