IP : 热备份路由协议 (HSRP)

IPv6 HSRP配置示例

2016 年 10 月 24 日 - 机器翻译
其他版本: PDFpdf | 英语 (2015 年 8 月 22 日) | 反馈


目录


简介

本文描述如何配置IPv6的Hot Standby Routing Protocol (HSRP)。HSRP在路由器的一组内用于为了选择活动路由器和备用路由器。在路由器接口的一组中,活动路由器是选择路由器路由信息包的;备用路由器是接管的路由器,当活动路由器出故障或,当预先设置情况符合时。HSRP设计为IPv6主机提供仅一虚拟第一跳。

即HSRP IPv6组有从HSRP组编号和一个虚拟IPv6链路本地地址派生默认情况下的一个虚拟MAC地址,派生从HSRP虚拟MAC地址。定期路由器通告(Ras)为HSRP虚拟IPv6链路本地地址发送,当HSRP组是活跃的时。这些Ras终止,在最终RA发送后,当组离开活动状态。

HSRP使用一个优先级机制为了确定哪个HSRP配置的路由器将是默认活动路由器。为了配置路由器作为活动路由器,您必须指定它高于其他HSRP配置的路由器优先级的优先级。默认优先级是100;因此,如果配置一个路由器有更加高优先级,该路由器将是默认活动路由器。HSRP版本2使用新的IP组播地址224.0.0.102发送Hello数据包而不是224.0.0.2组播地址,版本1使用。

先决条件

要求

尝试进行此配置之前,请确保满足以下要求:

  • 配置HSRP知识;参考配置HSRP欲知更多信息。

  • 实现IPv6寻址和基本连通性基础知识;参考实现IPv6寻址和基本连通性欲知更多信息。

  • 在HSRP IPv6可以配置前,在接口必须启用HSRP版本2。

  • 在能将配置的HSRP IPv6的设备必须启用IPv6单播路由

使用的组件

在本文的配置根据在Cisco IOS软件版本软件12.4 (15)T 13的Cisco 3700系列路由器。

注意: 验证IPv6命令的许可证信息。

规则

有关文档规则的信息,请参阅 Cisco 技术提示规则

配置

路由器R1和R2连接对R3通过serial interfaces。R1和R2快速以太网接口配置与HSRP IPv6,在这种情况下R1作为活动路由器,并且R2作为备用路由器。万一R1 serial interfaces S0/0断开, R2路由器更改其状态从待机激活

注意: 有关本文档所用命令的详细信息,请使用命令查找工具仅限注册用户)。

网络图

本文档使用以下网络设置:

http://www.cisco.com/c/dam/en/us/support/docs/ip/hot-standby-router-protocol-hsrp/113216-ipv6-hsrp-01.gif

配置

本文档使用以下配置:

这是链路到展示如何配置leavingcisco.com IPv6的HSRP在Cisco IOS路由器的视频(在Cisco支持社区的联机) :

配置IPv6的HSRPleavingcisco.com

http://www.cisco.com/c/dam/en/us/support/docs/ip/hot-standby-router-protocol-hsrp/113216-ipv6-hsrp-02.gif

路由器 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

验证

请使用show standby命令在R1和R2路由器为了验证配置。

路由器 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)断开,如此表所显示,备用路由器立即更改其状态对激活

当活动路由器(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)

故障排除

目前没有针对此配置的故障排除信息。


相关信息


Document ID: 113216