您的位置:首页 > 理论基础 > 计算机网络

用 GNS3 做CCNA网络实验(5)

2013-06-23 23:37 232 查看
网络应用网络协议企业应用.net

用 GNS3 做CCNA网络实验(5)

8. 路由实验: RIP

RIP 和 RIP V2 的配置是最基础的路由协议配置操作,理解了 RIP 的配置,其他的动态路由协议的配置应该就很容易掌握。RIP 路由协议虽然比较古老了,但对以中小型的企业网络,还是很有用途的。而且,现在的 Linksys 宽带/无线 路由器,都支持RIP协议来构建桥接多个网段,有实际应用价值。



(1) 准备实验

我们假定是关闭 GNS3 后重新打开 GNS3 开始新的实验。

先为这次实验准备一个子目录,例如 在 gns3Project 下建一个子目录 rip1.

在 GNS3 打开我们以前保存的已经测试过的 topology, 例如 router1.net 然后装入配置文件。

在 GNS3 菜单 File -> Save topology as 把这个 topology 改名为 rip1.net 并保存 到 rip1 子目录下。

在 菜单 File -> Import/Export 选 Export to a directory 把原来的配置卸出到子目录 rip1 下。

这样,下面的实验所用到的 topology 和配置文件均保存在这个子目录下。



现在 启动各个路由器 (R1,R2,PC1,和 PC2),并打开各个 控制台 Console。





(2) 查看路由协议配置前的路由信息



R1:







R2:







(3) 配置路由器



R1:



从路由信息我们可以看到, R1 直接与2 个网段(192.168.100.0 和 172.17.1.0) 相连。但这2个网段的数据包并不直接通过,我们就需要启用 RIP 路由协议来让数据包通过:





C代码







R1#
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#network 192.168.100.0
R1(config-router)#network 172.17.1.0
R1(config-router)#^Z
R1#

R1#
R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#network 192.168.100.0
R1(config-router)#network 172.17.1.0
R1(config-router)#^Z
R1#




R2:



R2 直接与2 个网段(192.168.110.0 和 172.17.1.0) 相连,我们启用 RIP 路由协议来让数据包通过:



C代码







R2#
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#network 192.168.110.0
R2(config-router)#network 172.17.1.0
R2(config-router)#^Z
R2#
R2#copy runn start
Destination filename [startup-config]?
Building configuration...
[OK]
R2#

R2#
R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#network 192.168.110.0
R2(config-router)#network 172.17.1.0
R2(config-router)#^Z
R2#
R2#copy runn start
Destination filename [startup-config]?
Building configuration...
[OK]
R2#







(4) 测试



从 PC2 ping



C代码







PC2>ping 192.168.100.254

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.100.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 616/976/1772 ms

PC2>ping 192.168.100.10

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.100.10, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 980/1034/1100 ms
PC2>

PC2>ping 192.168.100.254

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.100.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 616/976/1772 ms

PC2>ping 192.168.100.10

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.100.10, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 980/1034/1100 ms
PC2>

从 PC1 ping



C代码







PC1#
PC1#ping 192.168.110.253

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.110.253, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 576/648/716 ms

PC1#ping 192.168.110.22

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.110.22, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1016/1128/1228 ms
PC1#

PC1#
PC1#ping 192.168.110.253

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.110.253, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 576/648/716 ms

PC1#ping 192.168.110.22

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.110.22, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1016/1128/1228 ms
PC1#

呵呵,3个网段是连通的了,数据包可以100%通过。





(5) 启用路由协议后的路由信息



R1:







R2:











下一步我们尝试 OSPF 的配置。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: