RIP协议在简单网络架构的使用

目录

注意:本文的配置为上文《复杂园区网基本分支的构建》拓展,主要记录rip协议在简单网络架构的使用。

RIP(Routing Information Protocol,路由信息协议)是一种基于距离向量算法的内部网关协议(IGP),用于在局域网或广域网中交换路由信息。

基本概念

  • 距离向量算法:RIP使用距离向量算法来计算到达目的地的最佳路径。每个路由器维护一个路由表,记录到达每个目的地的距离和下一跳路由器。距离通常以跳数(hop count)来表示。
  • 跳数(Hop Count):RIP使用跳数作为度量标准,跳数表示从源到目的地之间经过的路由器数量。RIP协议的最大跳数限制为15跳,超过15跳的网络被视为不可达。

路由更新机制

  • 定期广播:RIP路由器每隔30秒向相邻路由器广播自己的路由表信息。这种定期广播机制确保网络中的路由信息能够及时更新。
  • 触发更新:当路由器的路由表发生变化时(如发现更优路径或路径失效),会立即向相邻路由器发送触发更新,以快速传播路由变化信息。
  • 水平分割(Split Horizon):为避免路由环路,RIP采用水平分割技术。一个路由器不会向其接收路由信息的接口发送相同的路由信息。
  • 毒性逆转(Poison Reverse):当路由器从某个接口接收到路由信息后,会将该路由的跳数设置为无穷大(通常为16),再从该接口发送出去,以防止路由环路。
  • 计时器
    • 路由超时计时器:如果在180秒内未收到某个路由的更新信息,该路由将被标记为不可达。
    • 垃圾收集计时器:被标记为不可达的路由会在300秒后从路由表中删除。

特点与局限性

  • 优点
    • 实现简单:RIP协议结构简单,易于实现和维护。
    • 适合小型网络:对于小型网络或拓扑结构相对稳定的网络,RIP能够有效工作。
  • 缺点
    • 收敛速度慢:由于定期广播和跳数限制,RIP在大型网络或拓扑变化频繁的网络中收敛速度较慢。
    • 路径选择有限:最大跳数限制为15跳,限制了RIP在大型网络中的应用。
    • 路由环路风险:在复杂网络中,RIP容易产生路由环路,尽管有水平分割和毒性逆转等机制来减少环路风险,但无法完全避免。

RIP协议适用于小型、稳定的网络环境,对于大型或拓扑变化频繁的网络,通常会选择其他更先进的路由协议,如OSPF(开放最短路径优先)或EIGRP(增强内部网关路由协议)等。

场景模拟

网络拓扑

配置新加的接口

bash 复制代码
<R-1>system-view 
Enter system view, return user view with Ctrl+Z.
[R-1]interface GigabitEthernet 0/0/3
[R-1-GigabitEthernet0/0/3]ip address 10.0.0.9 30
[R-1-GigabitEthernet0/0/3]quit
[R-1]quit
<R-1>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 17.
Save the configuration successfully.
<R-1>
<R-1>
bash 复制代码
<R-3>system-view 
Enter system view, return user view with Ctrl+Z.
[R-3]interface GigabitEthernet 0/0/3
[R-3-GigabitEthernet0/0/3]ip address 10.0.0.10 30
[R-3-GigabitEthernet0/0/3]quit
[R-3]quit
<R-3>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 17.
Save the configuration successfully.
<R-3>

配置rip并测试

