标签:address hello The ESS ethernet pre src ima 可用性
概述
Router>en
Router#configure terminal
Router(config)#hostname R1
R1(config)#interface e0/0
R1(config-if)#ip address 192.168.20.252 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#standby priority 200 //设置优先级
R1(config-if)#standby preempt
R1(config-if)#standby ip 192.168.20.254 //standby ip 为两台路由器共用
Router>en
Router#configure terminal
Router(config)#hostname R2
R2(config)#interface e0/0
R2(config-if)#ip address 192.168.20.253 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#standby priority 150
R2(config-if)#standby preempt
R2(config-if)#standby ip 192.168.20.254
至此,HRSP双机热备完成配置
State is Active
R1#show standby
Ethernet0/0 - Group 0
State is Active
2 state changes, last state change 04:07:11
Virtual IP address is 192.168.20.254
Active virtual MAC address is 0000.0c07.ac00
Local virtual MAC address is 0000.0c07.ac00 (v1 default)
Hello time 3 sec, hold time 10 sec //3s相互发hello,10s接受不到边切换
Next hello sent in 1.792 secs
Preemption enabled
Active router is local
Standby router is 192.168.20.253, priority 150 (expires in 9.904 sec)
Priority 200 (configured 200)
Group name is "hsrp-Et0/0-0" (default)
- 在R2上,状态是`State is Standby`
R2#show standby
Ethernet0/0 - Group 0
State is Standby
1 state change, last state change 04:05:46
Virtual IP address is 192.168.20.254
Active virtual MAC address is 0000.0c07.ac00
Local virtual MAC address is 0000.0c07.ac00 (v1 default)
Hello time 3 sec, hold time 10 sec
Next hello sent in 2.848 secs
Preemption enabled
Active router is 192.168.20.252, priority 200 (expires in 8.912 sec)
Standby router is local
Priority 150 (configured 150)
Group name is "hsrp-Et0/0-0" (default)
### 通过debug来查看两设备之间的通信信息
- 在正常的情况下,在任一台路由器上`debug standby`,每隔3秒左右,就看两台设备互发信息
R1#debug standby
HSRP debugging is on
R1#
Jan 2 02:22:43.438: HSRP: Et0/0 Grp 0 Hello in 192.168.20.253 Standby pri 150 vIP 192.168.20.254
Jan 2 02:22:44.000: HSRP: Et0/0 Grp 0 Hello out 192.168.20.252 Active pri 200 vIP 192.168.20.254
R1#
R1#no debug standby
HSRP debugging is off
- 断掉R1的e0/0连线,测试R2是否接管
在R2 `debug standby`可以看到切换的信息
![](https://sharp-images.oss-cn-shenzhen.aliyuncs.com/picgo/20191225164115.png)
在R2上`show standby`可以R2已经变为Active了
R2#
*Jan 2 02:40:25.369: HSRP: Et0/0 Grp 0 Hello out 192.168.20.253 Active pri 15 R2#show standby
Ethernet0/0 - Group 0
State is Active //R2已经变为Active了
2 state changes, last state change 00:02:07
Virtual IP address is 192.168.20.254
Active virtual MAC address is 0000.0c07.ac00
Local virtual MAC address is 0000.0c07.ac00 (v1 default)
Hello time 3 sec, hold time 10 sec
Next hello sent in 1.200 secs
Preemption enabled
Active router is local
Standby router is unknown
Priority 150 (configured 150)
Group name is "hsrp-Et0/0-0" (default)
R2#
当R1恢复正常后,会变回主设备
标签:address hello The ESS ethernet pre src ima 可用性
原文地址:https://blog.51cto.com/xingsi/2461775