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

在HSRPv2配置示例的跟踪选项

2015 年 8 月 28 日 - 机器翻译
其他版本: PDFpdf | 英语 (2015 年 4 月 23 日) | 反馈


目录


简介

本文描述如何配置IPv6 (HSRPv2)组的一暂挂热备份路由协议(HSRP)能跟踪对象和根据对象状态更改HSRP优先级。

其中每一被跟踪的对象有在跟踪命令行界面(CLI)指定的一唯一号码。HSRPv2使用此编号跟踪一个特定对象。跟踪进程周期地轮询值更改的被跟踪的对象并且立即发送所有更改(和在值上下)对HSRPv2,或者或,在指定的延迟后。本文使用interface命令的跟踪为了配置将被跟踪的接口。

先决条件

要求

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

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

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

  • 增强版对象跟踪基础知识

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

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

使用的组件

在本文的配置根据运行Cisco IOS�软件版本15.0(1)的Cisco7200系列路由器。

规则

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

配置

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

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

网络图

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

http://www.cisco.com/c/dam/en/us/support/docs/ip/hot-standby-router-protocol-hsrp/113553-to-hsrpv2-config-01.gif

配置

本文档使用以下配置:

路由器 R1 配置
!
version 15.0
!
hostname R1
!
ipv6 unicast-routing
ipv6 cef
!
!
interface Serial1/0
 no ip address
 ipv6 address 2010:10:10:10::1/64
 serial restart-delay 0
!
!
interface Serial1/1
 no ip address
 ipv6 address 2011:11:11:11::1/64
 serial restart-delay 0
 !
end

路由器 R2 配置
!
version 15.0
!
hostname R2
!
ipv6 unicast-routing
ipv6 cef
!
track 1 interface Serial1/0 line-protocol

!--- Tracking process 1 is configured in the router
!--- to track state of the interface line protocol
!--- of serial interface 1/0

!
interface Serial1/0
 no ip address
 ipv6 address 2010:10:10:10::2/64
 serial restart-delay 0
!
!
interface FastEthernet2/0
 no ip address
 duplex auto
 speed auto
 ipv6 address 1010:1:1:1::10/64
 standby version 2
 standby 10 ipv6 autoconfig

!--- Assigns a standby group and standby IP address.

 standby 10 preempt delay minimum 45

!--- 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 45 seconds.

 standby 10 track 1 decrement 10

!--- Configures HSRP to track an object and change the Hot Standby
!--- priority on the basis of the state of the object.



!--- In this example,the HSRP tracks the interface s1/0 mentioned
!--- in the track process 1.


!--- Decrement value specified the amount by which the Hot Standby 
!--- priority for the router is decremented (or incremented) when the tracked object 
!--- goes down (or comes back up). The range is from 1 to 255. The default is 10. 

!
end

路由器R3配置
!
version 15.0
!
hostname R3
!
ipv6 unicast-routing
ipv6 cef
!
interface Serial1/0
 no ip address
 ipv6 address 2011:11:11:11::2/64
 serial restart-delay 0
!
interface FastEthernet2/0
 no ip address
 duplex auto
 speed auto
 ipv6 address 1010:1:1:1::11/64
 standby version 2
 standby 10 ipv6 autoconfig
 standby 10 priority 95
 standby 10 preempt delay minimum 45
!
end

验证

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

路由器 R2
R2#show standby
FastEthernet2/0 - Group 10 (version 2)
  State is Active
    5 state changes, last state change 00:26:03
  Virtual IP address is FE80::5:73FF:FEA0:A
  Active virtual MAC address is 0005.73a0.000a
    Local virtual MAC address is 0005.73a0.000a (v2 IPv6 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 1.872 secs
  Preemption enabled, delay min 45 secs
  Active router is local
  Standby router is FE80::C802:AFF:FE10:38, priority 95 (expires in 8.048 sec)
  Priority 100 (default 100)
    Track object 1 state Up decrement 10
  Group name is "hsrp-Fa2/0-10" (default)

路由器 R3
R3#show standby
FastEthernet2/0 - Group 10 (version 2)
  State is Standby
    4 state changes, last state change 00:26:25
  Virtual IP address is FE80::5:73FF:FEA0:A
  Active virtual MAC address is 0005.73a0.000a
    Local virtual MAC address is 0005.73a0.000a (v2 IPv6 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.176 secs
  Preemption enabled, delay min 45 secs
  Active router is FE80::C801:14FF:FEF4:38, priority 100 (expires in 9.888 sec)
    MAC address is ca01.14f4.0038
  Standby router is local
  Priority 95 (configured 95)
  Group name is "hsrp-Fa2/0-10" (default)

为了显示跟踪信息,请使用show track命令在路由器R2。

路由器 R2
R2#show track 1
Track 1
  Interface Serial1/0 line-protocol
  Line protocol is Up
    3 changes, last change 00:28:39
  Tracked by:
    HSRP FastEthernet2/0 10

!--- Displays the information about the objects that 
!--- are tracked by tracking process 1.

R2#show track int brief
Track   Object                           Parameter        Value Last Change
1       interface   Serial1/0            line-protocol    Up    00:31:19

!--- Displays the information about the tracked interface.

万一活动路由器(在本例中的R2)断开,如此表所显示,备用路由器立即更改其状态对激活

当活动路由器(R2)去在下…
路由器 R2
R2(config)#interface s1/0
R2(config-if)#shut
R2(config-if)#
*May 21 20:56:54.223: %TRACKING-5-STATE: 1 interface Se1/0 line-protocol Up->Down
R2(config-if)#
*May 21 20:56:56.203: %LINK-5-CHANGED: Interface Serial1/0, changed state to administratively down
*May 21 20:56:57.203: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to down
R2(config-if)#
*May 21 20:57:43.087: %HSRP-5-STATECHANGE: FastEthernet2/0 Grp 10 state Active -> Speak
R2(config-if)#
*May 21 20:57:54.479: %HSRP-5-STATECHANGE: FastEthernet2/0 Grp 10 state Speak -> Standby


!--- When the interface goes down, the active router changes 
!--- its state to Standby.

路由器 R3
R3#
*May 21 20:56:53.419: %HSRP-5-STATECHANGE: FastEthernet2/0 Grp 10 state Standby-> Active


!--- The standby router is now the active router.
 

R3#show standby
FastEthernet2/0 - Group 10 (version 2)
  State is Active
    5 state changes, last state change 00:02:32
  Virtual IP address is FE80::5:73FF:FEA0:A
  Active virtual MAC address is 0005.73a0.000a
    Local virtual MAC address is 0005.73a0.000a (v2 IPv6 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.080 secs
  Preemption enabled, delay min 45 secs
  Active router is local
  Standby router is FE80::C801:14FF:FEF4:38, priority 90 (expires in 9.664 sec)
  Priority 95 (configured 95)
  Group name is "hsrp-Fa2/0-10" (default)

故障排除

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

相关的思科支持社区讨论

思科支持社区是您提问、解答问题、分享建议以及与工作伙伴协作的论坛。


相关信息


Document ID: 113553