Configuring IP Monitoring with Interface Failover Using Boolean Conditions
Using IP monitoring with interface failover, it is possible to incorporate AND and OR conditions for monitored IP addresses. For the probe to fail, each test that makes up a given probe must fail (AND logic). If any of the probes specified for a given IP-monitoring policy fail then the IP-monitoring action is triggered (OR logic). The following example shows how to use rpm probes and IP-monitoring to implement AND and OR combinations. Suppose you want to bring up a backup interface when both IP addresses 11.1.1.1 and 11.1.1.2 are unreachable and also bring up the backup interface when IP address 12.1.1.1 is unreachable, then this scenario can be expressed as the following Boolean statement– “If (11.1.1.1 is unreachable AND 11.1.1.2 is unreachable) OR (12.1.1.1 is unreachable) then enable the backup interface”.
The configuration below implements the logic required for the scenario. The following commands show how the Junos features are substituted into in the above statement and map to the configuration. Probe1 and probe2 are defined in the example configuration below. Probe1 consists of two tests which are connected together with the boolean AND condition. If (probe1 fails OR probe2 fails) then enable the backup interface.
set services rpm probe probe1 test paysvr1 target address 11.1.1.1 set services rpm probe probe1 test paysvr1 probe-count 5 set services rpm probe probe1 test paysvr1 probe-interval 5 set services rpm probe probe1 test paysvr1 test-interval 3 set services rpm probe probe1 test paysvr1 thresholds successive-loss 5 set services rpm probe probe1 test paysvr1 destination-interface fe-0/0/1.0 set services rpm probe probe1 test paysvr1 hardware-timestamp set services rpm probe probe1 test paysvr1 next-hop 1.1.1.2 set services rpm probe probe1 test paysvr2 target address 11.1.1.2 set services rpm probe probe1 test paysvr2 probe-count 5 set services rpm probe probe1 test paysvr2 probe-interval 5 set services rpm probe probe1 test paysvr2 test-interval 3 set services rpm probe probe1 test paysvr2 thresholds successive-loss 5 set services rpm probe probe1 test paysvr2 destination-interface fe-0/0/1.0 set services rpm probe probe1 test paysvr2 hardware-timestamp set services rpm probe probe1 test paysvr2 next-hop 1.1.1.2 set services rpm probe probe2 test paysvr1 target address 12.1.1.1 set services rpm probe probe2 test paysvr1 probe-count 5 set services rpm probe probe2 test paysvr1 probe-interval 5 set services rpm probe probe2 test paysvr1 test-interval 3 set services rpm probe probe2 test paysvr1 thresholds successive-loss 5 set services rpm probe probe2 test paysvr1 destination-interface fe-0/0/1.0 set services rpm probe probe2 test paysvr1 hardware-timestamp set services rpm probe probe2 test paysvr1 next-hop 1.1.1.2 set services ip-monitoring policy enable_backup match rpm-probe probe1 set services ip-monitoring policy enable_backup match rpm-probe probe2 set services ip-monitoring policy enable_backup then interface fe-0/0/2 enable