实验10: RIP
实验7-1 : RIPV1
实验目的
通过本实验可以掌握:
1. 在路由器上启动RIPv1 路由进程
2. 启用参与路由协议的接口,并且通告网络
3. 理解路由表的含义
4. 查看和调试RIPv1 路由协议相关信息
实验拓扑

实验步骤
n 步骤1:配置路由器R2
router(config)#host R2
R2(config)#no ip do lo
R2(config)#int s1/0
R2(config-if)#ip add 192.168.12.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int lo0
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R2(config)#router rip
R2(config-router)#version 1
R2(config-router)#network 2.0.0.0
R2(config-router)#network 192.168.12.0
R2(config-router)#passive-interface lo0
n 步骤2:配置路由器R1
router(config)#host R1
R1(config)#no ip do lo
R1(config)#int s1/0
R1(config-if)#ip add 192.168.12.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#no sh
R1(config)#int s1/1
R1(config-if)#ip add 192.168.13.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#no sh
R1(config-if)#int lo0
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config)#router rip
R1(config-router)#version 1
R1(config-router)#network 1.0.0.0
R1(config-router)#network 192.168.12.0
R1(config-router)#network 192.168.13.0
R1(config-router)#passive-interface lo0
n 步骤3:配置路由器R3
router(config)#host R3
R3(config)#no ip do lo
R3(config)#int s1/0
R3(config-if)#ip add 192.168.13.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#int lo0
R3(config-if)#ip add 3.3.3.3 255.255.255.0
R3(config)#router rip
R3(config-router)#version 1
R3(config-router)#network 3.3.3.0
R3(config-router)#network 192.168.13.0
R3(config-router)#passive-interface lo0
实验调试
n R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.12.0/24 is directly connected, Serial1/0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
C 192.168.13.0/24 is directly connected, Serial1/1
R 2.0.0.0/8 [120/1] via 192.168.12.2, 00:00:08, Serial1/0
R 3.0.0.0/8 [120/1] via 192.168.13.3, 00:00:08, Serial1/1
n R1#debug ip rip
RIP protocol debugging is on
*Mar 1 00:39:09.591: RIP: sending v1 update to 255.255.255.255 via Serial1/1 (192.168.13.1)
*Mar 1 00:39:09.595: RIP: build update entries
*Mar 1 00:39:09.595: network 1.0.0.0 metric 1
*Mar 1 00:39:09.599: network 2.0.0.0 metric 1
*Mar 1 00:39:09.599: network 192.168.12.0 metric 1
*Mar 1 00:39:17.423: RIP: received v1 update from 192.168.13.3 on Serial1/1
*Mar 1 00:39:17.427: 3.0.0.0 in 1 hops
*Mar 1 00:39:19.327: RIP: received v1 update from 192.168.12.2 on Serial1/0
*Mar 1 00:39:19.331: 2.0.0.0 in 1 hops
*Mar 1 00:39:22.967: RIP: sending v1 update to 255.255.255.255 via Serial1/0 (192.168.12.1)
*Mar 1 00:39:39.011: RIP: sending v1 update to 255.255.255.255 via Serial1/1 (192.168.13.1)
【测试】
R2(config)#router rip
R2(config-router)#passive-interface s1/0
R2#debug ip rip
查看R2能否接收到来自R1的rip更新通告
R1#debug ip rip
查看R1能否接收到来自s1/0的rip更新通告
R2(config)#router rip
R2(config-router)#neighbor 192.168.12.1
R1#debug ip rip
查看R1能否接收到来自s1/0的rip更新通告
【提示】
被动接口只能接收路由更新,不能以广播或组播方式发送更新,但是可以以单播的方式发送更新,配置单播更新的命令如下:
R2(config)#router rip
R2(config-router)#passive-interface s1/0
R2(config-router)#neighbor 192.168.12.1
实验7-2 RIPV2
实验目的
通过本实验可以掌握:
(1)在路由器上启动RIPv2 路由进程
(2)启用参与路由协议的接口,并且通告网络
(3)auto-summary 的开启和关闭
(4)查看和调试RIPv2 路由协议相关信息
实验拓扑

