ip sla 1 icmp-echo 1.1.1.2 source-ip 1.1.1.1 threshold 100 timeout 100 frequency 3 ip sla schedule 1 life forever start-time now
#track 100检测ISP1的可达性 track 100 ip sla 1 reachability
ip sla 2 icmp-echo 2.2.2.2 source-interface Ethernet0/1 threshold 100 timeout 100 frequency 3 ip sla schedule 2 life forever start-time now
#track 200检测ISP2的可达性 track 200 ip sla 2 reachability
路由器将没隔3秒发送一次icmp的ping来来检测目标ip的可达性,超时时间是100ms。
PBR配置
然后配置策略路由,先用acl匹配流量,然后route-map设置策略,再接口下调用
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#抓取流量 access-list100 permit ip 192.168.1.0 0.0.0.255 any access-list199 permit ip 10.1.1.0 0.0.0.255 any
#设置route-map route-map PBR permit 10 match ip address 100 set ip next-hop verify-availability 1.1.1.2 1 track 100 set ip next-hop verify-availability 2.2.2.2 2 track 200
route-map PBR permit 20 match ip address 199 set ip next-hop verify-availability 2.2.2.2 1 track 200 set ip next-hop verify-availability 1.1.1.2 2 track 100
#接口下调用 interface Ethernet0/2 ip policy route-map PBR