A-A+

思科默认路由以及浮动路由网络胡同的配置

2015年11月26日 站长资讯 暂无评论

要求:网络互通(且每台路由都有一个虚拟接口)。每台路由上有一条浮动路由。

首先给两台PC配置同网段IP:

  1. VPCS[1]> ip 192.168.1.10 192.168.1.1  
  2. PC1 : 192.168.1.10 255.255.255.0 gateway 192.168.1.1  
  3. VPCS[1]> 2  
  4. VPCS[2]> ip 192.168.1.20 192.168.1.1  
  5. PC2 : 192.168.1.20 255.255.255.0 gateway 192.168.1.1  
  6. VPCS[2]> ping 192.168.1.10  
  7. 192.168.1.10 icmp_seq=1 ttl=64 time=31.000 ms  
  8. 192.168.1.10 icmp_seq=2 ttl=64 time=32.000 ms  
  9. 192.168.1.10 icmp_seq=3 ttl=64 time=31.000 ms  
  10. 192.168.1.10 icmp_seq=4 ttl=64 time=31.000 ms  
  11. 192.168.1.10 icmp_seq=5 ttl=64 time=31.000 ms  

给各个路由配IP和虚拟接口:

  1. R1  
  2. Interface                  IP-Address      OK? Method Status                Protocol  
  3. FastEthernet0/0            192.168.1.1     YES manual up                    up    
  4. FastEthernet0/1            12.0.0.1        YES manual up                    up    
  5. FastEthernet1/0            13.0.0.1        YES manual up                    up   
  6.   
  7.   
  8. Loopback0               1.1.1.1         YES manual up                    up    
  9. R2  
  10. Interface                  IP-Address      OK? Method Status                Protocol  
  11. FastEthernet0/0            12.0.0.2        YES manual up                    up    
  12. FastEthernet0/1            23.0.0.2        YES manual up                    up    
  13. Loopback0                2.2.2.2         YES manual up                    up    
  14. R3  
  15. Interface                  IP-Address      OK? Method Status           Pr otocol  
  16. FastEthernet0/0            23.0.0.3        YES manual up                    up    
  17. FastEthernet0/1            unassigned      YES unset  up                    up    
  18. Loopback0                3.3.3.3         YES manual up                    up   

给每个路由做自身所不知道的静态路由:

  1. R1  
  2. ip route 2.2.2.0 255.255.255.0 12.0.0.2  
  3. ip route 2.2.2.0 255.255.255.0 13.0.0.3  
  4. ip route 3.3.3.0 255.255.255.0 12.0.0.2  
  5. ip route 3.3.3.0 255.255.255.0 13.0.0.3  
  6. ip route 23.0.0.0 255.255.255.0 12.0.0.2  
  7. ip route 23.0.0.0 255.255.255.0 13.0.0.3  
  8. R2  
  9. ip route 1.1.1.0 255.255.255.0 12.0.0.1  
  10. ip route 1.1.1.0 255.255.255.0 23.0.0.3  
  11. ip route 3.3.3.0 255.255.255.0 12.0.0.1  
  12. ip route 3.3.3.0 255.255.255.0 23.0.0.3  
  13. ip route 13.0.0.0 255.255.255.0 12.0.0.1  
  14. ip route 13.0.0.0 255.255.255.0 23.0.0.3  
  15. #ip route 192.168.1.0 255.255.255.0 12.0.0.1  
  16. R3  
  17. ip route 1.1.1.0 255.255.255.0 13.0.0.1  
  18. ip route 1.1.1.0 255.255.255.0 23.0.0.2  
  19. ip route 2.2.2.0 255.255.255.0 13.0.0.1  
  20. ip route 2.2.2.0 255.255.255.0 23.0.0.2  
  21. ip route 12.0.0.0 255.255.255.0 13.0.0.1  
  22. ip route 12.0.0.0 255.255.255.0 23.0.0.2  
  23. ip route 192.168.1.0 255.255.255.0 13.0.0.1  

到达每个目标都有了两条路可以走,设浮动路由:

R1(config)#ip route 3.3.3.0 255.255.255.0 12.0.0.2 10 (都类似)

最后检验:

  1. VPCS[2]> ping 12.0.0.2  
  2. 12.0.0.2 icmp_seq=1 ttl=254 time=125.000 ms  
  3. 12.0.0.2 icmp_seq=2 ttl=254 time=93.000 ms  
  4. 12.0.0.2 icmp_seq=3 ttl=254 time=94.000 ms  
  5. 12.0.0.2 icmp_seq=4 ttl=254 time=78.000 ms  
  6. 12.0.0.2 icmp_seq=5 ttl=254 time=94.000 ms  
  7. VPCS[2]> ping 2.2.2.2  
  8. 2.2.2.2 icmp_seq=1 ttl=254 time=93.000 ms  
  9. 2.2.2.2 icmp_seq=2 ttl=254 time=94.000 ms  
  10. 2.2.2.2 icmp_seq=3 ttl=254 time=109.000 ms  
  11. 2.2.2.2 icmp_seq=4 ttl=254 time=93.000 ms  
  12. 2.2.2.2 icmp_seq=5 ttl=254 time=125.000 ms  

R1和R3也可作默认路由,因为做过浮动路由后,只有一条路生效,所以可看做是单出口.

标签:

给我留言