A-A+

cisco IP SLA+Track实现静态路由的冗余切换

2016年02月17日 站长资讯 暂无评论

IP SLA(Internet Protocol Service-Level Agreement)互联网服务等级协议,本实验里通过发送测试报文,测试下一跳是否可达,结合Track实现冗余静态路由的切换。

实验环境:

模拟器:GNS3

路由器:C3640-JK9O3S-M-12.4(7a).BIN

终端:VPCS

网络拓扑:

R4模拟某公司专线接入路由器,R3模拟对端银行网络设备。

R4和R3之间通过两条专线互联,联通专线为主链路,电信专线为备链路。

PC1模拟公司客户端服务器,PC2模拟银行服务端服务器。PC1通过专线访问银行服务端PC2。

实验目的:

当主链路出问题时,自动切换到备份链路。

网络配置:

  1. R4:  
  2.   
  3. R4#show ip int b  
  4. Interface                  IP-Address      OK? Method Status                Protocol  
  5. FastEthernet0/0            192.168.193.1   YES manual up                    up  
  6. FastEthernet1/0            192.168.194.1   YES manual up                    up  
  7. FastEthernet2/0            192.168.40.254  YES manual up                    up  
  8. R3:  
  9.   
  10. R3#show ip int b  
  11. Interface                  IP-Address      OK? Method Status                Protocol  
  12. FastEthernet0/0            192.168.193.2   YES manual up                    up  
  13. FastEthernet1/0            192.168.194.2   YES manual up                    up  
  14. FastEthernet2/0            192.168.206.254 YES manual up                    up  
  15. VPCS:  
  16. 1  
  17. 2  
  18. PC1> ip 192.168.40.41/24 192.168.40.254  
  19. PC2> ip 192.168.206.1/24 192.168.206.254  

IP SLA配置命令:

  1. R4:  
  2.   
  3. R4#conf t  
  4. R4(config)#ip sla monitor 11  
  5. R4(config-sla-monitor)#type echo protocol ipIcmpEcho 192.168.193.2 source-interface f0/0  
  6. R4(config-sla-monitor-echo)#timeout 1000  
  7. R4(config-sla-monitor-echo)#frequency 3  
  8. R4(config-sla-monitor-echo)#exit  
  9. R4(config)#ip sla monitor schedule 11 life forever start-time now  
  10. R4(config)#track 1 rtr 11 reachability  
  11. R4(config-track)#exit  
  12. // 静态路由(主链路):  
  13. R4(config)#ip route 192.168.206.1 255.255.255.255 192.168.193.2 track 1  
  14. // 浮动静态路由(备份链路):  
  15. R4(config)#ip route 192.168.206.1 255.255.255.255 192.168.194.2 10  
  16. R3:  
  17.   
  18. R3#conf t  
  19. R3(config)#ip sla monitor 11  
  20. R3(config-sla-monitor)#type echo protocol ipIcmpEcho 192.168.193.1 source-interface f0/0  
  21. R3(config-sla-monitor-echo)#timeout 1000  
  22. R3(config-sla-monitor-echo)#frequency 3  
  23. R3(config-sla-monitor-echo)#exit  
  24. R3(config)#ip sla monitor schedule 11 life forever start-time now  
  25. R3(config)#track 1 rtr 11 reachability  
  26. R3(config-track)#exit  
  27. // 静态路由(主链路):  
  28. R3(config)#ip route 192.168.40.41 255.255.255.255 192.168.193.1 track 1  
  29. // 浮动静态路由(备份链路):  
  30. R3(config)#ip route 192.168.40.41 255.255.255.255 192.168.194.1 10  
  31. 测试:  
  32.   
  33. // 当前主链路静态路由  
  34. R4#show ip route static  
  35.      192.168.206.0/32 is subnetted, 1 subnets  
  36. S       192.168.206.1 [1/0] via 192.168.193.2  
  37.    
  38. R3# show ip route static  
  39.      192.168.40.0/32 is subnetted, 1 subnets  
  40. S       192.168.40.41 [1/0] via 192.168.193.1  
  41.    
  42. // 把主链路一边端口down掉  
  43. R4#conf t  
  44. R4(config)#int f0/0  
  45. R4(config-if)#shutdown  
  46. R4(config-if)#end  
  47.    
  48. // 3秒后已切换为备用静态路由  
  49. R4#show ip route static  
  50.      192.168.206.0/32 is subnetted, 1 subnets  
  51. S       192.168.206.1 [10/0] via 192.168.194.2  
  52.    
  53. R3#show ip route static  
  54.      192.168.40.0/32 is subnetted, 1 subnets  
  55. S       192.168.40.41 [10/0] via 192.168.194.1  
  56. wKioL1aYqSTSMp2iAADg0pTj4nI794.png  

通过长ping发现路由切换后连通正常。

后记:

在双方设备条件允许情况下,可以使用BFD检测机制,提供毫秒级检测。大多数情况下,由于银行网络设备厂商不同、设备新旧程度不同,可能不支持BFD协议,所以IP SLA作为备选方案提供秒级的检测。华为的NQA技术和cisco IP SLA类似。

标签:

给我留言