Hot standby routing protocol
HSRP is used for gateway load balancing. In HSRP, there are 2 gateways one stay in active mode and another is standby mode. In normal condition, all traffic goes to active gateway, but if active gateway goes down because of any issue, then all traffic shift to standy gateway. When active gateway come back again traffic shift to active gateway.
Now some of you have doubt, we can configure only one gateway in host config, then how traffic will shift to other without knowing the IP address of other gateway.
So, let me clarify this, when we configure HSRP, a virtual gateway is created and that becomes the gateway for all LAN hosts.
How HSRP works?
Let’s understand with an example. Imagine below network is a company network.
To ensure network connectivity 24/7, here we took two connection from two different vendors, so that if one goes down, traffic shift to other.
Take a situation, PC1 and PC2 have gateway 1 IP address in their config and PC3 and PC4 have gateway 2 IP address in their config. Let’s suppose gateway 1 link goes down, because of some technical issue, in that case traffic should be shift to other gateway, and if gateway 2 link goes down then traffic should be shift to gateway 1.
Now, the question will traffic shift or not?
Let me tell you, traffic will not shift. Why? Because PCs have different gateway. Here we configured gateway1 in PC1 and PC2 and gateway2 in PC3. To shift traffic first we have to change the gateway manually in the host configuration.
So, what is the solution? And the answer is HSRP.
HSRP is the solution for this. In same topology, if we configure HSRP in both gateway then a virtual gateway is generated with a different IP address. And this gateway becomes the gateway for all hosts.
Now, if any one of gateway goes down then traffic will shift to other.
R1 conf t int fa0/0 ip add 192.168.1.1 255.255.255.0 no sh int loopback 0 ip add 220.127.116.11 255.0.0.0 #### HSRP ##### int fa0/0 standby 1 ip 192.168.1.3 standby 1 priority 105 standby 1 preempt R2 conf t int fa0/0 ip add 192.168.1.2 255.255.255.0 no sh int loopback 0 ip add 18.104.22.168 255.0.0.0 #### HSRP ##### int fa0/0 standby 1 ip 192.168.1.3 Check #show standby brief One Router will become Active and one standby !!