HSRP是FHRP设计的,以便在第一跳IP路由器透明的故障转移。 HSRP提供网络高可用性,基于以太网环境下提供的第一跳路由冗余,HSRP的是用在路由器组选择一个积极的路由器和备用路由器。在一个路由器接口组,IPv6主机通过IPv6邻居发现机制学习IPv6路由器相关信息,采用多播定期发送,HSRP的目的是只提供一个虚拟的IPv6主机第一跳,其具体特征如下:
l 许多地方与IPv4 HSRP协议相似
l 变化发生在邻居广告、路由器广告和ICMPv6重定向
l 在主机上无需配置网关
l 虚拟MAC地址来源于HSRP组号和虚拟IPv6链路本地地址
l IPv6虚拟MAC范围:0005.73A0.0000 -0005.73A0.0FFF(4096 addresses)
l IPv6 HSRP使用UDP端口号2029
l IPv6 HSRP没有secondary address
l IPv6 HSRP没有特定的debug
其报文格式如下所示:
IPv6 HSRP协议_第1张图片
通过实验了解IPv6 HSRP,如下拓扑图所示:
IPv6 HSRP协议_第2张图片
R1 配置
R1#sh running-config
Building configuration...
Current configuration : 1042 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
ip subnet-zero
ip cef
!
!
!
!
!
ipv6 unicast-routing
ipv6 cef
!
!
!
!
!
!
interface FastEthernet0/0
no ip address
duplex full
ipv6 address 2001:1:1::1/64
standby version 2
standby 1 ipv6 autoconfig
standby 1 timers msec 250 msec 800
standby 1 authentication md5 key-string cisco
!
interface Ethernet1/0
no ip address
duplex half
ipv6 address 2001:10:1::1/64
!
interface Ethernet1/1
no ip address
shutdown
duplex half
!
interface Ethernet1/2
no ip address
shutdown
duplex half
!
interface Ethernet1/3
no ip address
shutdown
duplex half
!
ip classless
no ip http server
no ip http secure-server
!
!
!
logging alarm informational
!
!
!
!
control-plane
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
stopbits 1
line aux 0
stopbits 1
line vty 0 4
login
!
!
end
R2 配置
R2#sh running-config
Building configuration...
Current configuration : 1119 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
ip subnet-zero
ip cef
!
!
!
!
!
ipv6 unicast-routing
ipv6 cef
!
!
!
!
!
!
interface FastEthernet0/0
no ip address
duplex full
ipv6 address 2001:1:1::2/64
standby version 2
standby 1 ipv6 autoconfig
standby 1 timers msec 250 msec 800
standby 1 priority 120
standby 1 preempt
standby 1 authentication md5 key-string cisco
standby 1 track Ethernet1/0 30
!
interface Ethernet1/0
no ip address
duplex half
ipv6 address 2001:20:1::1/64
!
interface Ethernet1/1
no ip address
shutdown
duplex half
!
interface Ethernet1/2
no ip address
shutdown
duplex half
!
interface Ethernet1/3
no ip address
shutdown
duplex half
!
ip classless
no ip http server
no ip http secure-server
!
!
!
logging alarm informational
!
!
!
!
control-plane
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
stopbits 1
line aux 0
stopbits 1
line vty 0 4
login
!
!
end
查看状态信息
R2#sh standby brief
P indicates configured to preempt.
|
Interface Grp Pri P State Active Standby Virtual IP
Fa0/0 1 120 P Active local FE80::C800:14FF:FEA0:0
FE80::5:73FF:FEA0:1
R2#sh standby
FastEthernet0/0 - Group 1 (version 2)
State is Active
10 state changes, last state change 00:03:04
Virtual IP address is FE80::5:73FF:FEA0:1
Active virtual MAC address is 0005.73a0.0001
Local virtual MAC address is 0005.73a0.0001 (v2 IPv6 default)
Hello time 250 msec, hold time 800 msec
Next hello sent in 0.102 secs
Authentication MD5, key-string "cisco"
Preemption enabled
Active router is local
Standby router is FE80::C800:14FF:FEA0:0, priority 100 (expires in 0.472 sec)
Priority 120 (configured 120)
Track interface Ethernet1/0 state Up decrement 30
IP redundancy name is "hsrp-Fa0/0-1" (default)
R1#debug standby events
R2#debug standby events
R2(config-if)#
*Sep 20 22:20:02.667: HSRP: Fa0/0 Interface UP
*Sep 20 22:20:02.667: HSRP: Fa0/0 Starting minimum interface delay (1 secs)
*Sep 20 22:20:03.667: HSRP: Fa0/0 Interface min delay expired
*Sep 20 22:20:03.667: HSRP: Fa0/0 Grp 1 Init: a/HSRP enabled
*Sep 20 22:20:03.667: HSRP: Fa0/0 Grp 1 Init -> Listen
*Sep 20 22:20:03.667: HSRP: Fa0/0 Grp 1 Redundancy "hsrp-Fa0/0-1" state Init -> Backup
*Sep 20 22:20:04.467: HSRP: Fa0/0 Grp 1 Listen: c/Active timer expired (unknown)
*Sep 20 22:20:04.467: HSRP: Fa0/0 Grp 1 Listen -> Speak
*Sep 20 22:20:04.467: HSRP: Fa0/0 Grp 1 Redundancy "hsrp-Fa0/0-1" state Backup -> Speak
*Sep 20 22:20:04.651: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Sep 20 22:20:04.651: %ENTITY_ALARM-6-INFO: CLEAR INFO Fa0/0 Physical Port Administrative State Down
*Sep 20 22:20:05.267: HSRP: Fa0/0 Grp 1 Speak: d/Standby timer expired (unknown)
*Sep 20 22:20:05.267: HSRP: Fa0/0 Grp 1 Standby router is local
*Sep 20 22:20:05.267: HSRP: Fa0/0 Grp 1 Speak -> Standby
*Sep 20 22:20:05.267: %HSRP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Speak -> Standby
*Sep 20 22:20:05.271: HSRP: Fa0/0 Grp 1 Redundancy "hsrp-Fa0/0-1" state Speak -> Standby
*Sep 20 22:20:05.271: HSRP: Fa0/0 Grp 1 Standby: c/Active timer expired (unknown)
*Sep 20 22:20:05.271: HSRP: Fa0/0 Grp 1 Active router is local
*Sep 20 22:20:05.275: HSRP: Fa0/0 Grp 1 Standby router is unknown, was local
*Sep 20 22:20:05.275: HSRP: Fa0/0 Grp 1 Standby -> Active
*Sep 20 22:20:05.275: %HSRP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Standby -> Active
*Sep 20 22:20:05.275: HSRP: Fa0/0 Grp 1 Redundancy "hsrp-Fa0/0-1" state Standby -> Active
*Sep 20 22:20:05.651: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
*Sep 20 22:20:07.319: HSRP: Fa0/0 Grp 1 Standby router is FE80::C800:14FF:FEA0:0
R1(config-if)#
*Sep 20 22:19:55.771: HSRP: Fa0/0 Interface UP
*Sep 20 22:19:55.775: HSRP: Fa0/0 Starting minimum interface delay (1 secs)
*Sep 20 22:19:56.371: HSRP: Fa0/0 Grp 1 Standby router is FE80::C800:34FF:FE70:0
*Sep 20 22:19:56.419: HSRP: Fa0/0 Grp 1 Active router is FE80::C800:34FF:FE70:0
*Sep 20 22:19:56.419: HSRP: Fa0/0 Grp 1 Standby router is unknown, was FE80::C800:34FF:FE70:0
*Sep 20 22:19:56.775: HSRP: Fa0/0 Interface min delay expired
*Sep 20 22:19:56.775: HSRP: Fa0/0 Grp 1 Init: a/HSRP enabled
*Sep 20 22:19:56.775: HSRP: Fa0/0 Grp 1 Init -> Listen
*Sep 20 22:19:56.775: HSRP: Fa0/0 Grp 1 Redundancy "hsrp-Fa0/0-1" state Init -> Backup
*Sep 20 22:19:57.575: HSRP: Fa0/0 Grp 1 Listen: d/Standby timer expired (unknown)
*Sep 20 22:19:57.575: HSRP: Fa0/0 Grp 1 Listen -> Speak
*Sep 20 22:19:57.575: HSRP: Fa0/0 Grp 1 Redundancy "hsrp-Fa0/0-1" state Backup -> Speak
*Sep 20 22:19:57.759: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Sep 20 22:19:57.759: %ENTITY_ALARM-6-INFO: CLEAR INFO Fa0/0 Physical Port Administrative State Down
*Sep 20 22:19:58.375: HSRP: Fa0/0 Grp 1 Speak: d/Standby timer expired (unknown)
*Sep 20 22:19:58.375: HSRP: Fa0/0 Grp 1 Standby router is local
*Sep 20 22:19:58.375: HSRP: Fa0/0 Grp 1 Speak -> Standby
*Sep 20 22:19:58.375: %HSRP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Speak -> Standby
*Sep 20 22:19:58.379: HSRP: Fa0/0 Grp 1 Redundancy "hsrp-Fa0/0-1" state Speak -> Standby
*Sep 20 22:19:58.759: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up