路由与交换技术-21-RIP路由选择协议

目录

一、RIP动态路由协议

1.1 基本概念

1.2 RIP更新时间

1.3 RIP路由版本

1.3.1 RIP V1

1.3.2 RIP V2

1.4 RIP配置

1.5 实验验证

1.5.1 配置RIP V1

1.5.2 配置RIP V2


一、RIP动态路由协议

1.1 基本概念

RIP(Routing Information Protocol)路由选择协议,是一种内部网关IGP协议,属于动态路由协议,用于单一自治系统(AS)内的路由信息传递

 RIP协议要求网络中的每一个路由器都要维护从它自己到其他每一个目的网络的距离记录(距离向量)。RIP协议对距离的定义如下:

  (1) 从一路由器到直接连接的网络的距离定义为1。

  (2) 从一路由器到非直接连接的网络的距离定义为所经过的路由器数加1。

RIP基于距离矢量算法,使用“跳数”(即Metric)来衡量到达目的地址的路由距离

最大跳数是15跳,16跳不可达

1.2 RIP更新时间

每隔30s向相邻的路由器发送路由更新信息,使用UDP协议,520端口

RIP路由表形成

如图,首先路由器配置好接口IP地址,将自动生成直连路由,根据RIP更新周期,达到30s时,路由器会向邻居发送自己的直连路由信息,再过30s再次发送自己的路由表信息

RIP路由更新,发送的是整个路由表信息,包括直连的和非直连的

1.3 RIP路由版本

1.3.1 RIP V1

(有类路由协议,采用标准子网掩码)

1.广播更新,向所有路由广播,不管他是否运行了RIP协议

2.不支持VLSM(可变长子网掩码,即非标准子网掩码)

3.自动路由汇总,不可手动关闭 (比如:10.10.10.0/24  10.10.10.20.0/24 汇总成10.10.0.0/16)

4.不支持非连续子网

1.3.2 RIP V2

(无类路由协议,支持非标准子网掩码)

1.采用组播更新(只会向运行了RIP路由协议的路由器发送更新消息)

2.支持VLSM可变长子网掩码

3.自动路由汇总,可以手动关闭

4.支持不连续子网

1.4 RIP配置

1启动RIP协议

Router(config)#route rip

Router(config-router)#

2宣告直连网段

Router(config-router)#192.168.10.0

Router(config-router)#192.168.20.0

1.5 实验验证

1.5.1 配置RIP V1

R1

Router(config)#route rip

Router(config-router)#network 192.168.10.0

Router(config-router)#network 192.168.20.0

Router(config-router)#network 192.168.30.0

Router(config-router)#

R2

Router(config)#router rip

Router(config-router)#network 192.168.20.0

Router(config-router)#network 192.168.40.0

Router(config-router)#exit

R3

Router(config)#router rip

Router(config-router)#network 192.168.30.0

Router(config-router)#network 192.168.40.0

Router(config-router)#network 192.168.50.0

查看R2的路由表信息

1.5.2 配置RIP V2

默认是v1版本

多了一条命令

Router(config)#route rip

Router(config)#version 2

Router1(config)#router rip

Router1(config-router)#version 2

Router1(config-router)#network 192.168.10.0

Router1(config-router)#network 192.168.10.64

Router2(config)#router rip

Router2(config-router)#version 2

Router2(config-router)#network 192.168.10.64

Router2(config-router)#network 192.168.10.128

Router2(config-router)#

Router3(config)#router rip

Router3(config-router)#version 2

Router3(config-router)#network 192.168.10.128

Router3(config-router)#network 192.168.10.192

Router3(config-router)#

查看路由表

关闭自动汇总

需要在宣告网段之前进行关闭,不然此命令无效

Router3(config-router)#no auto-summary

猜你喜欢

转载自blog.csdn.net/weixin_46232917/article/details/127011934
今日推荐