Saturday, February 22, 2025

HSRP(Hot Standby Router Protocol)

 First Hop Redundancy Protocol (HSRP)–

1. HSRP stands for – Hot standby router protocol.

2. It is a Cisco proprietary protocol.

3. It is used to provide redundandancy in the network, Suppose If we have two links primary & secondary link and In case of primary link goes down then secondary link will take over and all the traffic will go through via secondary link.

OR

4. It’s aggregate two or more physical gateway into a single virtual gateway.

5. Hello timer-3sec , Hold down timer -10sec (by default)

6. It uses multicast address to send hello message -224.0.0.2 and for HSRP version 2 – 224.0.0.102

7. By default priority – 100 but you can change up to 255.

8. HSRP uses UDP port number – 1985

9. It uses multicast mac–address – 0000:0607.acXX Where XX represents group number, what you assigned on the router while configuring group no.

10. By default group no -0 but you can change it up to 255.

11. Supports plain text, MD5 authentication.

12. By default preempt is disabled for active router and preempt command works when you configure it on the router.

13. By default built in track command is enabled.

14. By default in priority is decrement – 10 Note 1 – For one group only one device can be active and one device can be standby, remaining device would be listening state.

HSRP election process (Bydefault)–

1. Priority

2. Highest active physical interface IP address.



Note 2 - If you enable HSRP within 10sec (Hold down timer) then election would be on the basis of physical IP address, as you know that by default priority is 100 in HSRP and if you have changed priority and also enabled preempt then election will be done on the basis of priority and that router’s priority will be higher become active, second highest priority– standby.

HSRP States –

There are six states in HSRP.

1. Disabled state

2. Init state (initialization

3. Speak state

4. Listen state

5. Standby state

6. Active state

Disabled state –

This is the state of a device that is not yet ready or able to participate in HSRP

Init state –

This is the first state when HSRP starts. You’ll see this when HSRP just got enabled on the interface.

Listen state –

The router knows the virtual IP address and will listen for hello messages from other HSRP routers.

Speak state –

The router will send hello messages and will join the election to see which router will become active or standby.

Standby –

The router didn’t become the active router but will keep sending hello messages. If the active router fails it will take over.

Active –

The router will send hello messages and will join the election to see which router will become active or standby. 

Let’s understand few scenarios in HSRP –


Condition 1- If priority by default is 100 and we enable HSRP on every router (R1,R2,R3) within 10sec then R3 router will become Active router as on R3 IP address is highest IP address, and second highest IP address will become standby (R2) and R3 would be listing state. Let’s prove it.

I have just enabled HSRP within 10sec on every router, didn’t change priority of router then got output and you do delay while configuring then that router would be active router on which you enabled HSRP first.

• RTR(config)#interface gigabitEthernet 1/0

RTR(config-if)#standby 1 ip 192.168.1.100




Condition-2:

 If you have changed priority on every router then that router would be active of which priority is high than other router and second highest priority would be standby (R2). And In my scenario I have taken 50mbps link from ISP then we have to utilize the link accordingly.



Condition – 3
If you have seen two things above now there are one condition here If you change the priority of R3 router and want to make active router it, then It will not become active router unless/until R1 router goes down. Till then R3 will not become active router. And R3 router can only give the challenge to R2 router as R2’s priority less than R3 router, here I’m going to change priority of R3 router which I have changed – 150 and R3 router is giving to challenge R2 router because R2 router ‘s priority 120. Hence R3 router will become standby state, R2 would be listen state and still you will see that R1 router is in Active state. Let’ prove it.

• (config)#interface gigabitEthernet 3/0
• RTR(config-if)#standby 1 priority 150


Point to be noted – why R3 router didn’t get active router – Still I didn’t enabled preempt on every router, one more thing we want to know preempt works when we have configure priority on every router. 

Condition-4:

Now I’m going to enabled Preempt on every router and this command will push to every router that my router’s priority is higher than you therefore I will become active router and second router’s priority will be come standby router, other would be listing state. Let’s verify it.

• Airtel_RTR(config)#interface gigabitEthernet 1/0
• Airtel_RTR(config-if)#standby 1 preempt

 


As you can see that preemption is enabled on every router and If you want to change priority of any router lets assumed you changed the priority and you want that router will become active router, till then that router would not become active router unless active router goes down. Once you enabled preemption then election will be on behalf of priority.

Now I’m going to show full topology and with discuss it – whatever I have written in the binning.

Here I have taken screenshot to show you only one router –


HSRP  Topology:


How to enable HSRP –

RTR(config-if)#interface gigabitEthernet 1/0
RTR(config-if)#standby 1 ip 192.168.1.100

How to change priority – ( 0-255)

RTR(config-if)#interface gigabitEthernet 1/0
RTR(config-if)#standby 1 priority 130 How to enable preempt command –
RTR(config-if)#interface gigabitEthernet 1/0
RTR(config-if)#standby 1 preempt

Below the command what I did up to here –



Output of HSRP:


Let’s check it - It is reachable from LAN PC.



Let’s assume that If WAN link goes down then what will you do – All traffic will come at Airtel_RTR, Just simply will be drop as at that time on Airtel router - will be active state. Then we need to enable track command on the router.



How to configure Dynamic Routing protocols in palo Alto Firewall(BGP and OSPF )

 BGP vs2 OSPF: Configure Interfaces Go to Network > Interfaces . Select the interface (e.g., ethernet1/1, ethernet 1/2, ethernet 1/...