RIP协议介绍
RIP(路由信息协议)是一种基于距离向量的内部网关协议,适用于小型网络。它通过跳数(最多15跳)衡量路径成本,定期与相邻路由器交换路由表。RIPv1使用广播更新且不支持子网,RIPv2新增组播、VLSM和简单认证功能。RIP实现简单,但收敛速度慢,仅适合拓扑稳定的环境。其最大缺点为跳数限制和路由循环风险,现逐渐被OSPF等协议替代。
拓扑图
如下图所示,目的是让R1ping通R4,所有路由器采用rip协议进行。下面我们使用eNSP软件进行实验操作。
路由器全部选用Router
连接线全部选用Serial
配置
R1上进行如下配置
//进入系统
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
//关闭提示
[Huawei]un in en
Info: Information center is disabled.
//修改设备名称为R1
[Huawei]sys R1
//进入s0/0/0端口
[R1]int s0/0/0
//设置端口ip
[R1-Serial0/0/0]ip add 192.168.11.1 24
//设置rip协议
[R1-Serial0/0/0]rip
//添加直连网络地址(标准地址)
[R1-rip-1]network 192.168.11.0
//退出
[R1-rip-1]q
//退出
[R1]q
//保存配置
<R1>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
Now saving the current configuration to the slot 17.
Save the configuration successfully.
R2上进行如下配置
//进入系统
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
//关闭提示
[Huawei]un in en
Info: Information center is disabled.
//将设备重命名为R2
[Huawei]sys R2
//进入s0/0/0端口
[R2]int s0/0/0
//设置端口ip
[R2-Serial0/0/0]ip add 192.168.11.2 24
//进入s0/0/1端口
[R2-Serial0/0/0]int s0/0/1
//设置端口ip
[R2-Serial0/0/1]ip add 192.168.22.1 24
//配置rip协议
[R2-Serial0/0/1]rip
//指定直连网段地址
[R2-rip-1]network 192.168.11.0
[R2-rip-1]network 192.168.22.0
//退出
[R2-rip-1]q
[R2]q
//保存配置
<R2>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
Now saving the current configuration to the slot 17.
Save the configuration successfully.
R3上进行如下配置
//进入系统
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
//关闭提示
[Huawei]un in en
Info: Information center is disabled.
//设备重命名为R3
[Huawei]sys R3
//进入s0/0/1端口
[R3]int s0/0/1
//配置ip
[R3-Serial0/0/1]ip add 192.168.22.2 24
//进入s0/0/2端口
[R3-Serial0/0/1]int s0/0/2
//配置ip
[R3-Serial0/0/2]ip add 192.168.33.1 24
//配置rip协议
[R3-Serial0/0/2]rip
//指定直连网段
[R3-rip-1]network 192.168.22.0
[R3-rip-1]network 192.168.33.0
//退出
[R3-rip-1]q
[R3]q
//保存配置
<R3>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
Now saving the current configuration to the slot 17.
Save the configuration successfully.
R4上进行如下配置
//进入系统
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
//关闭提示
[Huawei]un in en
Info: Information center is disabled.
//设备重命名为R4
[Huawei]sys R4
//进入s0/0/2端口
[R4]int s0/0/2
//配置ip
[R4-Serial0/0/2]ip add 192.168.33.2 24
//配置rip协议
[R4-Serial0/0/2]rip
//指定直连网段
[R4-rip-1]network 192.168.33.0
//退出
[R4-rip-1]q
[R4]q
//保存配置
<R4>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
Now saving the current configuration to the slot 17.
Save the configuration successfully.
验证测试
如下图所示,使用R1可以ping通R4,实验成功!