---
title: "HSRP, VRRP & GLBP — Redondance passerelle"
domain: network
subdomain: switching
type: snippet
tags: [hsrp, vrrp, glbp, fhrp, cisco, redundancy, gateway, svi, failover]
difficulty: intermediate
status: stable
updated: "2025-05-14"
---
## HSRP v2 — Hot Standby Router Protocol (Cisco)

```text
interface {{SVI_OR_INTERFACE}}
 ! Groupe HSRP avec IP virtuelle
 standby {{GROUP}} ip {{VIRTUAL_IP}}

 ! Priorité (défaut 100) — le plus haut devient Active
 standby {{GROUP}} priority 110

 ! Reprendre le rôle Active dès que priorité redevient la plus haute
 standby {{GROUP}} preempt
 standby {{GROUP}} preempt delay minimum 30

 ! Timers : hello 1s, hold 3s (défaut 3s/10s — réduire pour convergence rapide)
 standby {{GROUP}} timers 1 3

 ! Tracking : si l'interface uplink tombe, décrémenter la priorité
 standby {{GROUP}} track {{UPLINK_INTERFACE}} decrement 20

 ! Authentification MD5
 standby {{GROUP}} authentication md5 key-string {{HSRP_KEY}}

 ! Version 2 obligatoire (IPv6 + groupes 0-4095)
 standby version 2
```

### États HSRP

```
Initial  →  Learn  →  Listen  →  Speak  →  Standby  →  Active
```

```
Initial  : processus HSRP démarrant
Learn    : en attente de l'IP virtuelle (pas encore reçue)
Listen   : connaît l'IP virtuelle, ni Active ni Standby
Speak    : envoie des Hello, participe à l'élection
Standby  : backup — surveille l'Active, prêt à prendre le relai
Active   : répond à l'IP/MAC virtuelle, achemine le trafic
```

### Vérification HSRP

```text
show standby
show standby brief
show standby vlan {{VLAN_ID}}
debug standby events
```

---

## VRRP — Virtual Router Redundancy Protocol (RFC 5798)

```text
interface {{SVI_OR_INTERFACE}}
 vrrp {{GROUP}} ip {{VIRTUAL_IP}}
 vrrp {{GROUP}} priority 110
 vrrp {{GROUP}} preempt

 ! Timer advertise en secondes (défaut 1s)
 vrrp {{GROUP}} timers advertise 1

 ! Authentication (VRRP v3 ne supporte plus l'auth — utiliser IPSec si besoin)
 vrrp {{GROUP}} authentication {{VRRP_KEY}}
```

### Vérification VRRP

```text
show vrrp
show vrrp brief
show vrrp interface {{INTERFACE}}
```

---

## GLBP — Gateway Load Balancing Protocol (Cisco, actif-actif)

```text
interface {{SVI_OR_INTERFACE}}
 glbp {{GROUP}} ip {{VIRTUAL_IP}}
 glbp {{GROUP}} priority 110
 glbp {{GROUP}} preempt

 ! Algorithmes de load balancing
 glbp {{GROUP}} load-balancing round-robin
 ! Alternatives : weighted | host-dependent

 ! Weighting pour load balancing pondéré
 glbp {{GROUP}} weighting 110 lower 90 upper 105
 glbp {{GROUP}} weighting track 1 decrement 20

 ! Timers
 glbp {{GROUP}} timers 1 3
```

### Vérification GLBP

```text
show glbp
show glbp brief
show glbp detail
```

---

## Comparaison HSRP / VRRP / GLBP

```
Critère              HSRP v2              VRRP (RFC 5798)      GLBP
Standard             Propriétaire Cisco   RFC 5798 (ouvert)    Propriétaire Cisco
Actif-actif          Non (1 Active)       Non (1 Master)       Oui (plusieurs AVF)
Groupes supportés    0 – 4095             0 – 255              0 – 1023
IPv6                 Oui (v2)             Oui (v3)             Oui
Interopérabilité     Cisco uniquement     Multi-vendor         Cisco uniquement
MAC virtuelle        0000.0c9f.fXXX       0000.5e00.01XX       0007.b4XX.XXYY
Rôles                Active / Standby     Master / Backup      AVG + AVF
Cas d'usage          Standard Cisco       Infra multi-vendor   Max utilisation liens
```

<Tip>
Utiliser HSRP v2 et non v1 : la version 2 supporte IPv6, les groupes de 0 à 4095 (contre 0-255 en v1), et une meilleure précision des timers en millisecondes. Pour migrer sans interruption : configurer `standby version 2` — les deux versions ne sont pas compatibles dans le même groupe, donc synchroniser les deux switchs simultanément.
</Tip>
