一、理论知识
1.静态路由
静态路由是由网络管理员手动配置在路由器上的固定路由路径。其优点是简单和对网络拓扑变化不敏感,缺点是维护复杂、易出错,且无法自动适应网络变化。
2.动态路由协议RIP
RIP是一种基于距离向量的动态路由协议。它使用跳数作为度量标准,最多支持15跳,适用于中小型网络。RIP通过周期性广播路由更新来维护路由表。
3.网络配置
PC0: IP地址:192.168.1.100,子网掩码:255.255.255.0,默认网关:192.168.1.1、PC1: IP地址:192.168.3.100,子网掩码:255.255.255.0,默认网关:192.168.3.2、R1: f0/0: 192.168.2.1/24, f0/1: 192.168.1.1/24
R2: f0/0: 192.168.2.2/24, f0/1: 192.168.3.2/24
二、实验步骤
一、静态路由的配置
1.为路由器重命名并配置IP地址
①R1配置

②R2配置

③在R1上添加静态路由条目

④在R2上添加静态路由条目

⑤PC的配置
PC0
IP地址:192.168.1.100
子网掩码:255.255.255.0
默认网关:192.168.1.1
PC1
IP地址:192.168.3.100
子网掩码:255.255.255.0
默认网关:192.168.3.2
⑥测试PC间是否能通信
通过Ping命令测试PC0到PC1的连通性

2.动态路由RIP的配置
①删除静态路由条目
R1删除静态路由

R2删除静态路由

②R1的RIP配置

③R2的RIP配置

④测试网络连通性
通过Ping命令测试PC0到PC1的连通性

三、运行截图
1.配置路由器R1:

2.配置路由器R2:

3.配置pc0:默认网关等于路由器接口配置的ip

4.配置pc1:默认网关等于路由器接口配置的ip

5.在R1上添加静态路由条目

6.在R2上添加静态路由条目:

7.测试连通性:

8.R1删除添加的静态路由条目

9.R2删除添加的静态路由条目

10.配置R1的rip:

11.配置R2的rip:

12.测试连通性:

13.查看R1中的路由表:

14.查看路由表中rip产生的路由条目:
