当前位置:网站首页>交换机和路由器技术-21-RIP路由协议
交换机和路由器技术-21-RIP路由协议
2022-08-11 04:44:00 【w辣条小王子】
目录
一、RIP动态路由协议
1.1 基本概念:
路由信息协议(RIP、Routing Information Protocol)。它是一种较为简单的内部网关协议
,主要用于规模较小的网络中。RIP是一种基于距离矢量(Distance-Vector)算法的协议。在单一自治系统中传递路由信息。
RIP使用跳数(Hop Count)来衡量到达目的地址的距离,称为度量值。在RIP中,默认情况下,路由器到与它直接相连网络的跳数为0,通过一个路由器可达的网络的跳数为1,其余依此类推。也就是说,度量值等于从本网络到达目的网络间的路由器数量。为限制收敛时间,RIP规定度量值取0~15之间的整数,大于或等于16的跳数被定义为无穷大,即目的网络或主机不可达。由于这个限制,使得RIP不可能在大型网络中得到应用。
每隔30S向相邻的路由器发送路由更新消息,它通过UDP报文进行路由信息的交换,使用的端口号为520,从相邻的路由器学习对应的路由条目R1不会直接学习到R3的路由
1.2 学习路由过程
初始状态
(获取直连路由信息)

启用RIP协议
在第一个更新时间周期里,R1、R2、R3都宣告自己的路由信息,并且学习各自相邻路由信息。

第二个时间周期里,三个路由会将自己的已经学习到的路由和原来的一起宣告出去,并且学习各自相邻路由信息。

1.3 RIP的版本
RIPv1
有类路由协议(采用标准子网掩码)。
广播更新,向所有直连路由发送更新信息。
不支持VLSM(可变长子网掩码,非标准子网掩码)。
自动路由汇总,不可关闭
将长的子网掩码汇总成短的
(192.168.20/24、192.168.10.0/24 汇总成192.168.0.0/16)
不支持不连续子网
10.0.0.0/8 172.16.0.0/24 就无法汇总
Router(config)#route rip 默认就是v1版本
RIPv2
无类路由协议(可以使用非标准子网掩码)
组播更新(只会向运行了RIP的路由器发送更新消息)
支持VLSM
自动路由汇总,可以关闭
支持不连续的子网
1.4RIP的配置
1.4.1 RIPv1 的配置
Route rip
Network 网段
路由表中R就是RIP协议学习到的、他会根据最近的跳数去生成路由

首先配置好各个路由器的每个接口IP地址和子网掩码
然后配置RIP,让路由器宣告与他直连的所有网段
以路由器0为例
Router(config)#route rip //默认版本v1
Router(config-router)#network 192.168.10.0
Router(config-router)#network 192.168.30.0
Router(config-router)#network 192.168.40.0
每个路由器均需要完成直连网段的宣告。配置和上面一致,将网段换掉
从route0 到route2即从10网段到50网段可以有两种方式,跳数一样,但是到达网段20走下面的跳数会少一些,所以到达20的网段只会有一条

1.4.2 RIPv12的配置
配置RIP Versin 2版本,多了一条version 2的命令
最大的优势就在于支持自动汇总关闭,支持不连续子网;组播方式发送宣告信息

首先配置好各个路由器的每个接口IP地址和子网掩码
然后配置RIP,配置RIP版本,然后让路由器宣告与他直连的所有网段
以配置路由器4为例
Router#conf t
Router(config)#route rip
Router(config-router)#version 2
Router(config-router)#network 192.168.100.0
Router(config-router)#network 192.168.100.64
查看路由器4的路由学习·情况,显示已经成功学习到128和192网段,而且汇总成了192.168.100.0/24的子网掩码

如果不想要自动汇总,那么需要使用命令no auto-summary(宣告之前关闭自动汇总才有效)
需要在每条路由器宣告之前关闭才有效
Router#conf t
Router(config)#route rip
Router(config-router)#no auto-summary
边栏推荐
- 一种基于共识机制的数字集群终端防失控方案研究
- 交换机和路由器技术-36-端口镜像
- 洛谷P1763 埃及分数
- Clang Code Model: Error: The clangbackend executable “X:/clangbackend.exe“ could not be started
- Use jackson to parse json data in detail
- 如何缓解压力、拒绝内耗【1】
- "3 Longest Substring Without Repeating Characters" on the 17th day of LeetCode brushing
- Word2021 中的图片保存后就变模糊了
- js uses the string as the js execution code
- What is machine learning?Explain machine learning concepts in detail
猜你喜欢

Get Qt installation information: including installation directory and various macro addresses

CAN/以太网转换器 CAN与以太网互联互通

Layered Architecture & SOA Architecture

LeetCode814 Math Question Day 15 Binary Tree Series Value "814 Binary Tree Pruning"

如何将360全景图导出高清短视频分享到视频平台上?

《卫星界》刊评“星辰大海”计划:孙宇晨为太空旅游带来新的机遇

Where can machine learning be applied?What is machine learning useful for?

Self-research capability was recognized again, and Tencent Cloud Database was included in the Forrester Translytical report

0基础转行软件测试,自学3个月,浅拿12k*13薪offer

"3 Longest Substring Without Repeating Characters" on the 17th day of LeetCode brushing
随机推荐
jwsManager服务接口实现类-jni实现
Where can machine learning be applied?What is machine learning useful for?
关于数据分页显示
如何将360全景图导出高清短视频分享到视频平台上?
0 Basic software test for career change, self-study for 3 months, 12k*13 salary offer
findViewById返回null的问题
1815. Get the maximum number of groups of fresh donuts state compression
校园兼职平台项目反思
-填涂颜色-
To break the bottleneck of transactional work, the gentleman signs the electronic contract to release the "source power" of HR!
The principle, architecture, implementation, practice of "transfer" and "search", no need to be afraid of interviews
shell monitors gpu usage
交换机和路由器技术-33-静态NAT
"104 Maximum Depth of Binary Trees" in LeetCode's Day 12 Binary Tree Series
利用Navicat Premium导出数据库表结构信息至Excel
Alibaba Cloud releases 3 high-performance computing solutions
2022新员工公司级安全教育基础培训(118页)
[Actual combat scene] Mall-discount event design plan
洛谷P2245 星际导航
洛谷P1763 埃及分数