A-A+

Cisco路由器secondary address实现RIPV1不连续子网

2015年11月23日 路由器高级应用 暂无评论 阅读 4 views 次

这个是实验采用思科路由器,利用secondary address来实现RIPV1的不连续的子网,整个过程如下:

1、按照图中的示例配置IP地址,使用ping命令确保网络连通性。

2、在R3 R4 R5上分别查看路由表。

  1. R3(config-router)#do sh ip route  
  2.      10.0.0.0/24 is subnetted, 2 subnets  
  3. R       10.1.45.0 [120/1] via 10.1.34.2, 00:00:25, Serial1/1  
  4. C       10.1.34.0 is directly connected, Serial1/1  
  5.      192.168.1.0/24 is variably subnetted, 4 subnets, 2 masks   
  6. R       192.168.1.8/29 [120/1] via 192.168.1.18, 00:00:11, FastEthernet0/0  
  7. C       192.168.1.0/30 is directly connected, Loopback0  
  8. R       192.168.1.0/29 [120/1] via 192.168.1.17, 00:00:04, FastEthernet0/0  
  9. C       192.168.1.16/29 is directly connected, FastEthernet0/0                     
  10.   
  11. //R3上没有收到来自于R4的关于192.168.1.0的路由  
  12. R4(config-router)#do sh ip route  
  13. Gateway of last resort is not set  
  14.      10.0.0.0/24 is subnetted, 2 subnets  
  15. C       10.1.45.0 is directly connected, Serial1/1  
  16. C       10.1.34.0 is directly connected, Serial1/0  
  17. R    192.168.1.0/24 [120/1] via 10.1.34.1, 00:00:25, Serial1/0  
  18.                     [120/1] via 10.1.45.2, 00:00:01, Serial1/1  
  19.   
  20. //R4从R3,R5分别收到路由,因此有两个关于192.168.1.0 的路由,metric都为1,RIP默认进行负载均衡。  
  21. R5(config-router)#do sh ip route  
  22.      10.0.0.0/24 is subnetted, 2 subnets  
  23. C       10.1.45.0 is directly connected, Serial1/0  
  24. R       10.1.34.0 [120/1] via 10.1.45.1, 00:00:15, Serial1/0  
  25.      192.168.1.0/29 is subnetted, 1 subnets  
  26. C       192.168.1.24 is directly connected, Loopback0  
  27. //R5上也只有一条关于192.168.1.0的路由  

3、为了实现R1 R2上的路由能够正确的传到R5,需要在沿途确保连续的子网没有被分割。配置secondary address

  1. R3(config)#int s1/1  
  2. R3(config-if)#ip add 192.168.1.33 255.255.255.248 sec  
  3.   
  4. R4(config)#int s1/0  
  5. R4(config-if)#ip add 192.168.1.34 255.255.255.248 sec  
  6. R4(config-if)#  
  7. R4(config-if)#  
  8. R4(config-if)#int s1/1  
  9. R4(config-if)#ip add 192.168.1.41 255.255.255.248 sec  
  10. R4(config-if)#exit  
  11. R4(config)#router rip  
  12. R4(config-router)#net 192.168.1.0  
  13. R5(config)#int s1/0  
  14. R5(config-if)#ip add 192.168.1.42 255.255.255.248 sec  

4、在R1 R3 R4 上查看路由表

  1. R1(config-router)#do sh ip route  
  2. http://www.19216811.la   
  3. Gateway of last resort is not set  
  4. R    10.0.0.0/8 [120/1] via 192.168.1.19, 00:00:14, FastEthernet0/0  
  5.      192.168.1.0/29 is subnetted, 6 subnets  
  6. R       192.168.1.40 [120/2] via 192.168.1.19, 00:00:14, FastEthernet0/0  
  7. R       192.168.1.32 [120/1] via 192.168.1.19, 00:00:14, FastEthernet0/0  
  8. R       192.168.1.8 [120/1] via 192.168.1.18, 00:00:10, FastEthernet0/0  
  9. C       192.168.1.0 is directly connected, Loopback0  
  10. R       192.168.1.24 [120/3] via 192.168.1.19, 00:00:14, FastEthernet0/0   
  11. C       192.168.1.16 is directly connected, FastEthernet0/0  
  12.   
  13. //子网192.168.1.24通过RIP传递过来,metric为3跳  
  14. R3(config-router)#do sh ip route  
  15. Gateway of last resort is not set  
  16.      10.0.0.0/24 is subnetted, 3 subnets  
  17. R       10.0.0.0 [120/1] via 192.168.1.34, 00:00:00, Serial1/1  
  18. R       10.1.45.0 [120/1] via 10.1.34.2, 00:00:00, Serial1/1  
  19. C       10.1.34.0 is directly connected, Serial1/1  
  20.      192.168.1.0/24 is variably subnetted, 7 subnets, 2 masks  
  21. R       192.168.1.40/29 [120/1] via 192.168.1.34, 00:00:00, Serial1/1  
  22. C       192.168.1.32/29 is directly connected, Serial1/1  
  23. R       192.168.1.8/29 [120/1] via 192.168.1.18, 00:00:07, FastEthernet0/0  
  24. C       192.168.1.0/30 is directly connected, Loopback0  
  25. R       192.168.1.0/29 [120/1] via 192.168.1.17, 00:00:01, FastEthernet0/0   
  26.                        [120/1] via 10.1.34.2, 00:00:00, Serial1/1  
  27. R       192.168.1.24/29 [120/2] via 192.168.1.34, 00:00:00, Serial1/1  
  28. C       192.168.1.16/29 is directly connected, FastEthernet0/0  
  29. //此时在R3上可以看到关于192.168.1.0各个子网的明细路由。  
  30.   
  31. R4(config-router)#do sh ip route  
  32.      10.0.0.0/24 is subnetted, 2 subnets  
  33. C       10.1.45.0 is directly connected, Serial1/1  
  34. C       10.1.34.0 is directly connected, Serial1/0  
  35.      192.168.1.0/29 is subnetted, 6 subnets  
  36. C       192.168.1.40 is directly connected, Serial1/1  
  37. C       192.168.1.32 is directly connected, Serial1/0  
  38. R       192.168.1.8 [120/2] via 192.168.1.33, 00:00:01, Serial1/0  
  39. R       192.168.1.0 [120/1] via 10.1.34.1, 00:00:01, Serial1/0  
  40.                     [120/1] via 10.1.45.2, 00:00:15, Serial1/1  
  41. R       192.168.1.24 [120/1] via 192.168.1.42, 00:00:15, Serial1/1  
  42. R       192.168.1.16 [120/1] via 192.168.1.33, 00:00:01, Serial1/0  
  43.   
  44.   
  45. //R4上也收到了明细路由  

实验总结:

RIPV1默认在网络边界汇总网络,这样的话在R3上10.0.0.0网络边界会将192.168.1.0的各个子网汇总为192.168.1.0,因此整个网络的路由是不正确的。

通过配置 了secondary address之后,在网络边界延续29位的子网,使得整 个网络的路由能够正常传递。

标签:

给我留言