思科如何配置IP SLA路由聯(lián)動(dòng)(2)
思科如何配置IP SLA路由聯(lián)動(dòng)
舉個(gè)例子,
某公司拉了一條光纖專線,光纖進(jìn)來(lái)后接收發(fā)器再接1841路由器,另外接了一條網(wǎng)通的線備份,正常情況下走電信,電信斷了會(huì)走網(wǎng)通,通過(guò)浮動(dòng)路由來(lái)實(shí)現(xiàn),問題來(lái)了,如果電信的光纖在某個(gè)局點(diǎn)出了問題,但1841和收發(fā)器的連接是好的,即1841的連接電信的接口的1層2層全是OK的,那這時(shí)候是不會(huì)切換到網(wǎng)通的,如何實(shí)現(xiàn)備份呢???
IP sla可以解決,一要路由可以track一個(gè)IP地址,可以通過(guò)向一個(gè)地址發(fā)送icmp包,如果嘗試幾次收不到回應(yīng)后認(rèn)為對(duì)方不存在,此路由失效。
在1841上做的
Building configuration…
version 12.4
service timestamps debug datetime msec
service
timestamps log datetime msec
service password-encryption
debugging
enable secret 5 class="main">
思科如何配置IP SLA路由聯(lián)動(dòng)(2)
!
no aaa
new-model
!
resource policy
!
mmi polling-interval 60
no mmi
auto-configure
no mmi pvc
mmi snmp-timeout 180
ip subnet-zero
ipcef
no ip domain
lookup
!----------------------------- 建立 sla
ipsla monitor 1
type echo protocol ipIcmpEcho x.x.x.x
request-data-size
1400
timeout 1000
threshold 2
frequency 3
ip sla monitor schedule 1life forever start-timenow
!
!
!----------------------------------- 建立track
track2 rtr 1
!
track 3 rtr 1reachability
interfaceFastEthernet0/0
ip address x.x.x.x 255.255.255.252
speed
10
half-duplex
crypto map clientmap
!
interface
FastEthernet0/1
ip address 192.168.10.1 255.255.255.0
duplex
auto
speed
auto
!--------------------------------------HSRP
track
standby 1 track 2
standby 1 track 3
!
ip
classless
!------------------------------------ 路由
track
ip route 1.1.1.1 255.255.255.255 x.x.x.x track 2
ip route 0.0.0.0
0.0.0.0 x.x.x.x
!
ip http server
no ip http
secure-server
!
!---------------------------------- 策略路由
track
route-map test permit 10
match ip address 1
set ip next-hop
verify-availability x.x.x.x 1 track
2
!
!
!
control-plane
!
ip sla配置和注解
1)IP SlA/track
本地路由設(shè)備到下一臺(tái)三層交換機(jī)之間串接一臺(tái)透明設(shè)備,當(dāng)對(duì)端shutdown狀態(tài),本地設(shè)備仍處于UP,這時(shí)將導(dǎo)致所謂的"黑洞"現(xiàn)象,
我們可以通過(guò)SLA來(lái)做網(wǎng)絡(luò)端到端的可用性監(jiān)測(cè),從而解決這個(gè)問題。
R871(config)#ip sla 64
R871(config-ip-sla)# icmp-echo 192.168.64.2
R871(config)#ip sla schedule 64 life forever start-time now
R871(config)#ip sla 65
R871(config-ip-sla)# icmp-echo 192.168.65.2
R871(config)#ip sla schedule 65 life forever start-time now
---采用icmp協(xié)議來(lái)監(jiān)視,即發(fā)出icmp echo包來(lái)探測(cè)對(duì)端的可達(dá)性,192.168.64.2/65.2為對(duì)端IP地址
2)定義SLA監(jiān)視組
R871(config)#track 64 rtr 64 reachability……定義跟蹤組