熱備份路由協議(HSRP)
實驗拓撲:
實驗目的:通過配置HSRP達到網絡負載均衡和冗餘的效果。
實驗步驟:1.配置R1,R2,R3,保證全網通。使用RIP協議。
2.配置交換機,將F0/2 F 0/3 F 0/4 F 0/5 配上全雙工
3.模擬PC1,PC2.
4.配置HSRP
結果測試:在DOWN掉R2的S0/0前後,從PC發送的數據包走不同的路。
具體步驟:
1. 路由的配置:以R1爲例。
R1(config)#int s0/0
R1(config-if)#ip add 1.1.1 .2 255.0.0.0
R1(config-if)#ino shutdown
R1(config-if)#iint s0/1
R1(config-if)#iip add 2.2.2 ..2 255.0.0.0
R1(config-if)#ino shutdown
R1(config-if)#iint locp0
R1(config-if)#iip add 3.3.3 .1 255.0.0.0
R1(config-if)#irouter rip
R1(config-router)#network 1.0.0 .0
R1(config-router)#network 2.0.0 .0
R1(config-router)#network 3.0.0 .0
2.SWITCH的配置情況
Sw(config)#int f0/2
Sw(config-if)duplex full (全雙工)
其他接口同上
3.PC部分,以R4(PC1)爲例。
PC1(config)#no ip routing (去路由功能)
PC1(config)#ip defult-gateway 192.168.1.1 (指網關, PC2指向1.254)
PC1(config)#int e0/0
PC1(config-if)#ip add 192.168.1.4 255.255.255.0
PC1(config-if)#no shutsown
PC1(config-if)#duplex full (全雙工)
Pc配置完畢。
4.配置HSRP
R2 E1/0接口上
Standby 1 ip 192.168.1.1 (配置虛擬網關)
Standby 1 priority 110 (配置優先級)
Standby 1 preempt (配置路由搶奪)
Standby 1track s0/0 20 (配置接口跟蹤,CISCO私有。數字表示爲接口DOWN掉後,優先級降低。)
Standby 2 preempt
Standby 2 ip 192.168.1.254
以上兩行。配置後,拓撲有冗餘作用
R3 E0/0接口上
Standby 2 ip 192.168.1.254
Standby 2 priority 110
Standby 2 preempt
Standby 2 track s0/1 20
Standby 1 preempt
Standby 1 ip 192.168.1.1
結果測試
在PC1上 tracrroute 3.3.3 .1
1 192.168.1.2
將R2的S0/0 shotdown後在PC1上traceroute 3.3.3 .1
1 192.168.1.3
2 2.2.2 .2