Cisco双ISP线路路径优化备份冗余之 单路由器解决方案 通过双ISP(如:一条电信、一条网通)链路可实现网络路径优化、负载均衡及备份冗余,以前本人一直认为Cisco不能实现单路由器双ISP链路的冗余备份,后经过多次测试,发现通过SLA(服务水平)+route-map完全可以实现,在这里愿意和大家一起分享。 网络拓朴: 实验任务: ●∙∙PC1/PC2到1.1.1.1流经ISP1,PC1/PC2到2..2.2.2流经ISP2 ●∙∙通过SLA+Route-map实现网络路径优化、负载分担、备份冗余 环境描述: ●∙∙ 3台Cisco3640 + NE-4E模块,该配置拥有4个Ethernet、2台PC ●∙∙ ISP1、ISP2分别模拟两个不同ISP(internet服务提供商) ●∙∙ ISP1 loopback1:1.1.1.1/24、ISP2 loopback1:2.2.2.2/24用来测试 ●∙∙ R1作为企业边界路由器e0/0、谷牧之女e0/1、分别连接ISP1、ISP2 地址分配:
详细配置: 1、IP地址设置 ISP1 (config) #int e0/2 ISP1 (config-if) #ip add 192.168.2.1 255.255.255.0 ISP1config-if) #no shutdown 太中银铁路ISP1(config)# int e0/0 ISP1 (config-if) #ip add 192.168.0.2 255.255.255.0 ISP1config-if) #no shutdown ISP1(config)# int lo1 ISP1 (config-if) #ip add 1.1.1.1 255.255.255.0 ISP1(onfig-if) #no shutdown …………………………………………………………………………. ISP2 (config) #int e0/2 ISP2 (config-if) #ip add 192.168.2.2 255.255.255.0 ISP2 (onfig-if) #no shutdown ISP2(config)# int e0/1 ISP2 (config-if) #ip add 192.168.1.2 255.255.255.0 ISP2config-if) #no shutdown ISP2(config)# int lo1 ISP2 (config-if) #ip add 2.2.2.2 255.255.255.0 ISP2 (config-if) #no shutdown …………………………………………………………………………… R1 (config) #int e0/0 R1 (config-if) #ip add 192.168.0.1 255.255.255.0 R1 (config-if) #no shutdown R1 (config)# int e0/1 R1 (config-if) #ip add 192.168.1.1 255.255.255.0 R1 (config-if) #no shutdown R1 (config)# int e0/2 R1 (config-if) #ip add 192.168.20.1 255.255.255.0 R1 (config-if) #no shutdown 2、定义相关ACL R1(config)#ip access-list extended all-net ……………………匹配所有 R1(config-ext-nacl)#permit ip any any R1(config)#access-list permit 1 192.168.0.2…………匹配江民通行证ISP1 next-hop R1(config)#access-list permit 2 192.168.1.2…………匹配ISP2 next-hop 3、Route-map、Nat R1(config)#route-map isp1-line permit 10 R1(config-route-map)#match ip address all-net R1(config-route-map)#match ip next-hop 1……………….匹配ACL 1(关键) R1(config)#route-map isp2-line permit 10 R1(config-route-map)#match ip address all-net R1(config-route-map)#match ip next-hop 2……………….匹配ACL 2(关键) R1(config)# ip nat inside source route-map isp1-line int e0/0 overload R1(config)# ip nat inside source route-map isp2-line int e0/1 overload 4、IP SlA、rtr/track 本地路由设备到ISP中间往往连接一个光电转换器(Layer2),当对端shutdown状态,本地设备仍处于UP,这时将导致所谓的“黑洞”现象,我们可以通过SLA来做网络端到端的可用性监测,从而解决这个问题。 R1(config)#rtr 1 R1(config-sla-monitor)#type echo protocol ipIcmpEcho 192.168.0.2 R1(config-sla-monitor-echo)#timeout 1200 ……..echo 超时1200 million second R1(config-sla-monitor-echo)#frequency 3……….发送icmp echo包频率3seonds R1(config)#ip sla monitor schedule 1 life forever start-time now R1(config)#rtr 2 R1(config-sla-monitor)#type echo protocol ipIcmpEcho 192.168.1.2 ---采用icmp协议来监视,即发出icmp echo包来探测对端的可达性,192.168.1.2为对端IP地址 R1(config-sla-monitor-echo)#timeout 1200 R1(config-sla-monitor-echo)#frequency 3 R1(config)#ip sla monitor schedule 2 life forever start-time now 定义SLA监视组 R1(config)#track 111 rtr 1 reachability…………………….定义跟踪组 R1(config)#track 222 rtr 2 reachability 5、写路由 ISP1 (config) #router ospf 1…………………………启用OSPF协议 ISP1 (config-router) #net 0.0.0.0 255.255.255.255 area 0 ISP2 (config) #router ospf 1 ISP2 (config-router) #net 0.0.0.0 255.255.255.255 area 0 R1 (config) #roueter ospf 1 R1 (config-router) #net 0.0.0.0 255.255.255.255 area 0 ----------------------------------------------------------------------- R1(config)#ip route 1.1.1.0 255.255.255.0 192.168.0.2 track 111 R1(config)#ip route 2.2.2.0 255.255.255.0 192.168.1.2 track 222 R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.0.2 track 111 R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.0.2 track 111 实验测试: 1、在PC1上cmd ping 1.1.1.1 R1 debug ip nat 在PC1上cmd ping 2.2.2.2 R1 debug ip nat 在R1上 e0/0 shutdown ping 1.1.1.1 4、在ISP1路由器上e0/0 shutdown后 实验总结:什么是散文 以前一直以为cisco单路由设备在做双ISP链路时,只能实现线路的负载分担、不能实现真正的线路冗余(一条链路失效会造成黑洞现象),因为NAT转换时不够灵活。 以前思路的配置: 泰安市地方税务局1、 定义两个ACL R1(config)#no ip access-list extended isp1 银蒿R1(config-ext-nacl)#permit ip any 1.1.1.0 0.0.0.255 R1(config)#no ip access-list extended isp2 R1(config-ext-nacl)#permit ip any 2.2.2.0 0.0.0.255 2、 定义两个route-map R1(config)#route-map isp1-line permit 10 R1(config-route-map)#match ip address isp1 R1(config)#route-map)#set ip next-hop 192.168.0.2 R1(config)#route-map isp2-line permit 10 R1(config-route-map)#match ip address isp2 R1(config)#route-map)#set ip next-hop 192.168.1.2 3、 NAT/Route-map R1(config)#ip nat inside sourse route-map isp1-line int e0/0 over R1(config)#ip nat inside sourse route-map isp2-line int e0/1 over 通过以前思路的配置不难发现,当一条ISP链路失效时,数据包经过路由图条件匹配,仍会经过NAT转换(很不灵活),这样数据包出去却不能返回,造成“黑洞”,不能达到真正的线路冗余。 通过这次实验再次说明route-map工具确实很强大,很灵活,能解决不少实际问题,在这个地方它可以迷补NAT的一些缺陷。 本文出自 “鬼爆蚂蚁” 博客,请务必保留此出处zg888./247606/94114 本文出自 51CTO.COM技术博客 | |||||||||||||||||||||||||||||||||||||||||||
本文发布于:2024-09-21 14:52:26,感谢您对本站的认可!
本文链接:https://www.17tex.com/xueshu/10697.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |