IP sla的功能是很強(qiáng)大的,,這只是IP sla的一個(gè)小的功能,。
舉個(gè)例子,,
某公司拉了一條光纖專線,,光纖進(jìn)來后接收發(fā)器再接1841路由器,,另外接了一條網(wǎng)通的線備份,,正常情況下走電信,,電信斷了會(huì)走網(wǎng)通,通過浮動(dòng)路由來實(shí)現(xiàn),,問題來了,,如果電信的光纖在某個(gè)局點(diǎn)出了問題,但1841和收發(fā)器的連接是好的,,即1841的連接電信的接口的1層2層全是OK的,,那這時(shí)候是不會(huì)切換到網(wǎng)通的,,如何實(shí)現(xiàn)備份呢???
IP sla可以解決,一要路由可以track一個(gè)IP地址,,可以通過向一個(gè)地址發(fā)送icmp包,,如果嘗試幾次收不到回應(yīng)后認(rèn)為對方不存在,此路由失效,。
在1841上做的
Building configuration...
Current configuration : 1950
bytes
!
version 12.4
service timestamps debug datetime msec
service
timestamps log datetime msec
service password-encryption
!
hostname
!
boot-start-marker
boot-end-marker
!
logging buffered 4096
debugging
enable secret 5 $1$K9cw$ff4.SEldlX3TGV1x1qSdP0
!
no aaa
new-model
!
resource policy
!
mmi polling-interval 60
no mmi
auto-configure
no mmi pvc
mmi snmp-timeout 180
ip subnet-zero
ip
cef
!
!
!
!
no ip domain
lookup
!-------------------------------------------------------------------------------------
建立 sla
ip
sla monitor 1
type echo protocol ipIcmpEcho x.x.x.x
request-data-size
1400
timeout 1000
threshold 2
frequency 3
ip sla monitor schedule 1
life forever start-time
now
!
!
!
!
!
!
!-------------------------------------------------------------------------------------
建立track
track
2 rtr 1
!
track 3 rtr 1
reachability
!
!
!
!
!
!
!
!
!
interface
FastEthernet0/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
!
!
line con 0
line aux 0
line
vty 0 4
exec-timeout 60 0
password 7 104C0512030D0A4A464E
login
local
!
end