静态路由:由用户管理员在路由器中手动配置,所以当网络的拓扑结构或链路的状态发生变化时,需要我们手动修改路由表里面的相关信息
实验一:两台pc通过两台路由建立通信
拓扑图:
![](https://img-blog.csdnimg.cn/img_convert/d69536bf833a429ba29363fa9d494bb6.png)
PS:记得启动所有设备
实验过程:
①配置两台PC机的IP地址、子网掩码、网关,配置完务必点击应用
![](https://img-blog.csdnimg.cn/img_convert/f552aab7dc9c443e9e1a5ab3a11d2e28.png)
②对两个路由器命名为R1,R2,并设置两个路由的端口的网段(IP地址+子网掩码)。
以R1,g0/0/1端口举例,其余同理不做论述
![](https://img-blog.csdnimg.cn/img_convert/8d058fdd57b64fc8b8ec767905045f28.jpeg)
③设置R1 R2静态路由
![](https://img-blog.csdnimg.cn/img_convert/825cea22b79f4101b41258acc0eb60bf.png)
R2操作步骤与上图相同,IP地址反之(ip route-static 192.168.1.0 255.255.255.0 192.168.3.1)
④ 两台PC机互ping测试,连通即为成功
PC1:
![](https://img-blog.csdnimg.cn/img_convert/bc2c0f332c934920a84aff8b0f6577ff.png)
PC2:
![](https://img-blog.csdnimg.cn/img_convert/cecbf9bad2f942c9b9ed7849f4fd447f.png)
实验二:两台PC机通过三台路由建立通信(引入静态默认路由)
拓扑图:
![](https://img-blog.csdnimg.cn/img_convert/d692b1fdca9a4cb9b86c48bafb46e06a.png)
第一步,第二步,和实验一操作完全一致,注意第二步,增加了一个路由,以相同方式为它设置相关数据
R1(R3同理):
![](https://img-blog.csdnimg.cn/img_convert/1c08b89e268d4a35a6e8704fb940ea4a.png)
R2:
![](https://img-blog.csdnimg.cn/img_convert/2d06e7b3793f4b9bb3f6165cd8b3dab8.png)
连接PC2操作反之同理
第四步测试结果
![](https://img-blog.csdnimg.cn/img_convert/372c7c5016d24109af50f0d67cbc950e.png)
![](https://img-blog.csdnimg.cn/img_convert/24cd198d31614bf7aed7d0d12ff5fa92.png)
实验三:浮动路由
拓扑图:
![](https://img-blog.csdnimg.cn/img_convert/89929519c85041d58709d2f00b884227.png)
前两部原理于实验一并不区别,故略静态默认路由
ps:R1 R2,因不是指向唯一路由器,故不能设置
第三步:设置静态路由
主路由:
R1:
![](https://img-blog.csdnimg.cn/img_convert/ab1dc980e7164f1fa2c66cfec37b106b.png)
R2:
![](https://img-blog.csdnimg.cn/img_convert/1a60b0362fb5462f81c382691256b6e4.png)
R3:
PC1
![](https://img-blog.csdnimg.cn/img_convert/25453114aa6a4fb68113e7ee4412aa66.png)
PC2
![](https://img-blog.csdnimg.cn/img_convert/1d3bc8750c9043c1b13ec1c391012168.png)
浮动路由:
R1:
![](https://img-blog.csdnimg.cn/img_convert/eb5d61ae4eab4726ab61d1f0d1fa3d23.png)
R2:
![](https://img-blog.csdnimg.cn/img_convert/9caf22336c864876ae2d5aab976d86ed.png)
第四步测试结果
①从主路由ping,测试成功
![](https://img-blog.csdnimg.cn/img_convert/2e0587081870450c9835503d5e6b3a44.png)
②将主路由断开(断开主路由接口shutdown),测试成功
![](https://img-blog.csdnimg.cn/img_convert/19fbb7d6729e4a978d7e92e34d683cc6.png)
![](https://img-blog.csdnimg.cn/img_convert/26e1f7cc68214da48923459e117ad697.png)
![](https://img-blog.csdnimg.cn/img_convert/2034484f21584abca9924e8184b8691d.png)