First Hop Redundancy Protocols in Network

First Hop Redundancy Protocols (FHRPs) are networking protocols that are used to provide redundancy for the first hop in a path from a client device to an external network, such as the internet. This first hop is usually a router or layer 3 switch. FHRPs provide a mechanism to automatically failover to a backup first-hop router if the primary first-hop router fails. The three most commonly used FHRPs are:

  1. Hot Standby Router Protocol (HSRP)
  2. Virtual Router Redundancy Protocol (VRRP)
  3. Gateway Load Balancing Protocol (GLBP)

Let’s start with a brief explanation of each, followed by sample configurations and situations where each would be beneficial.

HSRP

Hot Standby Router Protocol (HSRP) is a Cisco-proprietary redundancy protocol. HSRP allows two or more HSRP-configured routers to use the MAC address and IP network address of a virtual router. These routers share the load of packets for the virtual router’s IP network address. Only one router is actively used at any given time (Active Router), the others are on standby (Standby Router) in case the Active one fails.

Below is a simple example of how to configure HSRP:

ciscoCopy codeRouter1(config)# interface gigabitethernet 0/0
Router1(config-if)# ip address 192.0.2.2 255.255.255.0
Router1(config-if)# standby 1 ip 192.0.2.1
Router1(config-if)# standby 1 priority 105
Router1(config-if)# standby 1 preempt

Router2(config)# interface gigabitethernet 0/0
Router2(config-if)# ip address 192.0.2.3 255.255.255.0
Router2(config-if)# standby 1 ip 192.0.2.1

In this configuration, Router1 is the primary HSRP router and Router2 is the standby. The command standby 1 preempt means that if Router1 recovers after a failure, it will immediately take over from Router2.

VRRP

Virtual Router Redundancy Protocol (VRRP) achieves the same objective as HSRP but it’s an open standard. This means that it’s not limited to Cisco devices. It elects a master router and the rest become backups.

Here is a sample configuration for VRRP:

ciscoCopy codeRouter1(config)# interface gigabitethernet 0/0
Router1(config-if)# ip address 192.0.2.2 255.255.255.0
Router1(config-if)# vrrp 1 ip 192.0.2.1
Router1(config-if)# vrrp 1 priority 105
Router1(config-if)# vrrp 1 preempt

Router2(config)# interface gigabitethernet 0/0
Router2(config-if)# ip address 192.0.2.3 255.255.255.0
Router2(config-if)# vrrp 1 ip 192.0.2.1

Here, like HSRP, Router1 will be the primary router and Router2 is the backup. vrrp 1 preempt has the same function as in HSRP.

GLBP

Gateway Load Balancing Protocol (GLBP) is another Cisco-proprietary protocol that offers load balancing in addition to redundancy. While HSRP and VRRP allow for only one active/primary router at a time, GLBP allows for use of multiple routers at the

regenerate response with more of an explannaton and reason for use of eachChatGPT

First Hop Redundancy Protocols (FHRPs) are crucial in modern networking infrastructures because they ensure network availability by providing redundancy at the first routing point from the host perspective (hence the name). Cisco has been instrumental in the creation and implementation of FHRPs, with some of them being Cisco proprietary while others are open standards.

Now, let’s delve into three main FHRPs:

  1. Hot Standby Router Protocol (HSRP)
  2. Virtual Router Redundancy Protocol (VRRP)
  3. Gateway Load Balancing Protocol (GLBP)

HSRP

Hot Standby Router Protocol (HSRP) is a Cisco-proprietary protocol. Its main purpose is to create a highly available default gateway that hosts can use to send traffic to the network. This is achieved by grouping two or more routers together in what’s known as an HSRP group or standby group.

One of these routers is elected as the active router, and another is chosen as a standby router. The active router assumes the role of forwarding packets sent to the virtual IP address, while the standby router monitors the active router and is ready to take over if the active router fails.

An important use case for HSRP is when you want to provide high availability in a Cisco-only environment, but do not require load balancing between gateways.

Here’s a code snippet configuring HSRP:

ciscoCopy codeRouter1(config)# interface gigabitethernet 0/0
Router1(config-if)# ip address 192.0.2.2 255.255.255.0
Router1(config-if)# standby 1 ip 192.0.2.1
Router1(config-if)# standby 1 priority 105
Router1(config-if)# standby 1 preempt

Router2(config)# interface gigabitethernet 0/0
Router2(config-if)# ip address 192.0.2.3 255.255.255.0
Router2(config-if)# standby 1 ip 192.0.2.1

In this configuration, Router1 is the primary HSRP router (due to the higher priority) and Router2 is the standby. The standby 1 preempt command means that if Router1 recovers after a failure, it will immediately take back the active role from Router2.

VRRP

Virtual Router Redundancy Protocol (VRRP), like HSRP, is designed to eliminate the single point of failure of a default gateway. The primary difference is that VRRP is a standard protocol (defined in RFC 3768), making it vendor-neutral and not limited to just Cisco devices.

VRRP operates similarly to HSRP, in that one router is elected as the master router (like the active router in HSRP), and the others are backups. A key distinction is that the master router in VRRP is the router with the highest IP address or priority in the VRRP group, while in HSRP, the standby router takes over the role of the active router upon failure.

You would opt for VRRP in multi-vendor environments or when you want to use the real IP address of a router as the virtual IP address.

Here is a sample configuration for VRRP:

ciscoCopy codeRouter1(config)# interface gigabitethernet 0/0
Router1(config-if)# ip address 192.0.2.2 255.255.255.0
Router1(config-if)# vrrp 1 ip 192.0.2.1
Router1(config-if)# vrrp 1 priority 105
Router1(config-if)# vrrp 1 preempt

Router2(config)# interface gigabitethernet 0/0
Router2(config-if)# ip address 192.0.2.3 255.255.255.0
Router2(config-if)# vrrp 1 ip 192.0.2.1

In this scenario, Router1 is the master and Router2 is the backup. The vrrp 1 preempt command ensures Router1 resumes as master once it’s back online after a failure.

GLBP

Gateway Load Balancing Protocol (GLBP) is another Cisco-proprietary protocol. It offers both high availability and load balancing between routers in a GLBP group. Unlike HSRP and VRRP, which only allow for one active/primary router at a time, GLBP allows for multiple active routers known as “forwarders” that share the traffic load.

GLBP is useful in scenarios where both redundancy and load balancing between multiple gateways are required. If you have a network with two equal cost links to the internet, for example, you would choose GLBP to efficiently utilize both links instead of leaving one idle.

Below is a basic configuration for GLBP:

ciscoCopy codeRouter1(config)# interface gigabitethernet 0/0
Router1(config-if)# ip address 192.0.2.2 255.255.255.0
Router1(config-if)# glbp 1 ip 192.0.2.1
Router1(config-if)# glbp 1 priority 105
Router1(config-if)# glbp 1 preempt

Router2(config)# interface gigabitethernet 0/0
Router2(config-if)# ip address 192.0.2.3 255.255.255.0
Router2(config-if)# glbp 1 ip 192.0.2.1

In this configuration, both Router1 and Router2 participate in the GLBP group. Router1 has a higher priority and will be the active virtual gateway (AVG), responsible for assigning roles among the other routers (the active virtual forwarders or AVFs) in the group.

Leave a Reply