动态路由协议包括距离矢量路由协议和链路状态路由协议。RIP(Routing InformationProtocols,路由信息协议)是使用最广泛的距离矢量路由协议。RIP 是为小型网络环境设计的,因为这类协议的路由学习及路由更新将产生较大的流量,占用过多的带宽。<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
     RIP 协议分为版本1 和版本2。不论是版本1或版本2,都具备下面的特征:
1. 是距离向量路由协议;
2. 使用跳数(Hop Count)作为度量值;
3.默认路由更新周期为30 秒;
4. 管理距离(AD)为120;
5. 支持触发更新;
6. 最大跳数为15 跳;
7. 支持等价路径,默认4 条,最大6 条;
8. 使用UDP520 端口进行路由更新。
通过下面的实验来学习RIPv1和RIPv2的配置:
在路由器上启动RIPv1进程
(1)    步骤1:配置路由器R1
R1(config)#router rip                   //启动RIP进程
R1(config-router)#version 1             //配置RIP版本1
R1(config-router)#network <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />1.0.0.0       //宣告直连网段
R1(config-router)#network 192.168.1.0
(2)步骤2:配置路由器R2
R2(config)#router rip
R2(config-router)#version 1
R2(config-router)#network 192.168.1.0
R2(config-router)#network 192.168.2.0
(3)步骤3:配置路由器R3
R3(config)#router rip
R3(config-router)#version 1
R3(config-router)#network 192.168.2.0
R3(config-router)#network 192.168.3.0
(4)步骤4:配置路由器R4
R4(config)#router rip
R4(config-router)#version 1
R4(config-router)#network 192.168.3.0
R4(config-router)#network 4.0.0.0
调试:(1)使用show ip route 命令查看路由表
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
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
R    4.0.0.0/8 [120/3] via 192.168.1.2, 00:00:14, Ethernet0/0
C    192.168.1.0/24 is directly connected, Ethernet0/0
R    192.168.2.0/24 [120/1] via 192.168.1.2, 00:00:14, Ethernet0/0
R    192.168.3.0/24 [120/2] via 192.168.1.2, 00:00:14, Ethernet0/0
以上输出表明路由器R1 学到了3 条RIP 路由,其中路由条目“R 4.0.0.0/8 [120/3]via 192.168.1.2, 00:00:14, Ethernet0/0”的含义如下:
① R:路由条目是通过RIP 路由协议学习来的;
② 4.0.0.0/8:目的网络;
③ 120:RIP 路由协议的默认管理距离;
④ 3: 度量值,从路由器R1 到达网络4.0.0.0/8 的度量值为3 跳;
⑤ 192.168.1.2:下一跳地址;
⑥ 00:00:14:距离下一次更新还有16(30-14)秒;
⑦ Ethernet0/0:接收该路由条目的本路由器的接口。
同时通过该路由条目的掩码长度可以看到,RIPv1 确实不传递子网信
(2)show ip protocol:该命令查看IP 路由协议配置和统计信息。
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 22 seconds
  Invalid after 180 seconds, hold down 180, flushed after 240
  Redistributing: rip
  Default version control: send version 1, receive version 1
    Interface             Send  Recv  Triggered RIP  Key-chain
    Ethernet0/0           1     1
    Loopback0             1     1
  Automatic network summarization is in effect
  Maximum path: 4
  Routing for Networks:
    1.0.0.0
    192.168.1.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    192.168.1.2          120      00:00:08
  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 22 seconds
//更新周期是30 秒,距离下次更新还有22 秒
Redistributing: rip
//只运行RIP 协议,没有其它的协议重分布进来
Default version control: send version 1, receive version 1
//默认发送版本1 的路由更新,接收本版1 的路由更新
Interface             Send  Recv  Triggered RIP  Key-chain
    Ethernet0/0           1     1
    Loopback0             1     1
Automatic network summarization is in effect
//RIP 路由协议默认开启自动汇总功能
Maximum path: 4
//RIP 路由协议可以支持4 条等价路径,最大为6
【提示】
可以通过下面的命令来修改RIP 路由协议支持等价路径的条数:
R1(config-router)#maximum-paths number-paths
 
