There are times when 2 Routers are connected to provide high availability to network and HSRP is configured on the LAN side of Routers with one acting as primary and other its HSRP backup. Such a setup would be good in some cases like ptp links on serial interfaces.
However when we have Ethernet medium and direct link failure happens, HSRP cant respond to this scenario and still keeps of forwarding traffic unaware of the link failure.
Example Scenario: IP SLA with HSRP
Below is an example scenario showing how HSRP can be configured to meet the indirect link failures by use of IP SLA configuration with HSRP.
Routers R1 and R2 have HSRP configured on LAN side (HSRP IP = 192.168.12.3).
Both the routers have static routes pointing towards R3 on the remote side.
In between we can see Switch SW2 which acts as layer 2 and connects segments of R1-R3 and R2-R3.
Now that HSRP configuration is in place, network administrator realizes that any indirect failure on the link between R3 and R1 will not be seen by R1 and still R1 remains the HSRP master and keep on forwarding the traffic.
The solution can be reached if R1 monitors a remote IP – say Loopback 220.127.116.11 of R3 and decrements HSRP priority to a value lower than that of R2.
Now lets see how we can configure R1 to meet this requirement –
Now that we have configured IP SLA on R1, lets see the normal output of HSRP (standby 1) command
R1 is master while R2 is standby in normal scenario. Lets shut interface Fa0/0 of R3 which connects to R1 via Switch.
Lets keep in mind that R1 HSRP master has default priority of 100 and will decrement by 20 = becomes 80 if reachability to R3 loopback (18.104.22.168) is lost.
As seen above, combination of HSRP and IP SLA will make a good solution when we have multiple Routers running HSRP and where we need to detect any indirect link failure or Layer 1 link failure to reroute the traffic via backup HSRP Router.