本文档介绍如何配置IPv6的热备用路由协议(HSRP)。HSRP在一组路由器中使用,以选择活动路由器和备用路由器。在一组路由器接口中,活动路由器是路由数据包的首选路由器;备用路由器是在活动路由器发生故障或满足预设条件时接管的路由器。HSRP旨在为IPv6主机仅提供虚拟第一跳。
HSRP IPv6组具有从HSRP组编号派生的虚拟MAC地址和默认情况下从HSRP虚拟MAC地址派生的虚拟IPv6本地链路地址。当HSRP组处于活动状态时,会为HSRP虚拟IPv6本地链路地址发送定期路由器通告(RA)。当组离开活动状态时,发送最终RA后,这些RA停止。
HSRP使用优先级机制来确定配置了哪台HSRP的路由器是默认活动路由器。要将路由器配置为活动路由器,您必须为其分配比所有其它配置了HSRP的路由器的优先级高的优先级。默认优先级为100;因此,如果仅将一台路由器配置为具有更高的优先级,则该路由器将成为默认活动路由器。HSRP版本2使用新的IP组播地址224.0.0.102来发送hello数据包,而不是版本1使用的组播地址224.0.0.2。
尝试进行此配置之前,请确保满足以下要求:
HSRP配置知识;有关详细信息,请参阅配置HSRP。
实施IPv6编址和基本连接的基本知识;有关详细信息,请参阅实施IPv6编址和基本连接。
必须先在接口上启用HSRP第2版,然后才能配置HSRP IPv6。
必须在设备上启用IPv6单播路由,才能配置HSRP IPv6
本文档中的配置基于Cisco IOS软件版本软件12.4(15)T 13上的Cisco 3700系列路由器。
注意:验证IPv6命令的许可证信息。
有关文档规则的信息,请参阅 Cisco 技术提示规则。
路由器R1和R2通过串行接口连接到R3。R1和R2的快速以太网接口配置了HSRP IPv6,使R1充当活动路由器,R2充当备用路由器。如果R1的串行接口S0/0关闭,R2路由器会将其状态从Standby(备用)更改为Active(主用)。
注意:使用命令查找工具(仅限注册客户)可查找有关本文档中使用的命令的详细信息。
本文档使用以下网络设置:
本文档使用以下配置:
以下是视频的链接(在思科支持社区上 ),演示如何在Cisco IOS路由器中配置HSRP for IPv6:
路由器 R1 配置 |
---|
R1#show run Building configuration... ! hostname R1 ! ip cef ! ipv6 unicast-routing ! interface FastEthernet0/0 no ip address duplex auto speed auto ipv6 address 2020:AB8:2001::1010/64 ipv6 enable standby version 2 standby 1 ipv6 autoconfig !--- Assigns a standby group and standby IP address. standby 1 priority 120 !--- R1 is configured as the active router. !--- This is done by assigning a priority value !--- (in this case 120) to the router's Fa0/0 interface. !--- The default priority value is 100. standby 1 preempt delay minimum 30 !--- The preempt command allows the router to become the !--- active router when it has the priority higher than !--- all the other HSRP-configured routers. !---- Without this command, even if a router has higher !--- priority value, it will not become an active router. !--- The delay minimum value causes the local router to postpone !--- taking over the active role for a minimum of 30 seconds. standby 1 track Serial0/0 90 !--- Indicates that HSRP tracks serial0/0. !--- The interface priority is configured (in this case 90) which !--- indicates that if the tracked interface goes down the router !--- priority value is to be decremented by 90. !--- Default decrement value is 10. ! interface Serial0/0 no ip address ipv6 enable ipv6 address 2010:AB8:2001::1010/64 clock rate 2000000 ! end |
路由器 R2 配置 |
---|
R2#show run Building configuration... ! hostname R2 ! ip cef ! ipv6 unicast-routing ! interface FastEthernet0/0 !--- R2 is configured as a standby router !--- with a default priority value of 100. no ip address duplex auto speed auto ipv6 address 2020:AB8:2001::1011/64 ipv6 enable standby version 2 standby 1 ipv6 autoconfig standby 1 preempt delay minimum 30 standby 1 track Serial0/0 ! interface Serial0/0 no ip address ipv6 address 2010:AB8:2010::1020/64 ipv6 enable clock rate 2000000 ! end |
路由器 R3 配置 |
---|
R3#show run Building configuration... ! hostname R3 ! ip cef ! ipv6 unicast-routing ! interface Serial0/0 no ip address ipv6 address 2010:AB8:2001::1011/64 ipv6 enable clock rate 2000000 ! interface Serial0/1 no ip address ipv6 address 2010:AB8:2010::1021/64 clock rate 2000000 ! end |
在R1和R2路由器上使用show standby命令以检验配置。
路由器 R1 |
---|
R1#show standby FastEthernet0/0 - Group 1 (version 2) State is Active !--- R1 router is in Active state. 4 state changes, last state change 02:51:30 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 3 sec, hold time 10 sec Next hello sent in 2.480 secs Preemption enabled, delay min 30 secs Active router is local Standby router is FE80::C010:21FF:FE78:0, priority 100 (expires in 7.036 sec) Priority 120 (configured 120) Track interface Serial0/0 state Up decrement 10 Group name is "hsrp-Fa0/0-1" (default) |
路由器 R2 |
---|
R2#show standby FastEthernet0/0 - Group 1 (version 2) State is Standby !--- R2 router is in Standby state. 4 state changes, last state change 02:51:43 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 3 sec, hold time 10 sec Next hello sent in 0.900 secs Preemption enabled, delay min 30 secs Active router is FE80::C00F:21FF:FE78:0, priority 120 (expires in 9.928 sec) MAC address is c20f.2178.0000 Standby router is local Priority 100 (default 100) Track interface Serial0/0 state Up decrement 10 Group name is "hsrp-Fa0/0-1" (default) |
如果活动路由器(本例中为R1)关闭,备用路由器会立即将其状态更改为Active,如下表所示:
当活动路由器(R1)关闭时…… |
---|
路由器 R1 R1(config)#interface s0/0 R1(config-if)#shut R1(config-if)#exit *Mar 1 00:01:34.879: %LINK-5-CHANGED: Interface Serial0/0, changed state to administratively down *Mar 1 00:01:35.879: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to down R1# *Mar 1 00:04:06.691: %SYS-5-CONFIG_I: Configured from console by console R1# *Mar 1 00:04:36.175: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 1 state Active -> Speak R1# *Mar 1 00:04:46.175: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 1 state Speak -> Standby !--- When the interface goes down, the active router changes its state to Standby.路由器 R2 *Mar 1 00:04:35.631: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 1 state Standby ->Active !--- The standby router is now the active router. R2#show standby FastEthernet0/0 - Group 1 (version 2) State is Active 2 state changes, last state change 00:10:39 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 3 sec, hold time 10 sec Next hello sent in 2.532 secs Preemption enabled, delay min 30 secs Active router is local Standby router is FE80::C00F:21FF:FE78:0, priority 30 (expires in 7.524 sec) Priority 100 (default 100) Track interface Serial0/0 state Up decrement 10 Group name is "hsrp-Fa0/0-1" (default) |
目前没有针对此配置的故障排除信息。
版本 | 发布日期 | 备注 |
---|---|---|
1.0 |
31-Oct-2011 |
初始版本 |