Une article précédent présente HSRP ave l’IPv4. Voici comment le configurer avec l’IPv6.

Configuration d’une interface de nos routeurs avec IPv6, sans HSRP pour l’instant. Les routeurs réaliseront également l’annonce du préfixe sur le réseau.

philb@core2:~$ ssh c1803
Password: 

c1803>enable
Password:
c1803#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
c1803(config)#interface Vlan2
c1803(config-if)#ipv6 address 2001:470:1F15:D9C::/64 eui-64
c1803(config-if)#ipv6 enable
c1803(config-if)#ipv6 mtu 1480
c1803(config-if)#ipv6 nd prefix 2001:470:1F15:D9C::/64
c1803(config-if)#ipv6 nd ra lifetime 180
c1803(config-if)#ipv6 nd ra interval 30
c1803(config-if)#^Z
c1803#
philb@core2:~$ ssh c2621xm
Password:
Authorized
router>enable
Password:
c2621xm#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
c2621xm(config)#interface FastEthernet0/1.2
c2621xm(config-subif)#ipv6 address 2001:470:1F15:D9C::/64 eui-64
c2621xm(config-subif)#ipv6 enable
c2621xm(config-subif)#ipv6 mtu 1480
c2621xm(config-subif)#ipv6 nd prefix 2001:470:1F15:D9C::/64
c2621xm(config-subif)#ipv6 nd ra interval 30
c2621xm(config-subif)#ipv6 nd ra lifetime 180
c2621xm(config-subif)#^Z
c2621xm#

Avec une telle configuration, les 2 routeurs annoncent le même préfix IPv6 sur le réseau… Analysons la table routage sur une machine du réseau:

root@core2:~# ip -6 route
2001:470:1f15:d9c::/64 dev eth0  proto kernel  metric 256  expires 2147157sec mtu 1480
fe80::/64 dev eth0  proto kernel  metric 256  mtu 1480
ff00::/8 dev eth0  metric 256  mtu 1480
default via fe80::20f:23ff:fea1:5741 dev eth0  proto kernel  metric 1024  expires 179sec hoplimit 64
default via fe80::221:a0ff:fe69:fa80 dev eth0  proto kernel  metric 1024  expires 171sec hoplimit 64
root@core2:~#

Résultat: 2 routes par défaut… bof…

Configuration de HSRP pour IPv6:

c1803#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
c1803(config)#interface Vlan2
c1803(config-if)#standby 2 ipv6 autoconfig
c1803(config-if)#standby 2 preempt
c1803(config-if)#standby 2 authentication md5 key-string 0 motDePasseIPv6
c1803(config-if)#standby 2 name hsrpPhilbLocalv6
c1803(config-if)#^Z
c1803#
c2621xm#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
c2621xm(config)#interface FastEthernet0/1.2
c2621xm(config-subif)#standby 2 ipv6 autoconfig
c2621xm(config-subif)#standby 2 priority 90
c2621xm(config-subif)#standby 2 preempt
c2621xm(config-subif)#standby 2 authentication md5 key-string 0 motDePasseIPv6
c2621xm(config-subif)#standby 2 name hsrpPhilbLocalv6
c2621xm(config-subif)#^Z
c2621xm#

Vérification de la table de routage sur une machine du réseau

root@core2:~# ip -6 route
2001:470:1f15:d9c::/64 dev eth0  proto kernel  metric 256  expires 2147157sec mtu 1480
fe80::/64 dev eth0  proto kernel  metric 256  mtu 1480
ff00::/8 dev eth0  metric 256  mtu 1480
default via fe80::5:73ff:fea0:2 dev eth0  proto kernel  metric 1024  expires 170sec hoplimit 64
root@core2:~#

Et voila une seule route par défaut… Le routeur actif étant celui qui possède la priorité la plus haute…

Vérification sur les routeurs:

c1803#sh standby brief
                     P indicates configured to preempt.
                     |
Interface   Grp  Pri P State   Active          Standby         Virtual IP
Vl2         2    100 P Active  local           FE80::20F:23FF:FEA1:5741
                                                               FE80::5:73FF:FEA0:2
c1803#
c2621xm#sh standby brief
                     P indicates configured to preempt.
                     |
Interface   Grp  Pri P State   Active          Standby         Virtual IP
Fa0/1.2     2    90  P Standby FE80::221:A0FF:FE69:FA80
                                               local           FE80::5:73FF:FEA0:2
c2621xm#