您好,欢迎来到六九路网。
搜索
您的当前位置:首页HSRP的配置

HSRP的配置

来源:六九路网


HSRP的配置

1:将路由器配置为一个HSRP的成员,可以在端口模式下输入:

Standby {group-number} ip {virtual-ip-address}

{group-number} 该端口所属的HSRP组,默认是0.

{virtual-ip-address} 指定的的虚拟ip地址,如果没有制定,路由器就会通过HSRP HELLO 消息学到虚拟 ip地址。 在选择活跃路由器时候,线路上至少有一台路由器被配置。

从HSRP组中取消一个端口:

No standby group ip

2:关掉端口重定向功能:

No ip redirects

3:配置HSRP的优先级 优先级越大,就越优先成为活跃路由器。

Standby {group-number} priority

4:配置HSRP的占先权:

当活跃路由器失效后,备份的路由器就自动承担了活跃路由器的角色,即使当较高优先级的原路由器又重新开始在网上工作时,这台备份路由器仍然继续作为转发路由器。

要想原来的较高优先级的路由器从优先级较低的新活跃路由器那里重新取回转发权

使用命令: standby {group-number} preempt

5:配置HELLO消息的计时器:

默认计时器一般是不需要修改。 同一个HSRP组中的HELLO时间和保持时间应该配置的相同。HELLO间隔时间默认为3秒,可以在1到255之间变化。保持时间最少应该是HELLO时间的3倍。默认的保持时间为10秒。

Standby group-number times hellotime holdtime

6:配置HSRP的端口跟踪:

检测路由器的另外端口状态,如果被跟踪端口变为Down,其他路由器就接替成为活跃路由器。这一过程是通过在被跟踪端口的链路状态变为down时减小路由器的优先级实现的。默认的减小值为10.

Standby group-number track type nember interface-priority

Type :说明跟踪端口的类型

Number:说明跟踪端口号。

Interface-priority:说明当端口失效时路由器的优先级降低的数值。

关闭该功能:

No tandby track

检查HSRP的状态:Show standby brief

启用调试功能:Debug standby

关闭调试功能:no debug standby

附一个配置实例:

version 12.0

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

!

hostname r1

!

enable password cisco

!

ip subnet-zero

!

interface Ethernet0

ip address 136.147.107.101 255.255.0.0

no ip redirects

no ip directed-broadcast

standby 150 timers 5 15 /* 定义150组5秒交换一次hello信息,15秒没收到

hello信息就开始切换 */

standby 150 priority 110 /* 定义150组的主路由器权值,值越大,为主路由

器希望越大 */

standby 150 preempt /* enable 150组的hsrp抢占功能 */

standby 150 authentication cisco /* 设置150组的router身份验证串 */

standby 150 ip 136.147.107.100 /* 定义150组的浮动地址,也是这台router

连接的网络的网关 */

standby 150 track Ethernet0 /* 定义监控的端口 */

!

interface Serial0

no ip address

no ip directed-broadcast

no ip mroute-cache

shutdown

no fair-queue

!

ip classless

line con 0

transport input none

line 1 16

line aux 0

line vty 0 4

password cisco

login

!

end

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- 69lv.com 版权所有 湘ICP备2023021910号-1

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务