视频1 视频21 视频41 视频61 视频文章1 视频文章21 视频文章41 视频文章61 推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37 推荐39 推荐41 推荐43 推荐45 推荐47 推荐49 关键词1 关键词101 关键词201 关键词301 关键词401 关键词501 关键词601 关键词701 关键词801 关键词901 关键词1001 关键词1101 关键词1201 关键词1301 关键词1401 关键词1501 关键词1601 关键词1701 关键词1801 关键词1901 视频扩展1 视频扩展6 视频扩展11 视频扩展16 文章1 文章201 文章401 文章601 文章801 文章1001 资讯1 资讯501 资讯1001 资讯1501 标签1 标签501 标签1001 关键词1 关键词501 关键词1001 关键词1501 专题2001
HSRP监视端口配置
2025-10-03 15:09:16 责编:小OO
文档
Basic HSRP Configuration With Track Interface 

关键字

HSRP VRRP 热备份 冗余 端口追踪 

拓朴

实验说明

 某企业为实现用户24小时不间断上网业务,使用两台路由器进行热备(HSRP).

 企业PC只需网关设定为HSRP指定的网关(192.168.0.100)即可.

 如果R2的连接互联网的接口发生问题,则将HSRP Active切向R1. [ HRSP监视端口功能 ]

配置

R1的配置

!

hostname R1

!

interface FastEthernet0/0

ip address 192.168.0.1 255.255.255.0

duplex half

standby 1 ip 192.168.0.100 //HSRP虚拟网关 

standby 1 preempt 

!

 

R2的配置

!

hostname R2

!

interface FastEthernet0/0

ip address 192.168.0.2 255.255.255.0

duplex half

standby 1 ip 192.168.0.100

standby 1 priority 120

standby 1 preempt

standby 1 track Serial3/0 30 // 监视S3/0接口,如果接口down,优先级值减30

!

调试

 
在R2上查看 HSRP 状态

R2#show standby 

FastEthernet0/0 - Group 1

State is Active

 4 state changes, last state change 00:00:37

 Virtual IP address is 192.168.0.100

 Active virtual MAC address is 0000.0c07.ac01

Local virtual MAC address is 0000.0c07.ac01 (default)

 Hello time 3 sec, hold time 10 sec

 Next hello sent in 1.856 secs 

 Preemption enabled

Active router is local

 Standby router is 192.168.0.1, priority 100 (expires in 9.992 sec)

 Priority 120 (configured 120) 

 Track interface Serial3/0 state Up decrement 30

 IP redundancy name is "hsrp-Fa0/0-1" (default) 

现在我们在R2上关闭S3/0接口,模拟此互联网接口发生故障

R2#conf t

Enter configuration commands, one per line. End with CNTL/Z.

R2(config)#int s3/0

R2(config-if)#sh 

R2#

*Feb 22 00:49:37.743: %SYS-5-CONFIG_I: Configured from console by console

*Feb 22 00:49:38.551: %LINK-5-CHANGED: Interface Serial3/0, changed state to administratively down

*Feb 22 00:49:38.575: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 1 state Active -> Speak 

*Feb 22 00:49:39.551: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial3/0, changed state to down

R2#show standby 

FastEthernet0/0 - Group 1

State is Standby //现在变为Standby状态了 

 6 state changes, last state change 00:00:00

 Virtual IP address is 192.168.0.100

 Active virtual MAC address is 0000.0c07.ac01

Local virtual MAC address is 0000.0c07.ac01 (default)

 Hello time 3 sec, hold time 10 sec

 Next hello sent in 2.348 secs

 Preemption enabled

Active router is 192.168.0.1, priority 100 (expires in 8.576 sec)

 Standby router is local

 Priority 90 (configured 120)

 Track interface Serial3/0 state Down decrement 30

 IP redundancy name is "hsrp-Fa0/0-1" (default)

再将S3/0接口打开,我们可以观察到R2又得到了Active状态

R2#conf t

Enter configuration commands, one per line. End with CNTL/Z.

R2(config)#int s3/0

R2(config-if)#no sh

R2(config-if)#^Z

R2#

*Feb 22 00:55:47.275: %SYS-5-CONFIG_I: Configured from console by console

*Feb 22 00:55:47.763: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 1 state Standby -> Active

R2#

*Feb 22 00:55:48.671: %LINK-3-UPDOWN: Interface Serial3/0, changed state to up

*Feb 22 00:55:49.671: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial3/0, changed state to up

R2#show standby

FastEthernet0/0 - Group 1

State is Active

 7 state changes, last state change 00:00:13

 Virtual IP address is 192.168.0.100

 Active virtual MAC address is 0000.0c07.ac01

Local virtual MAC address is 0000.0c07.ac01 (default)

 Hello time 3 sec, hold time 10 sec

 Next hello sent in 1.840 secs

 Preemption enabled

Active router is local

 Standby router is 192.168.0.1, priority 100 (expires in 9.880 sec)

 Priority 120 (configured 120)

 Track interface Serial3/0 state Up decrement 30

 IP redundancy name is "hsrp-Fa0/0-1" (default)

 

参考下载本文

显示全文
专题