实验步骤
n 路由器R2的主要配置
R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#no auto-summary
R2(config-router)#network 2.2.2.0
R2(config-router)#network 192.168.12.0
n 路由器R1的主要配置
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#no auto-summary
R1(config-router)#network 192.168.12.0
R1(config-router)#network 192.168.13.0
R1(config-router)#network 1.1.1.0
n 路由器R3的主要配置
R3(config)#router rip
R3(config-router)#version 2
R3(config-router)#no auto-summary
R3(config-router)#network 192.168.13.0
R3(config-router)#network 3.3.3.0
实验调试
n R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.12.0/24 is directly connected, Serial1/0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
C 192.168.13.0/24 is directly connected, Serial1/1
2.0.0.0/24 is subnetted, 1 subnets
R 2.2.2.0 [120/1] via 192.168.12.2, 00:00:28, Serial1/0
3.0.0.0/24 is subnetted, 1 subnets
R 3.3.3.0 [120/1] via 192.168.13.3, 00:00:07, Serial1/1
以上输出表明路由器R1 学到了2条RIP 路由,其中路由条目”R 3.3.3.0 [120/1] via 192.168.13.3, 00:00:07, Serial1/1”含义如下:
n R:路由条目是通过RIP 路由协议学习来的;
n 3.3.3.0/24:目的网络;
n 120:RIP 路由协议的默认管理距离;
n 1: 度量值,从路由器R1 到达网络3.3.3.0/24 的度量值为1 跳;
n 192.168.13.3:下一跳地址;
n 00:00:07:距离下一次更新还有23(30-7)秒;
n Serial1/0:接收该路由条目的本路由器的接口
【提示】可以看到auto-summary关闭后,通过RIPv2学到的不再是汇总到major-net的路由
n R1#show ip protocol //查看路由器协议配置和统计信息
Routing Protocol is "rip"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Sending updates every 30 seconds, next due in 24 seconds
Invalid after 180 seconds, hold down 180, flushed after 240
Redistributing: rip
Default version control: send version 2, receive version 2
Interface Send Recv Triggered RIP Key-chain
Serial1/0 2 2
Serial1/1 2 2
Loopback0 2 2
Automatic network summarization is not in effect
Maximum path: 4
Routing for Networks:
1.0.0.0
192.168.12.0
192.168.13.0
Routing Information Sources:
Gateway Distance Last Update
192.168.13.3 120 00:00:04
192.168.12.2 120 00:00:27
Distance: (default is 120)
Routing Protocol is "rip"
//路由器上运行的路由协议是RIP
Outgoing update filter list for all interfaces is not set
//在出方向上没有设置过滤列表
Incoming update filter list for all interfaces is not set
//在入方向上没有设置过滤列表
Sending updates every 30 seconds, next due in 24 seconds
//更新周期是30 秒,距离下次更新还有24 秒
//为了防止更新同步,RIP 会以15%的误差发送更新,即实际发送更新的周期的范围是25.5-30 秒。
Invalid after 180 seconds, hold down 180, flushed after 240
//invalid after:路由条目在180 秒没有收到更新,则被标记为无效
//hold down:抑制计时器的时间为180 秒
//flushed after:路由条目如果在240 秒还没有收到更新,则从路由表中删除此路由条目
Redistributing: rip
//只运行RIP 协议,没有其它的协议重分布进来
Default version control: send version 2, receive version 2
//默认发送版本2的路由更新,接收本版2 的路由更新
Interface Send Recv Triggered RIP Key-chain
Serial1/0 2 2
Serial1/1 2 2
Loopback0 2 2
//以上三行显示了运行RIP 协议的接口,以及可以接收和发送的RIP 路由更新的版本RIPv2
【提示】 默认情况下只接收和发送版本2 的路由更新,可以通过命令“ip rip send version”和“ip rip receive version”来控制在路由器接口上接收和发送的版本,例如在s1/0 接口上接收版本1 和2 的路由更新,但是只发送版本2 的路由更新,配置如下:
R1(config-if)#ip rip send version 2
R1(config-if)#ip rip receive version 1 2
Automatic network summarization is not in effect
//RIP 路由协议关闭自动汇总功能
Maximum path: 4
//RIP 路由协议可以支持4 条等价路径,最大为6 条
【提示】可以通过下面的命令来修改RIP 路由协议支持等价路径的条数:
R1(config-router)#maximum-paths number-paths
Routing for Networks:
1.0.0.0
192.168.12.0
192.168.13.0
//以上三行表明RIP 通告的网络
Routing Information Sources:
Gateway Distance Last Update
192.168.13.3 120 00:00:04
192.168.12.2 120 00:00:27
//以上三行表明路由信息源,其中:
//gateway:学习路由信息的路由器的接口地址,也就是下一跳地址
//distance:管理距离
//last update:更新发生在多长时间以前
Distance: (default is 120)
//默认管理距离是120
实验7-3 : RIPV2 认证和触发更新
实验目的
通过本实验可以掌握:
(1)RIPv2 明文认证的配置和匹配原则
(2)RIPv2 MD5 认证的配置和匹配原则
(3)RIPv2 触发更新
实验拓扑

