场景一:静态路由故障切换,默认路由走Tunnel400,当Tunnel400不可用时,自动切换至Tunnel300

interface Tunnel300 mode ipv4-ipv4
     ip address 100.65.1.1 255.255.255.0
     source 103.1.1.1
     destination 154.1.1.1

interface Tunnel400 mode ipv4-ipv4
     ip address 100.65.0.1 255.255.255.0
     source 103.1.1.1
     destination 154.2.2.2

nqa entry admin vm16
     type icmp-echo
     destination ip 100.65.0.2
     frequency 100
     reaction 1 checked-element probe-fail threshold-type consecutive 5 action-type trigger-only

track 1 nqa entry admin vm16 reaction 1
# track 1 和 reaction 1可以不一样,多个reaction 1可以复用同一个track 1,不影响自动切换
nqa schedule admin vm16 start-time now lifetime forever


ip route-static 0.0.0.0 0 100.65.0.2 track 1 preference 80
ip route-static 0.0.0.0 0 100.65.1.2 preference 100

[CT_CORE_S6800]dis track 1
Track ID: 1
  State: Positive
  Duration: 0 days 1 hours 46 minutes 39 seconds
  Notification delay: Positive 0, Negative 0 (in seconds)
  Tracked object:
    NQA entry: admin vm16
    Reaction: 1
    Remote IP/URL: 100.65.0.2                                                  
    Local IP: --                                                          
    Interface: --

场景二:策略路由故障切换,根据源IP地址设置访问指定目标IP时,走不同的下一跳,针对下一跳再做自动故障切换

policy-based-route WARP-VM permit node 0
 if-match acl 3502
 apply next-hop 100.64.0.2 track 1
#              
policy-based-route WARP-VM permit node 1
 if-match acl 3501
 apply next-hop 100.64.1.2 track 2
#
policy-based-route WARP-VM permit node 2
 if-match acl 3511
 apply next-hop 192.168.247.13
 apply next-hop 192.168.247.17
#
policy-based-route WARP-VM permit node 3
 if-match acl 3504
 apply next-hop 100.64.3.2 track 3
#
policy-based-route WARP-VM permit node 4
 if-match acl 3505
 apply next-hop 100.64.4.2 track 4
#
...
#
nqa entry admin vm106
 type icmp-echo
  destination ip 100.64.8.2
  frequency 100
  reaction 8 checked-element probe-fail threshold-type consecutive 5 action-type trigger-only
#
nqa entry admin vm12
 type icmp-echo
  destination ip 100.64.5.2
  frequency 100
  reaction 5 checked-element probe-fail threshold-type consecutive 5 action-type trigger-only
#              
...
nqa entry admin vm93
 type icmp-echo
  destination ip 100.64.1.2
  frequency 100
  reaction 2 checked-element probe-fail threshold-type consecutive 5 action-type trigger-only
#
 nqa schedule admin vm106 start-time now lifetime forever
 nqa schedule admin vm12 start-time now lifetime forever
 nqa schedule admin vm16 start-time now lifetime forever
 ...
#
interface Vlan-interface361
 description WARP-Servers
 ip address 103.1.1.17 255.255.255.248
 ip address 103.1.1.65 255.255.255.240 sub
 ip policy-based-route WARP-VM
#              
interface Tunnel100 mode ipv4-ipv4
 ip address 100.64.0.1 255.255.255.0
 source 103.1.1.17
 destination 154.1.1.10
#              
interface Tunnel200 mode ipv4-ipv4
 ip address 100.64.1.1 255.255.255.0
 source 103.1.1.17
 destination 154.1.1.9
#
....
 track 1 nqa entry admin vm92 reaction 1
 track 2 nqa entry admin vm93 reaction 2
 track 3 nqa entry admin vm85 reaction 3
 track 4 nqa entry admin vm18 reaction 4
 track 5 nqa entry admin vm12 reaction 5
 track 6 nqa entry admin vm31 reaction 6
 track 7 nqa entry admin vm50 reaction 7
 track 8 nqa entry admin vm106 reaction 8
 track 9 nqa entry admin vm16 reaction 9
 track 10 nqa entry admin vm58 reaction 10
 track 11 nqa entry admin vm6 reaction 10
 track 12 nqa entry admin vm70 reaction 10
 track 13 nqa entry admin vm9 reaction 10
#

[CN_S6800]dis acl 3511
Advanced IPv4 ACL 3511, 102 rules,
To-China-CDN-Node
ACL's step is 5, start ID is 0
 rule 0 permit ip destination 116.2.2.2 0
 rule 1 permit ip destination 119.1.1.0 0.0.0.63
 
[CN_S6800]dis acl 3502
Advanced IPv4 ACL 3502, 6 rules,
ACL's step is 5, start ID is 0
 rule 0 permit ip source 103.1.1.68 0 destination 162.1.1.1 0
 rule 1 permit ip source 103.1.1.68 0 destination 162.2.2.2 0

华为交换机NQA配置参考
2条静态路由,一条挂了自动切换到另一条,2条都挂了,再切换到额外的线路
192.168.247.22/26是业务交换机
192.168.247.17/18是灾备交换机

 nqa test-instance admin jd22
 test-type icmp
 destination-address ipv4 192.168.247.22
 frequency 100
 
 nqa test-instance admin jd26
 test-type icmp
 destination-address ipv4 192.168.247.26
 frequency 100

ip route-static 103.1.1.0 255.255.255.240 192.168.247.22 preference 80 track nqa admin jd22
ip route-static 103.1.1.0 255.255.255.240 192.168.247.26 preference 80 track nqa admin jd26

ip route-static 103.1.1.0 255.255.255.240 192.168.247.14 preference 100
ip route-static 103.1.1.0 255.255.255.240 192.168.247.18 preference 100