Friday, 6 March 2020

Hot Standby Router Protocol (HSRP)

HSRP


1) HSRP is a Cisco Proprietary Protocol.

2) Provides default gateway Redundancy.

3) All routers which are participating in HSRP are assinged to single HSRP group ( 0 - 255)

4) A HSRP Virtual IP Address (VIP) is configured and assigned to all the router in HSRP group.

R1(config)#interface Gi0/0    --> THE HSRP Interface
R1(config-if)#ip address 10.1.1.2
R1(config-if)#standby 10 ip address 10.1.1.1 --->  HSRP group is 10 and the VIP is 10.1.1.1

R2(config)#interface Gi0/0 
R2(config-if)#ip address 10.1.1.3
R2(config-if)#standby 10 ip address 10.1.1.1

R3(config)#interface Gi0/0 
R3(config-if)#ip address 10.1.1.4
R3(config-if)#standby 10 ip address 10.1.1.1

5)The HSRP group is also assigned with a virtual MAC address.

By default the Virtual MAC address is -

0000.0c07.acxx

xx is the HSRP group

0000.0c07.ac10

Here the HSRP group is 10.

6) Routers Role election in HSRP -

In HSRP one Active and Standby router are elected.

Active Router - The router which is currently serving as gateway

Standy Router - The backup router to the Active Router.

Listening Router - The other routers participating in HSRP.

7) HSRP Active and Standby Router election depends upon the HSRP Priority of HSRP Interface of the Router.

Priority ranges from 0 - 255 .

Default is 100.

The router with the highest priority is elected as Active.

The router with the second highest priority is elected as Standby.

If all the routers have equal priority then the router with highest IP address on its HSRP Interface is elected as
the Active Router.

8) HSRP Routers exchanges Hello packets to ensure all the routers are functioning.

9) HSRP hello packets are sent by the HSRP Interface of the router on mutlicast address 224.0.0.2 over UDP Port 1985.

10) Timers in HSRP.

By default

Hello Timer - 3 Seconds
Holddown Timer - 10 Seconds

But we can change the timers -

R1(config)#interface Gi0/0
R1(config-if)#standby 10 timer 5 15

Here Hello timer is set to 5 seconds and Holddown timer is set to 15 seconds .
Normally Holdtimer is set thrice the Hello Timer.

11) HSRP States

In HSRP routers goes through serveral states before settling into a role.

Disabled - the interfaces is not configured for HSRP or it is admin down.

Init - This is the starting state when the HSRP interface is configured or when it is enabled.

Learn - The router is waiting to hear hellos from the Active Routers and learn the configured Virtual IP address.

Listen - The router has learned the Virtual IP address and will listen for hello messages from other HSRP routers.

Speak - The router is currently participating in an Active Router election and is "sending Hellos Packets".

Standby - The router didn't becomes active and become standby . It will contiue sending Hello Packets and incase Active router
fails will take the role of Active router.

Active - The router is currently acitve and serving as default gateway and forwarding the user traffic .

Note - Speak , Standby and Active are the states where the HSRP interface of the router sends Hello packets.


12) HSRP Preempt .

By default , in case the Active router goes down then the standby router will become Active router.
and when the Downed Active router again comes up will not become Active Router .

For the Downed Active router to become Active again needs to claim the status and this can be done by using "Preempt".

Also, in case a new router is added to HSRP group with highest priority won't become the Active by default .The router with lower priority will contiune in
the role of Active since it powered up and become the member of the HSRP group prior to the newly added router.

Configuration
R1(config)#interface Gi0/0
R1(config-if)#standby 10 preempt

! We can add some delay for the preempt so that the router will wait for some amount of time before becoming active
R1(config-if)#standby 10 preempt delay minimum 10

Here the router will will wait for 10 Seconds to claim the Active status


Thanks for Reading !!!!!

1 comment:

  1. Excellent ! please include interfacing tracking and hsrp load balancing ,if possible.

    ReplyDelete