HSRP – Hot Standby Router Protocol
Configuration des interfaces
R1(config)#int fa0/0 R1(config-if)#ip address 192.168.80.251 255.255.255.0 R1(config-if)#no shutdown R2(config)#int fa0/0 R2(config-if)#ip address 192.168.80.252 255.255.255.0 R2(config-if)#no shutdown
Configuration HSRP
Exemple avec 2 groupes Hsrp (2 IPs Virtuelles)
R1(config)#int fa0/0 R1(config-if)#standby 1 priority 200 R1(config-if)#standby 1 preempt R1(config-if)#standby 1 ip 192.168.80.254 R1(config-if)#standby 2 ip 192.168.80.150 R2(config)#int fa0/0 R2(config-if)#standby 1 ip 192.168.80.254 R2(config-if)#standby 2 priority 200 R2(config-if)#standby 2 preempt R2(config-if)#standby 2 ip 192.168.80.150
Vérifications:
R1#show standby brief P indicates configured to preempt. | Interface Grp Prio P State Active Standby Virtual IP Fa0/0 1 200 P Active local 192.168.80.252 192.168.80.254 Fa0/0 2 100 Standby 192.168.80.252 local 192.168.80.150 R2#show standby brief P indicates configured to preempt. | Interface Grp Prio P State Active Standby Virtual IP Fa0/0 1 100 Standby 192.168.80.251 local 192.168.80.254 Fa0/0 2 200 P Active local 192.168.80.251 192.168.80.150
Configuration des timers
Les timers peuvent etre configurés en second ou en milisecond
- Hello interval
- Hold time
R1(config)#int fa0/0 R1(config-if)#standby 1 timers 5 15 R2(config)#int fa0/0 R2(config-if)#standby 1 timers 5 15
Vérification
R1#show standby FastEthernet0/0 - Group 1 State is Active 2 state changes, last state change 00:14:16 Virtual IP address is 192.168.80.254 Active virtual MAC address is 0000.0c07.ac01 Local virtual MAC address is 0000.0c07.ac01 (v1 default) Hello time 5 sec, hold time 15 sec Next hello sent in 1.080 secs Preemption enabled Active router is local Standby router is 192.168.80.252, priority 100 (expires in 12.688 sec) Priority 200 (configured 200) IP redundancy name is "hsrp-Fa0/0-1" (default) FastEthernet0/0 - Group 2 State is Standby 4 state changes, last state change 00:11:48 Virtual IP address is 192.168.80.150 Active virtual MAC address is 0000.0c07.ac02 Local virtual MAC address is 0000.0c07.ac02 (v1 default) Hello time 3 sec, hold time 10 sec Next hello sent in 2.016 secs Preemption disabled Active router is 192.168.80.252, priority 200 (expires in 8.004 sec) Standby router is local Priority 100 (default 100) IP redundancy name is "hsrp-Fa0/0-2" (default)
Authentification
R1(config-if)#standby 2 authentication CISCO12345 R2(config)#int fa0/0 R2(config-if)#standby 2 authentication CISCO12345
Vérifications
R1#show standby FastEthernet0/0 - Group 1 State is Active 2 state changes, last state change 00:19:52 Virtual IP address is 192.168.80.254 Active virtual MAC address is 0000.0c07.ac01 Local virtual MAC address is 0000.0c07.ac01 (v1 default) Hello time 5 sec, hold time 15 sec Next hello sent in 0.300 secs Preemption enabled Active router is local Standby router is 192.168.80.252, priority 100 (expires in 11.888 sec) Priority 200 (configured 200) IP redundancy name is "hsrp-Fa0/0-1" (default) FastEthernet0/0 - Group 2 State is Standby 7 state changes, last state change 00:01:09 Virtual IP address is 192.168.80.150 Active virtual MAC address is 0000.0c07.ac02 Local virtual MAC address is 0000.0c07.ac02 (v1 default) Hello time 3 sec, hold time 10 sec Next hello sent in 2.204 secs Authentication text "CISCO123" Preemption disabled Active router is 192.168.80.252, priority 200 (expires in 8.204 sec) Standby router is local Priority 100 (default 100) IP redundancy name is "hsrp-Fa0/0-2" (default)
Standby Name
R1(config)#int fa0/0
R1(config-if)#standby 1 name GW-1
R2(config)#int fa0/0
R2(config-if)#standby 1 name GW-1
Utilisation des mac addres physique
R1(config)#int fa0/0 R1(config-if)#standby use-bia R2(config)#int fa0/0 R2(config-if)#standby use-bia
R1#show standby FastEthernet0/0 - Group 1 State is Active 4 state changes, last state change 00:13:56 Virtual IP address is 192.168.80.254 Active virtual MAC address is 000f.f7b1.a580 Local virtual MAC address is 000f.f7b1.a580 (bia) Hello time 5 sec, hold time 15 sec Next hello sent in 3.692 secs Preemption enabled Active router is local Standby router is 192.168.80.252, priority 100 (expires in 14.060 sec) Priority 200 (configured 200) IP redundancy name is "GW-1" (cfgd) FastEthernet0/0 - Group 2 State is Standby 19 state changes, last state change 00:03:04 Virtual IP address is 192.168.80.150 Active virtual MAC address is 000c.ce46.dca0 Local virtual MAC address is 000f.f7b1.a580 (bia) Hello time 3 sec, hold time 10 sec Next hello sent in 1.684 secs Authentication text "CISCO123" Preemption disabled Active router is 192.168.80.252, priority 200 (expires in 7.664 sec) Standby router is local Priority 100 (default 100) IP redundancy name is "hsrp-Fa0/0-2" (default)
HSRP & SNMP
en cas d’événement HSRP, les routeurs peuvent envoyer une trap snmp à serveur et avec une communautée snmp spécifique
R1(config)#snmp-server enable traps hsrp R1(config)#snmp-server host 192.168.1.1 public hsrp
Tracking d’interface
l’état d’une interface peut être vérifié afin de décrémenter la priorité du groupe hsrp en cas de défaillance
R1(config)#int fa0/0
R1(config-if)#standby 1 track s0/0 50
Vérification:
R1#show standby brief
P indicates configured to preempt.
|
Interface Grp Prio P State Active Standby Virtual IP
Fa0/0 1 150 P Active local 192.168.80.252 192.168.80.254
Fa0/0 2 100 Standby 192.168.80.252 local 192.168.80.150