0021_Cisco: FHRP

FHRP (First Hop Redundancy Protocol) is a group of protocols that provide high availability for the default gateway in a local network. The primary goal of FHRP is to automatically switch between multiple routers or Layer 3 switches in case the primary device fails.

Main FHRP protocols:

  • HSRP (Hot Standby Router Protocol) — Cisco proprietary.
  • VRRP (Virtual Router Redundancy Protocol) — open standard.
  • GLBP (Gateway Load Balancing Protocol) — Cisco proprietary with load balancing.

Purpose: Ensure continuous network access and minimize downtime during device failures.

# FHRP - First Hop Redurancy Protocol

#FHRP	|	Terminology		| Multicast IP  | Virtual MAC	| Cisco?
----------------------------------------------------------------------
# HSRP	| Active/Standbay	| v1:224.0.0.2  | 0000.0c07.acXX	| Yes
#		|					| v2:224.0.0.102| 0000.0c9f.fXXX	|
# VRRP	| Master/Backup		| 224.0.0.18	| 0000.5e00.01XX	| No
#		|					|				|					|
# GLBP	|   AVG/AVF			| 224.0.0.102	|0007.b400.XXYY		| Yes
----------------------------------------------------------------------


# R1 (Active)<==Hello messages==>R2 (Standbay)
#	.254							.253
#			\					/
#			 \				   /
#			  \				  /
#			   \			 /
#			    \			/
#					 VIP 		<-has own virtual MAC
#					.252
#
#				/			\
#			   / 		     \
#			  /				  \
#  set as a default GW | set as a default GW
#
#Gratuitous ARP: ARP replies sent without being requested (no ARP request messages was recieved)
#Then the Active router failed, the Standbay router will not recieved Hello packet and send a Gratuitous ARP
#packet and it will update all FDB tables on all switches in their domain.
#
#By default, if router back online it doesn`t become an Active router.
#You have to configure "preemption", so the old Active router does not take back its old role.

-----------------------------------------------------------------------
#HSRP (Cisco) Hot Standbay Router Protocol

#v1 - 
#v2 - support IP v6 and increase the number of groups tha can be configured
#Active and Standbay routers are elected
#Multicats address for v1 = 224.0.0.2
#Multicats address for v2 = 224.0.0.102
#Virtual MAC for v1 = 0000.0c07.acXX, where XX is a group number
#Virtual MAC for v2 = 0000.0c9f.fXXX, where XXX is a group number
#
#In a situation with multiple subnets/VLANs, you can configure a different Active router in each
#subnets/VLANs to load balance.

#VRRP - Virtual Router Redurancy Protocol
#Open standart
#Master and Backup routers are elected
#Multicats address = 224.0.0.18
#Virtual MAC = 0000.5e00.01XX, where XX is VRRP group number
#Example: For the group with number 200=0xc8, MAC address will be 0000.5e00.01c8

#GLBP - Gateway Load Balancing Protocol (Cisco)
#Load balancing among multiple routers within a single subnet
#An AVG (Active Virtual Gateway) is elected
#Up to 4 AVFs (Active Virtual Forwarders) are assingned by the AVG (the AVG itself can be an AVF too)
#Each AVF acts as a default gateway for a portion ot the hosts in the subnet.
#Multicats address = 224.0.0.102
#Virtual MAC = 0007.b400.XXYY, where XX is a GLBP group number, YY - AVF number


#CONFIGURING HSRP
#R1,R2,SW1,SW2
#R1
#int g0/0 - connected to a SW1,IP addr = 172.16.0.253/24
#int g1/0  - connected to a cloud, IP addr = 203.0.113.1
#
#R2
#int g0/0 - connected to a SW2,IP addr = 172.16.0.252/24
#int g1/0  - connected to a cloud, IP addr = 203.0.113.5
#VIP = 172.16.0.254/24	
#SW1 connected to SW2

#R1
		int g0/0
			standbay version 2
			standbay 1 ip 172.16.0.254
			standbay 1 priority <0-255>
#Active router is determinated in this order:
#Highest priority (by default 100)
#Highest IP address
			standbay 1 priority 200
			standbay 1 preempt			#need to use if you want R1 always become Active, after back online

#R2
	int g0/0	
		standbay version 2
		standbay 1 ip 172.16.0.254
		standbay 1 priority 50
		standbay 1 preempt
#Version must be the same on the routers
	show standbay