> For the complete documentation index, see [llms.txt](https://davidjosearaujo.gitbook.io/online-courses/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://davidjosearaujo.gitbook.io/online-courses/ccna-200-301/first-hop-redundancy-protocols/introduction.md).

# Introduction

## First Hop Redundancy Protocols

<figure><img src="/files/ZN2ddTkrTjpwjNzyb1Kb" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/tJrzJsu9l0QW5SRJ7N24" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/mziajRay2aKmbK8tA2UD" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/AZwV0Z4kApEZ2ZNvBQlw" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
A **first hop redundancy protocol** (FHRP) is a computer networking protocol that is designed to protect the default gateway used on a subnetwork by allowing two or more routers to provide backup for that address; in the event of failure of an active router, the backup router will take over the address, usually within a few seconds.
{% endhint %}

<figure><img src="/files/VjlXTyLHwcDZ1guogtBG" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/IIIvQzbwS7nzvCSEVsv3" alt=""><figcaption></figcaption></figure>

> ### PC1
>
> "I need to send traffic to a destination in another network. My default gateway is 172.16.0.252, but I don't know the MAC address yet. I will send an ARP request to learn the MAC address of 172.16.0.252."

<figure><img src="/files/H2DW82rBNKYtnjMDIbyd" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/9Bj0b4gBGeym0hNjGuko" alt=""><figcaption><p>The <em>ACTIVE r</em>outer will respond</p></figcaption></figure>

<figure><img src="/files/QN3zmbKKIgIiHKyxRbPi" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/ndKSj1C0HnPJsI1d07Cz" alt=""><figcaption></figcaption></figure>

> ### R2
>
> "I haven't received any 'Hello' messages from R1 recently... I will become the Active router!"

<figure><img src="/files/uPoDrMsXCFISp8CdmgkX" alt=""><figcaption></figcaption></figure>

Now, Switches will need to update their ARP tables. Switches construct their ARP tables using the source MAC addresses from packets, so R2 will send **gratuitous ARP** messages to make them update their tables.

{% hint style="info" %}

### Gratuitous ARP

ARP replies sent without being requested (no ARP request message was received).

In gratuitous ARP the frames are broadcast to FFFF.FFFF.FFFF (standard ARP replies are unicast).
{% endhint %}

<figure><img src="/files/kdd0liFwHQkrEEFsoAod" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
FHRPs are 'non-preemptive'. The current active router will not automatically give up its role, even if the former active router returns.

However, you can change this setting to make R1 'preempt' R2 and take back its active role automatically.
{% endhint %}

## FHRP Summary

* A **virtual IP** is configured on the two routers, and a **virtual MAC** is generated for the virtual IP (each FHRP uses a different format for the virtual MAC).
* An **active** router and a **standby** router are elected. (different FHRPs use different terms).
* End hosts in the network are configured to use the virtual IP as their default gateway.
* The active router replies to ARP requests using the virtual MAC address, so traffic destined for other networks will be sent to it.
* If the active router fails, the standby becomes the next active router. The new active router will send **gratuitous ARP** messages so that switches will update their MAC address tables. It now functions as the default gateway.
* If the old active router comes back online, by default it won't take back its role as the active router. It will become the standby router.
* You can configure 'preemption', so that the old active router does take back its old role.
