Cisco(config)#access-list 1 permit 192.168.1.0 0.0.0.255

Cisco(config)#access-list 2 permit 192.168.2.0 0.0.0.255

Cisco(config)#ip sla monitor responder  //打开思科可sla功能

Cisco(config)#ip sla monitor 1

Cisco(config-sla-monitor)#$rotocol ipicmpEcho 12.1.1.2 source-ipaddr 12.1.1.1  

Cisco(config-sla-monitor-echo)#frequency 10

Cisco(config)#ip sla monitor schedule 1 life forever start-time now  

Cisco(config)#track 1 rtr 1 reachability

R1#show ip sla monitor configuration  //查看SLA的配置

Cisco(config)#route-map rm1 permit 10

Cisco(config-route-map)#match ip address 1

Cisco(config-route-map)#set ip next-hop 12.1.1.2 13.1.1.3   //主备出接口备份

Cisco(config-route-map)#set ip next-hop verify-availability  //验证链路的可用性,使用于思科设备,借助思科专用的CDP的邻居表项

Cisco(config-route-map)#set ip next-hop verify-availability 12.1.1.2 10 track 1  //引用SLA配置

Cisco(config)#route-map rm1 permit 20

Cisco(config-route-map)#set interface s1/0

Cisco(config)#int f0/0

Cisco(config-if)#ip policy route-map rm1