Configuring IP Monitoring with Interface Failover
Using IP monitoring with interface failover, you can track an IP address or a set of IP addresses using a real-time performance monitoring (RPM) probe. If the RPM probe fails, you can enable a backup interface that is normally down in the steady state. After the RPM probe successfully reaches its target, the backup interface is again disabled.
Figure 1 shows the topology used in the configuration example and how IP monitoring works.
In the steady state, the interface fe-0/0/2 is in the link down state. However, when the RPM probes fail, the system enables the interface, and traffic flows through interface fe-0/0/2. When the RPM probes successfully reach their target, the system brings down interface fe-0/0/2 and traffic passes through fe-0/0/1.
To achieve this result, define an RPM probe to monitor IP address 5.1.1.2. Enter the following configuration:
set services rpm probe Probe-Payment-Server test paysvr target address 5.1.1.2 set services rpm probe Probe-Payment-Server test paysvr probe-count 5 set services rpm probe Probe-Payment-Server test paysvr probe-interval 5 set services rpm probe Probe-Payment-Server test paysvr test-interval 3 set services rpm probe Probe-Payment-Server test paysvr thresholds successive-loss 5 set services rpm probe Probe-Payment-Server test paysvr destination-interface fe- 0/0/1.0 set services rpm probe Probe-Payment-Server test paysvr hardware-timestamp set services rpm probe Probe-Payment-Server test paysvr next-hop 1.1.1.2
Also configure the IP monitoring policy to enable the backup interface fe-0/0/2 when the RPM probe fails. Enter the following configuration:
set services ip-monitoring policy test-remote-server match rpm-probe Probe- Payment-Server set services ip-monitoring policy test-remote-server then interface fe-0/0/2 enable
In this example, the interface fe-0/0/2 has a static IP address. Hence, you want to specify static routes to all destinations such that fe-0/0/2 is always the preferred route (lower preference value). You also need to specify routes to all destinations such that the next-hop router points to the next hop of fe-0/0/1 (higher preference value). With this approach, when interface fe-0/0/2 is disabled in the steady state, all traffic flows through fe-0/0/1. When interface fe-0/0/2 is up, all traffic flows through fe-0/0/2. Enter the following configuration:
set routing-options static route 5.1.1.0/24 qualified-next-hop 2.1.1.2 metric 1 set routing-options static route 5.1.1.0/24 qualified-next-hop 1.1.1.2 metric 10
If the backup interface has an IP address that is assigned using the Dynamic Host Configuration Protocol (DHCP), you do not know what the next hop through the backup interface is, and you are not able to add static routes similar to what is described previously. For more information about this scenario, see Configuring IP Monitoring with a DHCP Backup Interface.
In the steady state, you can reach IP address 5.1.1.1 through the link with the IP address of 1.1.1.2, and the RPM probes are successful. The backup interface fe-0/0/2 is down. To verify the steady state, enter the following command:
root# run traceroute 5.1.1.1 source 10.1.1.1 traceroute to 5.1.1.1 (5.1.1.1) from 10.1.1.1, 30 hops max, 40 byte packets 1 1.1.1.2 (1.1.1.2) 8.807 ms 14.808 ms 9.279 ms 2 5.1.1.1 (5.1.1.1) 3.517 ms 9.609 ms 3.804 ms
In the following show
command output, the PASS
results in the Status
field indicate that the probe is
successful:
root# run show services ip-monitoring status Policy - test-remote-server RPM Probes: Probe name Address Status ---------------------- ---------------- --------- Probe-Payment-Server 5.1.1.2 PASS root# run show interfaces fe-0/0/2 terse Interface Admin Link Proto Local Remote fe-0/0/2 down down fe-0/0/2.0 up down inet 2.1.1.1/24
In the following show
command output, the Probes
sent
count and Probes received
count are equal, and
the Loss percentage
is 0
. This indicates that
the probe is successful.
root# run show services rpm probe-results Owner: Probe-Payment-Server, Test: paysvr Target address: 5.1.1.2, Probe type: icmp-ping Destination interface name: fe-0/0/1.0 Test size: 5 probes Probe results: Response received, Wed Sep 21 06:24:05 2011, No hardware timestamps Rtt: 1838 usec Results over current test: Probes sent: 4, Probes received: 4, Loss percentage: 0 Measurement: Round trip time Samples: 4, Minimum: 1674 usec, Maximum: 2006 usec, Average: 1805 usec, Peak to peak: 332 usec, Stddev: 132 usec, Sum: 7220 usec Results over last test: Probes sent: 5, Probes received: 5, Loss percentage: 0 Test completed on Wed Sep 21 06:23:47 2011 Measurement: Round trip time Samples: 5, Minimum: 1632 usec, Maximum: 7599 usec, Average: 4226 usec, Peak to peak: 5967 usec, Stddev: 2719 usec, Sum: 21128 usec Results over all tests: Probes sent: 54, Probes received: 54, Loss percentage: 0 Measurement: Round trip time Samples: 54, Minimum: 1524 usec, Maximum: 97845 usec, Average: 5422 usec, Peak to peak: 96321 usec, Stddev: 13438 usec, Sum: 292762 usec
When IP address 5.1.1.2 is unreachable, the RPM probes fail and the interface fe-0/0/2 is enabled. All traffic is now routed through interface fe-0/0/2. The probes are still sent out of interface fe-0/0/1.
In the following show
command output under
the Results over current test:
section, it shows the Probes sent
count is 2
and the Probes received
count is 0
. It also shows that the Loss percentage
is 100
. This indicates that the probe has failed.
root# run show services rpm probe-results Owner: Probe-Payment-Server, Test: paysvr Target address: 5.1.1.2, Probe type: icmp-ping Destination interface name: fe-0/0/1.0 Test size: 5 probes Probe results: Request timed out, Thu Sep 22 01:18:25 2011 Results over current test: Probes sent: 2, Probes received: 0, Loss percentage: 100 Results over last test: Probes sent: 5, Probes received: 5, Loss percentage: 0 Test completed on Thu Sep 22 01:18:17 2011 Measurement: Round trip time Samples: 5, Minimum: 1635 usec, Maximum: 7528 usec, Average: 4055 usec, Peak to peak: 5893 usec, Stddev: 2819 usec, Sum: 20273 usec Results over all tests: Probes sent: 22, Probes received: 20, Loss percentage: 9 Measurement: Round trip time Samples: 20, Minimum: 1439 usec, Maximum: 9427 usec, Average: 3355 usec, Peak to peak: 7988 usec, Stddev: 2650 usec, Sum: 67099 usec
To further verify the fail state, use the following command:
root# run show services ip-monitoring status Policy - test-remote-server RPM Probes: Probe name Address Status ---------------------- ---------------- --------- Probe-Payment-Server 5.1.1.2 FAIL
To verify that interface fe-0/0/2 is enabled, use the following command:
root# run show interfaces fe-0/0/2 terse Interface Admin Link Proto Local Remote fe-0/0/2 up up fe-0/0/2.0 up up inet 2.1.1.1/24
To verify that IP address 5.1.1.1 is now reachable through the device with the IP address of 2.1.1.2, use the following command:
root# run traceroute 5.1.1.1 source 10.1.1.1 traceroute to 5.1.1.1 (5.1.1.1) from 10.1.1.1, 30 hops max, 40 byte packets 1 2.1.1.2 (2.1.1.2) 9.031 ms 8.575 ms 15.450 ms 2 5.1.1.1 (5.1.1.1) 10.120 ms 10.581 ms 3.553 ms
When IP address 5.1.1.2 is again reachable, the RPM probes successfully reach the target, and interface fe-0/0/2 is disabled. Now all traffic flows through interface fe-0/0/1.
To verify the operation of the restored steady state, use the following commands and verify that the results are similar to the steady-state results previously described:
root# run show services rpm probe-results Owner: Probe-Payment-Server, Test: paysvr Target address: 5.1.1.2, Probe type: icmp-ping Destination interface name: fe-0/0/1.0 Test size: 5 probes Probe results: Response received, Thu Sep 22 01:22:01 2011, No hardware timestamps Rtt: 2258 usec Results over current test: Probes sent: 2, Probes received: 2, Loss percentage: 0 Measurement: Round trip time Samples: 2, Minimum: 1847 usec, Maximum: 2258 usec, Average: 2053 usec, Peak to peak: 411 usec, Stddev: 206 usec, Sum: 4105 usec Results over last test: Probes sent: 5, Probes received: 5, Loss percentage: 0 Test completed on Thu Sep 22 01:21:53 2011 Measurement: Round trip time Samples: 5, Minimum: 1614 usec, Maximum: 3752 usec, Average: 2213 usec, Peak to peak: 2138 usec, Stddev: 782 usec, Sum: 11064 usec Results over all tests: Probes sent: 62, Probes received: 31, Loss percentage: 50 Measurement: Round trip time Samples: 31, Minimum: 1439 usec, Maximum: 9427 usec, Average: 3076 usec, Peak to peak: 7988 usec, Stddev: 2426 usec, Sum: 95345 usec root# run show services ip-monitoring status Policy - test-remote-server RPM Probes: Probe name Address Status ---------------------- ---------------- --------- Probe-Payment-Server 5.1.1.2 PASS root# run show interfaces fe-0/0/2 terse Interface Admin Link Proto Local Remote fe-0/0/2 down down fe-0/0/2.0 up down inet 2.1.1.1/24 root# run traceroute 5.1.1.1 source 10.1.1.1 traceroute to 5.1.1.1 (5.1.1.1) from 10.1.1.1, 30 hops max, 40 byte packets 1 1.1.1.2 (1.1.1.2) 8.818 ms 8.573 ms 9.847 ms 2 5.1.1.1 (5.1.1.1) 3.384 ms 15.888 ms 3.640 ms