(3)debug ip rip:查看RIP 路由协议的动态更新过程。
R1#debug ip rip
RIP protocol debugging is on
R1#
*Mar  1 00:46:53.487: RIP: received v1 update from 192.168.1.2 on Ethernet0/0
*Mar  1 00:46:53.487:      4.0.0.0 in 3 hops
*Mar  1 00:46:53.491:      192.168.2.0 in 1 hops
*Mar  1 00:46:53.491:      192.168.3.0 in 2 hops
*Mar  1 00:46:58.747: RIP: sending v1 update to 255.255.255.255 via Loopback0 (1.1.1.1)
*Mar  1 00:46:58.747: RIP: build update entries
*Mar  1 00:46:58.747:   network 4.0.0.0 metric 4
*Mar  1 00:46:58.751:   network 192.168.1.0 metric 1
*Mar  1 00:46:58.751:   network 192.168.2.0 metric 2
*Mar  1 00:46:58.751:   network 192.168.3.0 metric 3
*Mar  1 00:46:59.347: RIP: sending v1 update to 255.255.255.255 via Ethernet0/0(192.168.1.1)
*Mar  1 00:46:59.347: RIP: build update entries
*Mar  1 00:46:59.347:   network 1.0.0.0 metric 1
通过以上输出,可以看到RIPv1 采用广播更新(255.255.255.255)
在路由器上启动RIPv2进程
(1)步骤1:配置路由器R1
R1(config)#router rip        //启动RIP进程
R1(config-router)#version 2   //配置RIP版本2
R1(config-router)#no auto-summary   //关闭自动汇总
R1(config-router)#network 1.0.0.0
R1(config-router)#network 192.168.1.0
(2)步骤2:配置路由器R2
R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#no auto-summary
R2(config-router)#network 192.168.1.0
R2(config-router)#network 192.168.2.0
(3)步骤3:配置路由器R3
R3(config)#router rip
R3(config-router)#version 2
R3(config-router)#no auto-summary
R3(config-router)#network 192.168.2.0
R3(config-router)#network 192.168.3.0
(4)步骤4:配置路由器R4
R4(config)#router rip
R4(config-router)#version 2
R4(config-router)#no auto-summary
R4(config-router)#network 192.168.3.0
R4(config-router)#network 4.0.0.0
调试:(1)使用show ip route 命令查看路由表
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
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
    4.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
R   4.4.4.0/24 [120/3] via 192.168.1.2, 00:00:22, Ethernet0/0
C    192.168.1.0/24 is directly connected, Ethernet0/0
R    192.168.2.0/24 [120/1] via 192.168.1.2, 00:00:11, Ethernet0/0
R    192.168.3.0/24 [120/2] via 192.168.1.2, 00:00:11, Ethernet0/0
从上面输出的路由条目“4.4.4.0/24”,可以看到RIPv2 路由更新是携带子网信息
(2)show ip protocol:该命令查看IP 路由协议配置和统计信息。
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 2 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
    Ethernet0/0           2     2
    Loopback0             2     2
  Automatic network summarization is not in effect
  Maximum path: 4
  Routing for Networks:
    1.0.0.0
    192.168.1.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    192.168.1.2          120      00:00:23
  Distance: (default is 120)
// RIPv2 默认情况下只接收和发送版本2 的路由更新
【提示】
可以通过命令“ip rip send version”和“ip rip receive version”来控制在路由器接口上接收和发送的版本,例如在Ethernet0/0 接口上接收版本1 和2 的路由更新,但是只发送版本2 的路由更新,配置如下:
R1(config-if)#ip rip send version 2
R1(config-if)#ip rip receive version 1 2
(3)通过debug ip rip 命令查看RIP 路由协议的动态更新过程。
R1#debug ip rip
RIP protocol debugging is on
*Mar  1 01:37:27.119: RIP: received v2 update from 192.168.1.2 on Ethernet0/0
*Mar  1 01:37:27.119:      4.4.4.0/24 via 0.0.0.0 in 3 hops
*Mar  1 01:37:27.123:      192.168.2.0/24 via 0.0.0.0 in 1 hops
*Mar  1 01:37:27.123:      192.168.3.0/24 via 0.0.0.0 in 2 hops
*Mar  1 01:37:29.627: RIP: sending v2 update to 224.0.0.9 via Ethernet0/0 (192.1
68.1.1)
*Mar  1 01:37:29.627: RIP: build update entries
*Mar  1 01:37:29.627:   1.1.1.0/24 via 0.0.0.0, metric 1, tag
通过以上输出,可以看到RIPv2 采用组播更新(224.0.0.9)
 

转载于:https://blog.51cto.com/shani/369631

