本文說明如何為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 IPv6之前,必須在介面上啟用HSRP版本2。
必須在裝置上啟用IPv6單播路由,才能配置HSRP IPv6
本檔案中的組態是根據Cisco IOS軟體版本軟體12.4(15)T 13上的Cisco 3700系列路由器。
注意:驗證IPv6命令的許可證資訊。
如需檔案慣例的相關資訊,請參閱思科技術提示慣例。
路由器R1和R2通過串列介面連線到R3。R1和R2的快速乙太網介面配置了HSRP IPv6,因此R1充當活動路由器,R2充當備用路由器。在R1的串列介面S0/0關閉的情況下,R2路由器會將其狀態從Standby更改為Active。
註:使用Command Lookup Tool(僅限註冊客戶)查詢有關本文檔中使用的命令的更多資訊。
本檔案會使用以下網路設定:
本檔案會使用以下設定:
以下是一個影片連結(在Cisco支援社群 上提供),演示了如何在Cisco IOS路由器中為IPv6配置HSRP:
路由器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 |
初始版本 |