关键字
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) |
参考下载本文