用 GNS3 做CCNA网络实验(5)

来源:互联网 发布:什么叫客户网络情况 编辑:程序博客网 时间:2024/06/06 01:05
网络应用网络协议企业应用.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代码 复制代码 收藏代码
  1. R1#   
  2. R1#conf t   
  3. Enter configuration commands, one per line.  End with CNTL/Z.   
  4. R1(config)#   
  5. R1(config)#router rip   
  6. R1(config-router)#version 2   
  7. R1(config-router)#network 192.168.100.0   
  8. R1(config-router)#network 172.17.1.0   
  9. R1(config-router)#^Z   
  10. R1#  
 


 R2:

 

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

 

C代码 复制代码 收藏代码
  1. R2#   
  2. R2#conf t   
  3. Enter configuration commands, one per line.  End with CNTL/Z.   
  4. R2(config)#router rip   
  5. R2(config-router)#version 2   
  6. R2(config-router)#network 192.168.110.0   
  7. R2(config-router)#network 172.17.1.0   
  8. R2(config-router)#^Z   
  9. R2#   
  10. R2#copy runn start   
  11. Destination filename [startup-config]?   
  12. Building configuration...   
  13. [OK]   
  14. R2#  

 


 

(4) 测试

 

从 PC2 ping

 

C代码 复制代码 收藏代码
  1. PC2>ping 192.168.100.254   
  2.   
  3. Type escape sequence to abort.   
  4. Sending 5, 100-byte ICMP Echos to 192.168.100.254, timeout is 2 seconds:   
  5. !!!!!   
  6. Success rate is 100 percent (5/5), round-trip min/avg/max = 616/976/1772 ms   
  7.   
  8. PC2>ping 192.168.100.10   
  9.   
  10. Type escape sequence to abort.   
  11. Sending 5, 100-byte ICMP Echos to 192.168.100.10, timeout is 2 seconds:   
  12. !!!!!   
  13. Success rate is 100 percent (5/5), round-trip min/avg/max = 980/1034/1100 ms   
  14. PC2>  
 

从 PC1 ping

 

C代码 复制代码 收藏代码
  1. PC1#   
  2. PC1#ping 192.168.110.253   
  3.   
  4. Type escape sequence to abort.   
  5. Sending 5, 100-byte ICMP Echos to 192.168.110.253, timeout is 2 seconds:   
  6. !!!!!   
  7. Success rate is 100 percent (5/5), round-trip min/avg/max = 576/648/716 ms   
  8.   
  9. PC1#ping 192.168.110.22   
  10.   
  11. Type escape sequence to abort.   
  12. Sending 5, 100-byte ICMP Echos to 192.168.110.22, timeout is 2 seconds:   
  13. !!!!!   
  14. Success rate is 100 percent (5/5), round-trip min/avg/max = 1016/1128/1228 ms   
  15. PC1#  
 

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

 

 

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

 

R1:

 


 

R2:

 


 

 

 

下一步我们尝试 OSPF 的配置。