MDstable
NoteSnippetChecklistPlaybook

HSRP, VRRP & GLBP — Redondance passerelle

Configurer FHRP : HSRP v2, VRRP, GLBP pour haute disponibilité des passerelles

snippetintermediate 2025-05-14 3 min read
hsrpvrrpglbpfhrpciscoredundancygatewaysvifailover

HSRP v2 — Hot Standby Router Protocol (Cisco)

text
Variables
{{SVI_OR_INTERFACE}}
{{GROUP}}
{{VIRTUAL_IP}}
{{UPLINK_INTERFACE}}
{{HSRP_KEY}}
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 dmarrant
Learn en attente de lIP virtuelle pas encore reue
Listen connat lIP virtuelle ni Active ni Standby
Speak envoie des Hello participe llection
Standby backup surveille lActive prt prendre le relai
Active rpond lIP/MAC virtuelle achemine le trafic

Vérification HSRP

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

VRRP — Virtual Router Redundancy Protocol (RFC 5798)

text
Variables
{{SVI_OR_INTERFACE}}
{{GROUP}}
{{VIRTUAL_IP}}
{{VRRP_KEY}}
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
Variables
{{INTERFACE}}
show vrrp
show vrrp brief
show vrrp interface {{INTERFACE}}

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

text
Variables
{{SVI_OR_INTERFACE}}
{{GROUP}}
{{VIRTUAL_IP}}
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

Critre HSRP v2 VRRP RFC 5798 GLBP
Standard Propritaire Cisco RFC 5798 ouvert Propritaire Cisco
Actif-actif Non 1 Active Non 1 Master Oui plusieurs AVF
Groupes supports 0 4095 0 255 0 1023
IPv6 Oui v2 Oui v3 Oui
Interoprabilit Cisco uniquement Multi-vendor Cisco uniquement
MAC virtuelle 0000fXXX 0000 0007b4XXXXYY
Rles Active Standby Master Backup AVG AVF
Cas dusage 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.

OPS·BRAIN v1.027 notes · Networklocal