实验步骤
n 步骤1:配置路由器R2
R2(config)#key chain test //配置钥匙链
R2(config-keychain)#key 1 //配置KEY ID
R2(config-keychain-key)#key-string cisco //配置KEY ID 的密匙
R2(config)#interface s1/0
R2(config-if)#ip rip authentication mode md5
//启用认证,认证模式为密文,默认认证模式是明文,所以也可以不用指定
R2(config-if)#ip rip authentication key-chain test //在接口上调用钥匙链
R2(config-if)#ip rip triggered //在接口上启用触发更新
n 步骤2:配置路由器R1
R1(config)#key chain test
R1(config-keychain)#key 1
R1(config-keychain-key)#key-string cisco
R1(config)#interface s1/0
R1(config-if)#ip rip authentication mode md5
R1(config-if)#ip rip authentication key-chain test
R1(config-if)#ip rip triggered
R1(config-if)#interface s1/1
R1(config-if)#ip rip authentication mode md5
R1(config-if)#ip rip authentication key-chain test
R1(config-if)#ip rip triggered
n 步骤3:配置路由器R3
R3(config)#key chain test
R3(config-keychain)#key 1
R3(config-keychain-key)#key-string cisco
R3(config)#interface s1/1
R3(config-if)#ip rip authentication mode md5
R3(config-if)#ip rip authentication key-chain test
R3(config-if)#ip rip triggered
实验调试
(1)R1#show ip protocol
Routing Protocol is "rip"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Sending updates every 30 seconds, next due in 23 seconds
Invalid after 180 seconds, hold down 0, flushed after 240
// 由于触发更新,hold down 计时器自动为0
Redistributing: rip
Default version control: send version 2, receive version 2
Interface Send Recv Triggered RIP Key-chain
Serial1/0 2 2 Yes test
Serial1/1 2 2 Yes test
Loopback0 2 2
//以上两行表明s1/0 和s1/1 接口启用了认证和触发更新
Automatic network summarization is not in effect
Maximum path: 4
Routing for Networks:
1.0.0.0
192.168.12.0
192.168.13.0
Routing Information Sources:
Gateway Distance Last Update
192.168.13.3 120 00:02:03
192.168.12.2 120 00:03:16
Distance: (default is 120)
(2)R1#debug ip rip
RIP protocol debugging is on
R1#clear ip route *
*Mar 1 01:15:11.099: RIP: sending triggered request on Serial1/0 to 224.0.0.9
*Mar 1 01:15:11.115: RIP: sending triggered request on Serial1/1 to 224.0.0.9
*Mar 1 01:15:11.119: RIP: sending request on Loopback0 to 224.0.0.9
*Mar 1 01:15:11.143: RIP: send v2 triggered flush update to 192.168.12.2 on Serial1/0 with no route
*Mar 1 01:15:11.143: RIP: start retransmit timer of 192.168.12.2
*Mar 1 01:15:11.143: RIP: send v2 triggered flush update to 192.168.13.3 on Serial1/1 with no route
*Mar 1 01:15:11.143: RIP: start retransmit timer of 192.168.13.3
*Mar 1 01:15:11.187: RIP: received packet with MD5 authentication
*Mar 1 01:15:11.191: RIP: received v2 triggered update from 192.168.12.2 on Serial1/0
*Mar 1 01:15:11.191: RIP: sending v2 ack to 192.168.12.2 via Serial1/0 (192.168.12.1),
flush, seq# 5
*Mar 1 01:15:11.199: 2.2.2.0/24 via 0.0.0.0 in 1 hops
*Mar 1 01:15:11.207: RIP: received packet with MD5 authentication
*Mar 1 01:15:11.211: RIP: received v2 triggered update from 192.168.12.2 on Serial1/0
*Mar 1 01:15:11.211: RIP: sending v2 ack to 192.168.12.2 via Serial1/0 (192.168.12.1),
flush, seq# 6
*Mar 1 01:15:11.231: 2.2.2.0/24 via 0.0.0.0 in 1 hops
*Mar 1 01:15:11.235: RIP: received packet with MD5 authentication
*Mar 1 01:15:11.235: RIP: received v2 triggered ack from 192.168.12.2 on Serial1/0
flush seq# 4
*Mar 1 01:15:11.239: RIP: send v2 triggered update to 192.168.12.2 on Serial1/0
*Mar 1 01:15:11.243: RIP: build update entries
*Mar 1 01:15:11.243: route 37: 1.1.1.0/24 metric 1, tag 0
*Mar 1 01:15:11.247: route 39: 192.168.13.0/24 metric 1, tag 0
*Mar 1 01:15:11.247: RIP: Update contains 2 routes, start 37, end 43
*Mar 1 01:15:11.251: RIP: start retransmit timer of 192.168.12.2
*Mar 1 01:15:11.279: RIP: received packet with MD5 authentication
*Mar 1 01:15:11.283: RIP: received v2 triggered update from 192.168.13.3 on Serial1/1
*Mar 1 01:15:11.287: RIP: sending v2 ack to 192.168.13.3 via Serial1/1 (192.168.13.1),
flush, seq# 5
*Mar 1 01:15:11.291: 3.3.3.0/24 via 0.0.0.0 in 1 hops
*Mar 1 01:15:11.295: RIP: received packet with MD5 authentication
*Mar 1 01:15:11.299: RIP: received v2 triggered update from 192.168.13.3 on Serial1/1
*Mar 1 01:15:11.303: RIP: sending v2 ack to 192.168.13.3 via Serial1/1 (192.168.13.1),
flush, seq# 6
*Mar 1 01:15:11.307: 3.3.3.0/24 via 0.0.0.0 in 1 hops
*Mar 1 01:15:11.311: RIP: received packet with MD5 authentication
*Mar 1 01:15:11.311: RIP: received v2 triggered ack from 192.168.13.3 on Serial1/1
flush seq# 3
【提示】 从上面的输出可以看出,在R1 上,虽然我们打开了debug ip rip,但是由于采用触发更新,所以并没有看到每30 秒更新一次的信息,而是清除了路由表这件事件触发了路由更新。而且所有的更新中都有“triggered”的字样,同时在接收的更新中带有“MD5 authentication”的字样,证明接口s1/0 和s1/1 启用了触发更新和密文认证
(3) R1#show ip rip database
1.0.0.0/8 auto-summary
1.1.1.0/24 directly connected, Loopback0
2.0.0.0/8 auto-summary
2.2.2.0/24
[1] via 192.168.12.2, 00:14:59 (permanent), Serial1/0
* Triggered Routes:
- [1] via 192.168.12.2, Serial1/0
3.0.0.0/8 auto-summary
3.3.3.0/24
[1] via 192.168.13.3, 00:14:59 (permanent), Serial1/1
* Triggered Routes:
- [1] via 192.168.13.3, Serial1/1
192.168.12.0/24 auto-summary
192.168.12.0/24 directly connected, Serial1/0
192.168.13.0/24 auto-summary
192.168.13.0/24 directly connected, Serial1/1
以上输出进一步说明了在s1/0 和s1/1 启用了触发更新。
(4) R1#show run | begin router rip
router rip
version 2
timers basic 30 180 0 240
//由于触发更新,在配置中自动加入上面一行,且hold down 计时器被设置为0
network 1.0.0.0
network 192.168.12.0
network 192.168.13.0
no auto-summary
实验10: RIP的更多相关文章
- 实验10.3_数值显示拓展_dword型数转变为表示十进制数的字符串
assume cs:code data segment db 10 dup (0) data ends code segment start : mov ax,4240H;F4240H=1000000 ...
- CCNA实验(3) -- RIP
RIP协议分为版本1和版本2,均具备以下特征:1.是距离向量路由协议2.使用跳数(Hop Count)作为度量值3.默认路由更新周期为30秒4.管理距离(AD)为1205.支持触发更新6.最大跳数为1 ...
- CCNA实验(10) -- Access List
使用包过滤技术在路由器上读取三层及四层报头的信息如源地址.目的地址.源端口.目的端口根据预先定义好的规则对包进行过滤 三种类型:1.标准ACL:表号范围1-99或1300-1999.仅对源IP地址进行 ...
- CCIE路由实验(10) -- IS-IS
1.配置基本的集成IS-IS路由协议2.多区域的集成IS-IS配置3.IS-IS认证4.IS-IS路由泄露5.IS-IS汇总6.在IS-IS中手动产生一条默认路由7.IS-IS协议重分布8.用IS-I ...
- c++实验10 图的应用实验
大体与上次实验相同,特点为图是邻接表存储结构 --博客后半部分有程序的所有代码-- 1.图邻接表存储结构表示及基本操作算法实现 所加载的库函数或常量定义及类的定义: #include "Se ...
- 实验10—— java读取歌词文件内容动画输出
1.Read.java package cn.tedu.demo; import java.io.BufferedReader; import java.io.File; import java.io ...
- 嵌入式02 STM32 实验10 定时器中断
优秀文章 https://blog.csdn.net/qq_38351824/article/details/82619734 一.STM32通用定时器(TIM2.TIM3.TIM4和TIM5共四个通 ...
- 【Python】【demo实验10】【练习实例】【打印斐波那契数列】
斐波那契数列介绍: 斐波那契数列(Fibonacci sequence),又称黄金分割数列.因数学家列昂纳多·斐波那契(Leonardoda Fibonacci)以兔子繁殖为例子而引入,故又称为“兔子 ...
- CCNA CCNP CCIE所有实验名称完整版
实验1:通过Console端口访问Cisco路由器 实验2:通过Telnet访问Cisco路由器 实验3:配置终端服务器 实验4:通过浏览器访问路由器 实验5:模式切换.上下文帮助及查看有关信 ...
随机推荐
- 【退役记】CSP2019 退役记
Day -1 机房自习,因为一些奇怪原因心不在焉 我可能太在意csp了 晚上有点扛不住去七楼阳台思考人生,得到了一些惊人的结论想下来由于某种原因继续跑到七楼思考人生 然后晚自习下课仰天大笑出门去,我辈 ...
- 异常记录 Connection reset
连接重置Connection reset 异常java.net.SocketException: Connection reset 详细信息 java.net.SocketException: Con ...
- 谁再问elasticsearch集群Red怎么办?把这篇笔记给他
前言 可能你经历过这些Red. ...等等 那ES的Red是神么意思? 这里说的red,是指es集群的状态,一共有三种,green.red.yellow.具体含义: 冷静分析 从上图可知,集群red是 ...
- 前端面试基础回顾之深入JS继承
前言 对于灵活的js而言,继承相比于java等语言,继承实现方式可谓百花齐放.方式的多样就意味着知识点繁多,当然也是面试时绕不开的点.撇开ES6 class不谈,传统的继承方式你知道几种?每种实现原理 ...
- 【转】[ppurl]从”皮皮书屋”下载电子书的姿势
转:http://blog.csdn.net/hcbbt/article/details/42072545 写在前面的扯皮 为什么标题的”皮皮书屋”加上了引号,因为皮皮书屋(http://www.pp ...
- ip转十进制(PHP、MySQL)
mysql与php中都提供了IP转换十进制数函数 1. IP 由点分格式,转换为数字格式,代码如下: mysql> select inet_aton('127.0.0.1'); +------- ...
- Prop验证、inheritAttrs、$attrs的用法和坑
Prop Prop验证 Vue.component('my-component', { props: { // 基础的类型检查 (`null` 和 `undefined` 会通过任何类型验证) pro ...
- 由Kaggle竞赛wiki文章流量预测引发的pandas内存优化过程分享
pandas内存优化分享 缘由 最近在做Kaggle上的wiki文章流量预测项目,这里由于个人电脑配置问题,我一直都是用的Kaggle的kernel,但是我们知道kernel的内存限制是16G,如下: ...
- 深入理解Java虚拟机-类加载连接和初始化解析
不管学习什么,我一直追求的是知其然,还要知其所以然,对真理的追求可以体现在方方面面.人生短短数十载,匆匆一世似烟云,我认为,既然来了,就应该留下一些有意义的东西.本系列文章是结合张龙老师的<深入 ...
- iOS使用fastlane自动化打包到fir(最全最详细流程)
# iOS使用fastlane自动化打包到fir(最全最详细流程)1. **首先确认是否安装了ruby,终端查看下ruby版本**> ruby -v终端输出:ruby 2.4.1p111 (20 ...