Configuring IP SLA with HSRP

Rashmi Bhardwaj | Blog,Config & Troubleshoot
Advertisements

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.

Advertisements

Configuring IP SLA 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.

Configuration:

R1#
Interface FastEthernet0/0
ip address 192.168.12.1 255.255.255.0
standby 1 ip 192.168.12.3
standby 1 preempt
!
interface FastEthernet0/1
ip address 192.168.13.1 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 192.168.13.3R2#
interface FastEthernet0/0
ip address 192.168.12.2 255.255.255.0
standby preempt
standby 1 ip 192.168.12.3
standby 1 priority 90
standby 1 preempt
!
interface FastEthernet0/1
ip address 192.168.23.2 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 192.168.23.3

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 3.3.3.3 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 –

R1#
ip sla monitor 1
type echo protocol ipIcmpEcho 3.3.3.3
frequency 5
ip sla monitor schedule 1 life forever start-time now
!
track 1 rtr 1 reachability
!
interface FastEthernet0/0
standby 1 track 1 decrement 20

Now that we have configured IP SLA on R1, lets see the normal output of HSRP (standby 1) command

R1#show standby brief
P indicates configured to preempt.
|
Interface  Grp  Prio P State   Active Standby    Virtual IP
Fa0/0          1     100  P Active local   unknown  192.168.12.3R2#sh standby brief
P indicates configured to preempt.
|
Interface   Grp   Prio  P State         Active              Standby      Virtual IP
Fa0/0           1      90     P Standby   192.168.12.1  local             192.168.12.3

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 (3.3.3.3) is lost.

R3(config-if)#int fa0/0
R3(config-if)#shut
R1#show standby brie
P indicates configured to preempt.
|
Interface   Grp Prio P     State        Active              Standby  Virtual IP
Fa0/0          1      80   P     Standby 192.168.12.2  local         192.168.12.3
R1#show standby brie
P indicates configured to preempt.
|
Interface Grp   Prio P  State        Active             Standby  Virtual IP
Fa0/0          1     80   P   Standby 192.168.12.2 local          192.168.12.3R2#show standby brief
P indicates configured to preempt.
|
Interface Grp Prio P State Active Standby Virtual IP
Fa0/0 1 90 P Active local 192.168.12.1 192.168.12.3

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.

Continue Reading:

Clear Counters of IP SLA

HSRP with Default Route Tracking

ABOUT THE AUTHOR


Leave a Comment

Your email address will not be published. Required fields are marked *

Shopping Cart