动态路由协议(RIP)相关推荐

  1. cisco 动态路由协议RIP笔记

    动态路由协议RIP router(config)#router rip  启动RIP进程 router(config-router)#network 1.0.0.0  宣告主网络号 router(co ...

  2. 动态路由协议RIP配置和动态路由协议OSPF配置

    实验十二 动态路由协议RIP配置 1 实验目的 (1)掌握动态路由协议的原理. (2)掌握经典动态路由协议RIP的原理及过程. (3)掌握动态路由协议RIP的配置过程. 2 实验内容 (1)依据相应的 ...

  3. 动态路由协议—RIP OSPF

    转载自动态路由协议--RIP路由协议 RIP支持的最大跳数是15,超过15就认为目的不可达. 每过一个路由器,跳数+1,当跳数=16时,丢弃. RIP分为V1和V2两个版本. RIP运行在园区网内部. ...

  4. 计算机网络实验ripv2配置,实验六 动态路由协议RIP初步配置

    <实验六 动态路由协议RIP初步配置>由会员分享,可在线阅读,更多相关<实验六 动态路由协议RIP初步配置(11页珍藏版)>请在人人文库网上搜索. 1.南昌大学实验报告学生姓名 ...

  5. 动态路由协议——RIP概述+实战

    目录 一.动态路由概述 1.1 动态路由特点 1.2 动态路由依赖机制 二.静态路由和动态路由 三.动态路由协议概述 3.1 动态路由协议--度量值 3.2 动态路由协议--收敛 3.3 动态路由协议 ...

  6. 动态路由协议RIP的基本原理与配置

      前面学习了静态路由的原理,但是用静态路由搭建网络时,每一条路由的变更都需要手动进行配置,这在大型网络中的工作量是非常巨大的.有没有办法解决呢?答案是肯定的,使用动态路由即可解决此问题 动态路由协议 ...

  7. 【CyberSecurityLearning 19】NAT与动态路由协议RIP

    目录 NAT NAT实验演示: 动态路由概述 动态路由协议 动态路由协议分类 RIP路由协议工作原理 路由表的形成​ RIP的度量值与更新时间 路由环路 水平分割 RIP的配置和验证 小实验: 综合实 ...

  8. 动态路由协议RIP的深层配置学习

    动态路由协议: 动态路由相比静态路由的区别在于,动态路由是基于拓扑变化而收敛的路由协议.这使得动态路由更适用于复杂的大型网络(静态路由协议需要手工配置,工程量较大).当然动态路由有其他的问题:然如安全 ...

  9. 计算机网络配置RIP路由协议,动态路由协议RIP配置,带你一分钟学会

    一.动态路由RIP产生背景 1.动态路由协议包括距离向量路由协议和链路状态路由协议.RIP(Routing Information Protocols,路由信息协议)是使用最广泛的距离向量路由协议.R ...

  10. 动态路由协议 RIP

    作用:公告直连网段 距离矢量型 很少使用 根据每个路由器的广播,更新自己的路由表 标记上该路由来自哪个端口,并标记距离 当某个网络无法到达时,容易发生路由环路 造成学习了错误的路由表,数据在两个路由器 ...

最新文章

  1. Google用更少标签生成图像,还提出一个用于训练评估GAN的库
  2. python09-魔法方法
  3. Nginx日志配置详解
  4. echo输出不重复行到文件 shell_Shell脚本echo指令使用小技巧
  5. 修改 font的文本信息_C#窗体,文本框如何实现类似html的输入提示信息
  6. icem二维非结构网格划分_“白皮书”系列No.26——科研小工具之ICEM
  7. cad卸载_CAD卸载不干净,如何清理CAD注册表
  8. IP地址规划和设计方法
  9. DeepLog:基于系统日志使用深度学习方法做异常检测和诊断
  10. Vue Tags Input
  11. 使用Unity连接Bmob后端云
  12. ESP32学习笔记(1)——搭建环境、编译烧写(Windows+VS Code)
  13. 点评“最好的300款免费软件”
  14. 揭秘子宫里的动物:小袋鼠仅软糖大小
  15. python使用国内源安装包
  16. 射频电子学基础:射频模拟电路概述
  17. Switchable Normalization
  18. MyBatis 学习笔记 - 2021-7-10 - 2021-7-13
  19. c语言结构体定义坐标,C语言结构体定义的方式
  20. Tortoises SVN 教程

热门文章

  1. 随机排列_“按字母顺序排列”其实是种随机顺序
  2. 全国计算机等级考试题库二级C操作题100套(第20套)
  3. linux怎么用命令备份数据库,使用linux的mysqlhotcopy命令备份数据库
  4. 王者荣耀6月23服务器维护,王者荣耀6.23维护到什么时候?6月23日长枪掠火版本异常介绍...
  5. mysql网络订餐系统截屏_在线订餐系统mysql字段
  6. mysql 数据回滚_Mysql数据误删除快速回滚
  7. 设计模式之模版方法模式demo
  8. 策略模式在jdk Arrays 中使用
  9. js实现modbus_nodejs中使用modbus-serial库创建Modbus TCP读取设备的数据
  10. 数据库:MySQL、SqlServer、Oracle对比