简介
本文描述如何配置广域网(或ISP)冗余,多个广域网链接在同样末端路由器终止。 本文也解释对configure network地址转换(NAT),当有Internet连接的多个ISP's,并且时您如何想要无缝的故障切换即,当主ISP沿着走第二然后接管与与使用的正确NAT第二ISP的公共IP地址时。
先决条件
要求
本文档没有任何特定的要求。 在设备和平台必须支持创建IP基本的了解SLA和静态IP SLA Routing.Configuration。
使用的组件
本文档不限于特定的软件和硬件版本。它适用于运行Cisco IOS的所有Cisco路由器,并且IP SLA和跟踪可以配置的地方。
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果网络实际,请确保您了解所有命令潜在影响。
配置
网络图
配置
ISP1和ISP2直接地连接到互联网。对于测试目的,请作为对互联网的一参考请使用IP地址10.10.10.10。
用户边缘路由器配置
接口配置
interface GigabitEthernet0/0/1 description PRIMARY LINK TO ISP 1 ip address 10.0.12.1 255.255.255.252 ip nat outside negotiation auto
interface GigabitEthernet0/0/0 description BACKUP LINK TO ISP 2 ip address 10.0.13.1 255.255.255.252 ip nat outside negotiation auto
跟踪、IP SLA和默认路由配置。
track 8 ip sla 1 reachability ip sla 1 icmp-echo 10.0.12.2 source-ip 10.0.12.1 ip sla schedule 1 life forever start-time now ip route 0.0.0.0 0.0.0.0 10.0.12.2 track 8 ip route 0.0.0.0 0.0.0.0 10.0.13.2 10
当跟踪8是UP时,对互联网的流量流经ISP1。
CustomerEdge#sh ip route static Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfR Gateway of last resort is 10.0.12.2 to network 0.0.0.0 S* 0.0.0.0/0 [1/0] via 10.0.12.2
当跟踪8是DOWN时,对互联网的流量流经ISP2。
CustomerEdge#sh ip route static Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfR Gateway of last resort is 10.0.13.2 to network 0.0.0.0 S* 0.0.0.0/0 [10/0] via 10.0.13.2
Cisco 建议
Note:当您配置IP SLA时,思科推荐这些默认值:
1. Threshold(millisecs) :5000
2. Timeout(millisecs) :5000
3. Frequency(secs) :60
NAT故障切换的另外的配置:
interface GigabitEthernet0/0/2 description TOWARDS CUSTOMER LAN ip address 192.168.1.1 255.255.255.0 ip nat inside negotiation auto
! ip access-list extended 101 permit ip 192.168.1.0 0.0.0.255 any !
! route-map NAT_ISP2 permit 10 match ip address 101 match interface GigabitEthernet0/0/0 ! route-map NAT_ISP1 permit 10 match ip address 101 match interface GigabitEthernet0/0/1 !
路由映射创建匹配访问列表定义的IP地址101并且匹配`退出接口。
ip nat inside source route-map NAT_ISP1 interface GigabitEthernet0/0/1 overload ip nat inside source route-map NAT_ISP2 interface GigabitEthernet0/0/0 overload
这些enable命令端口地址转换(PAT),翻译的IP地址由路由映射定义。将翻译的IP地址到在接口关键字以后定义。
验证
使用本部分可确认配置能否正常运行。
跟踪状态可以验证与使用show track命令。
CustomerEdge#show track Track 8 IP SLA 1 reachability Reachability is Up 7 changes, last change 00:00:17 Latest operation return code: OK Latest RTT (millisecs) 1 Tracked by: Static IP Routing 0
当主ISP链路是UP时,流量流经它。
CustomerEdge#traceroute 10.10.10.10 Type escape sequence to abort. Tracing the route to 10.10.10.10 VRF info: (vrf in name/id, vrf out name/id) 1 10.0.12.2 1 msec * 0 msec
当主ISP链路下降时,辅助链路故障切换。
CustomerEdge#traceroute 10.10.10.10 Type escape sequence to abort. Tracing the route to 10.10.10.10 VRF info: (vrf in name/id, vrf out name/id) 1 10.0.13.2 1 msec * 1 msec
一旦对主ISP链路的链路恢复,流量自动地开始流经它。
同样NAT故障切换:
CustomerLAN#ping 10.10.10.10 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.10.10.10, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
CustomerLAN#sh ip route 10.10.10.10 Routing entry for 10.10.10.10/32 Known via "static", distance 1, metric 0 Routing Descriptor Blocks: * 192.168.1.1 Route metric is 0, traffic share count is 1
当主ISP链路是UP时, NAT转换通过主ISP链路发生。
CustomerEdge#sh ip nat translations
Pro Inside global Inside local Outside local Outside global
icmp 10.0.12.1:1 192.168.1.2:12 10.10.10.10:12 10.10.10.10:1
Total number of translations: 1
当主ISP链路下降时, NAT转换通过第二ISP链路发生。
CustomerEdge#sh ip nat translations
Pro Inside global Inside local Outside local Outside global
icmp 10.0.13.1:1 192.168.1.2:13 10.10.10.10:13 10.10.10.10:1
Total number of translations: 1
当主ISP链路恢复时, NAT转换通过主ISP链路发生
故障排除
本部分提供了可用于对配置进行故障排除的信息。
必须主要从静态路由、IP SLA和跟踪配置方面执行故障排除。
主要,当您分析主链路的失败的,原因在这样方案,请排除故障开始。
---------------------------------------------------------------------------------
ip sla 2
icmp-echo 11.32.0.6 source-ip 11.32.0.5
timeout 4000
frequency 2
ip sla schedule 2 life forever start-time now
track 2 ip sla 2 reachability
ip route 11.32.0.40 255.255.255.248 11.32.0.6 track 2