预配置R1(config)#int lo0R1(config-if)#ip add 1.1.1.1 255.255.255.0R1(config-if)#int f0/0R1(config-if)#i
.
预配置
R1(config)#int lo0
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#int f0/0
R1(config-if)#ip add 192.168.0.1 255.255.255.0
R1(config-if)#no sh
R2(config)#
R2(config)#int lo0
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R2(config-if)#int f0/0
R2(config-if)#ip add 192.168.0.2 255.255.255.0
R2(config-if)#no sh
R3(config)#int f0/0
R3(config-if)#ip add 192.168.0.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#exi
R3(config)#no ip routing
R3(config)#ip default-gateway 192.168.0.100
实验过程
第一步:配置R1的HSRP
R1(config)#int f0/0
R1(config-if)#standby 1 ip 192.168.0.100
R1(config-if)#standby 1 priority 150
R1(config-if)#standby 1 track lo0 60
R1(config-if)#standby 1 preempt
第二步:配置R2的HSRP
R2(config)#int f0/0
R2(config-if)#standby 1 ip 192.168.0.100
R2(config-if)#standby 1 track lo0
R2(config-if)#standby 1 preempt
R2(config-if)#exit
第三步:在R3上ping
R3#ping 192.168.0.100
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.100, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/220/1052 ms
第四步:我们在R1上down到lo0,后在show R2的standby
R2(config)#do sh standby
FastEthernet0/0 - Group 1
State is Active
2 state changes, last state change 00:00:50
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 0.808 secs
Preemption enabled
Active router is local
Standby router is 192.168.0.1, priority 90 (expires in 8.804 sec)
Priority 100 (default 100)
Track interface Loopback0 state Up decrement 10
IP redundancy name is "hsrp-Fa0/0-1" (default)
//R2为active路由器
第五步:我们在打开int lo0,并查看
R2(config)#do sh standby
FastEthernet0/0 - Group 1
State is Standby
4 state changes, last state change 00:00:18
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.972 secs
Preemption enabled
Active router is 192.168.0.1, priority 150 (expires in 8.976 sec)
Standby router is local
Priority 100 (default 100)
Track interface Loopback0 state Up decrement 10
IP redundancy name is "hsrp-Fa0/0-1" (default)
//R2原 为 备份路由器。