bash 复制代码
<RS-1>sys	
<RS-1>system-view 
Enter system view, return user view with Ctrl+Z.
[RS-1]rip 1
[RS-1-rip-1]version 2
[RS-1-rip-1]network 192.168.100.0
[RS-1-rip-1]network 192.168.101.0
[RS-1-rip-1]network 10.0.0.0
[RS-1-rip-1]quit
[RS-1]quit
<RS-1>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 0.
Save the configuration successfully.
<RS-1>
bash 复制代码
<RS-2>system-view 
Enter system view, return user view with Ctrl+Z.
[RS-2]rip 1
[RS-2-rip-1]version 2	
[RS-2-rip-1]network 192.168.102.0
[RS-2-rip-1]network 192.168.103.0
[RS-2-rip-1]network 10.0.0.0
[RS-2-rip-1]quit
[RS-2]quit
<RS-2>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 0.
Save the configuration successfully.
<RS-2>
bash 复制代码
<RS-3>system-view 
Enter system view, return user view with Ctrl+Z.
[RS-3]rip 1
[RS-3-rip-1]version 2
[RS-3-rip-1]network 192.168.104.0
[RS-3-rip-1]network 192.168.105.0
[RS-3-rip-1]network 10.0.0.0
[RS-3-rip-1]quit
[RS-3]quit
<RS-3>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 0.
Save the configuration successfully.
<RS-3>
bash 复制代码
<RS-4>system-view 
Enter system view, return user view with Ctrl+Z.
[RS-4]rip 1
[RS-4-rip-1]version 2
[RS-4-rip-1]network 192.168.106.0
[RS-4-rip-1]network 192.168.107.0
[RS-4-rip-1]network 10.0.0.0
[RS-4-rip-1]quit
[RS-4]quit
<RS-4>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 0.
Save the configuration successfully.
<RS-4>
bash 复制代码
<R-1>system-view 
Enter system view, return user view with Ctrl+Z.
[R-1]rip 1
[R-1-rip-1]version 2
[R-1-rip-1]network 10.0.0.0
[R-1-rip-1]quit
[R-1]quit
<R-1>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 17.
Save the configuration successfully.
<R-1>
bash 复制代码
<R-2>system-view 
Enter system view, return user view with Ctrl+Z.
[R-2]rip 1
[R-2-rip-1]version 2
[R-2-rip-1]network 10.0.0.0
[R-2-rip-1]quit
[R-2]quit
<R-2>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 17.
Save the configuration successfully.
<R-2>
bash 复制代码
<R-3>system-view 
Enter system view, return user view with Ctrl+Z.
[R-3]rip 1	
[R-3-rip-1]version 2
[R-3-rip-1]network 10.0.0.0
[R-3-rip-1]quit
[R-3]quit
<R-3>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 17.
Save the configuration successfully.
<R-3>

查看R-1路由表,已经可以通过动态路由协议RIP获取到达非直连网络路由,其中如图,优先级为100,度量值为2,到达目标网络需要2个路由设备。

192.168.104.0/24 RIP 100 2 D 10.0.0.10 GigabitEthernet 0/0/3

192.168.105.0/24 RIP 100 2 D 10.0.0.10 GigabitEthernet 0/0/3

192.168.106.0/24 RIP 100 2 D 10.0.0.10 GigabitEthernet 0/0/3

192.168.107.0/24 RIP 100 2 D 10.0.0.10 GigabitEthernet 0/0/3

最后测试通信情况,每两台主机之间能够互相通信。

相关推荐
知之则吱吱1 小时前
亚马逊AWS云服务器高效使用指南:最大限度降低成本的实战策略
服务器·云计算·aws
season_zhu1 小时前
Swift:优雅又强大的语法糖——Then库
ios·架构·swift
cui_win1 小时前
每日一令:Linux 极简通关指南 - 汇总
linux·运维·服务器
狐571 小时前
2025-06-02-IP 地址规划及案例分析
网络·网络协议·tcp/ip
知星小度S1 小时前
Linux权限探秘:驾驭权限模型,筑牢系统安全
linux·运维·服务器
黎茗Dawn1 小时前
5.子网划分及分片相关计算
网络·智能路由器
恰薯条的屑海鸥2 小时前
零基础在实践中学习网络安全-皮卡丘靶场(第十四期-XXE模块)
网络·学习·安全·web安全·渗透测试
科技小E2 小时前
口罩佩戴检测算法AI智能分析网关V4工厂/工业等多场景守护公共卫生安全
网络·人工智能
御承扬2 小时前
从零开始开发纯血鸿蒙应用之网络检测
网络·华为·harmonyos
hstar95272 小时前
二、即时通讯系统设计经验
java·架构