1、實驗拓撲

Hot Standby Router Protocol
兩台路由器之間虛拟出一個網關,一台為active路由器,另一台為standby路由器,當active路由器down後,standby路由器10s内收到不hello資訊,就取代active路由器。
2、基礎配置
R1配置
interface Serial0/0
ip address 12.1.1.1 255.255.255.0
interface Serial0/1
ip address 13.1.1.1 255.255.255.0
interface Serial0/2
ip address 15.1.1.1 255.255.255.0
router ospf 110
router-id 1.1.1.1
log-adjacency-changes
network 12.1.1.0 0.0.0.255 area 0
network 13.1.1.0 0.0.0.255 area 0
network 15.1.1.0 0.0.0.255 area 0
R2配置
ip address 12.1.1.2 255.255.255.0
interface FastEthernet1/0
ip address 100.1.1.2 255.255.255.0
router-id 2.2.2.2
network 100.1.1.0 0.0.0.255 area 0
R3配置
ip address 13.1.1.3 255.255.255.0
ip address 100.1.1.3 255.255.255.0
router-id 3.3.3.3
R4配置
no ip routing
ip address 100.1.1.4 255.255.255.0
ip default-gateway 100.1.1.254
R5配置
ip address 15.1.1.5 255.255.255.0
router-id 5.5.5.5
3、配置HSRP
standby 1 ip 100.1.1.254
standby 1 priority 105
standby 1 preempt
standby 1 track Serial0/0
standby 1 track Serial0/1
3、測試HSRP
由于R2的優先級高于R3,是以此時R2位Active路由器,R3位Standby路由器。
虛拟網關IP對應的MAC位址格式為
0000.0c 07.ac 01
OUI HSRP HSRP組
此後無論是R2的f1/0或s0/0關閉之後,R3都會轉為active路由器,當f1/0或s0/0恢複後,由于配置了搶占,R2重新成為active路由器。