HSRP为cisco私有协议:
R1配置:
R1(config)#interface ethernet 0/1
R1(config-if)#standby 10 ip 192.168.10.1
R1(config-if)#standby 10 preempt
R1(config-if)#standby 10 ?
authentication Authentication
ip Enable HSRP and set the virtual IP address
mac-address Virtual MAC address
name Redundancy name string
preempt Overthrow lower priority Active routers
priority Priority level
timers Hello and hold timers
track Priority tracking
R1(config-if)#end
*Mar 1 00:31:43.127: %HSRP-5-STATECHANGE: Ethernet0/1 Grp 10 state Speak -> Standby
*Mar 1 00:31:43.627: %HSRP-5-STATECHANGE: Ethernet0/1 Grp 10 state Standby -> Active
----默认情况下,谁先配的谁就是Active
R1#show standby
Ethernet0/1 - Group 10
State is Standby
4 state changes, last state change 00:00:23
Virtual IP address is 192.168.10.1 ----这个地址是虚拟的,不是真实地址
Active virtual MAC address is 0000.0c07.ac0a ----此处的MAC地址虚拟的,0a表示组号10
Local virtual MAC address is 0000.0c07.ac0a (v1 default)
Hello time 3 sec, hold time 10 sec ----默认时间
Next hello sent in 0.512 secs
Preemption disabled
Active router is 192.168.10.3, priority 200 (expires in 9.476 sec)
Standby router is local
Priority 100 (default 100)
IP redundancy name is "hsrp-Et0/1-10" (default)
R1#
R2配置:
R2(config)#interface ethernet 0/2
R2(config-if)#standby 10 ip 192.168.10.1
R2(config-if)#standby 10 priority ?
<0-255> Priority value
R2(config-if)#standby 10 priority 200 ----默认为100,优先级高的为Active
R2(config-if)#standby 10 preempt ----配置抢占功能,抢占Active
R2(config-if)#standby 10 timers 2 8 ----调整时间,hello的2s,hold的8s
R2(config-if)#standby 10 track loopback 0 110
----跟踪端口功能,如果loopback断了,优先级会自动减去110,以方便其它的路由器抢占
R2(config-if)#exit
转载于:https://blog.51cto.com/jiangfusen/440940