track 1 ip sla 1 reachability
track 2 ip sla 2 reachability
track 3 ip sla 3 reachability
track 101 list boolean or
object 1
object 2
object 3
!
ip nat inside source route-map NAT-to-ISP1 interface GigabitEthernet0/1 overload
ip nat inside source route-map NAT-to-ISP2 interface GigabitEthernet0/2 overload
ip route 0.0.0.0 0.0.0.0 11.11.11.1 track 101
ip route 0.0.0.0 0.0.0.0 22.22.22.2 2 name ISP2
ip route 8.8.4.4 255.255.255.255 11.11.11.1 name SLA1
ip route 87.250.250.3 255.255.255.255 11.11.11.1 name SLA2
ip route 2.22.239.193 255.255.255.255 11.11.11.1 name SLA3
!
ip sla 1
icmp-echo 8.8.4.4 source-interface GigabitEthernet0/1
tag ### ping Google DNS over ISP1 ###
timeout 5000
threshold 2
frequency 5
ip sla schedule 1 life forever start-time now
ip sla 2
icmp-echo 87.250.250.3 source-interface GigabitEthernet0/1
tag ### ping Yandex over ISP1###
timeout 5000
threshold 2
frequency 5
ip sla schedule 2 life forever start-time now
ip sla 3
icmp-echo 2.22.239.193 source-interface GigabitEthernet0/1
tag ### ping www.apple.com over ISP1###
timeout 5000
threshold 2
frequency 5
ip sla schedule 3 life forever start-time now
!
route-map NAT-to-ISP1 permit 10
match ip address NAT
match interface GigabitEthernet0/1
!
route-map NAT-to-ISP2 permit 10
match ip address NAT
match interface GigabitEthernet0/2
!
event manager applet ISP_1_UP
event track 101 state up
action 001 cli command “enable”
action 002 cli command “clear ip nat trans *”
action 003 syslog msg “ISP 1 is UP”
event manager applet ISP_1_DOWN
event track 101 state down
action 001 cli command “enable”
action 002 cli command “clear ip nat trans *”
action 003 syslog msg “ISP 1 is DOWN”
—————————————————————————————–
Полезные команды:
sh track brief
Посмотреть статусы треков кратко
sh track
Посмотреть статусы треков полностью
sh ip sla summary
Проверка SLA
sh ip route track-table
Просмотр статуса маршрутов
sh ip nat statistics
Проверка работы NAT
Подробнее в статье: http://xgu.ru/ https://wiki.merionet.ru/seti/21/nastrojka-static-route-tracking-s-pomoshhyu-ip-sla/