實驗目的:當網絡中一個路由器down不能正常工作,可以用hsrp協議讓數據從另外的一個通道進行傳遞,從而解決了單線路故障。拓撲如下
1;pc 0 配置 ip 192.168.10.1
gateway 192.168.10.251 此時的這個網關設置成爲虛擬網關。
2 ;switch 0 上配置vlan 10 把fa0/1 fa0/2 fa0/3 同時劃分到vlan10裏面。
- interface FastEthernet0/1
- switchport access vlan 10
- switchport mode access
- !
- interface FastEthernet0/2
- switchport access vlan 10
- switchport mode access
- !
- interface FastEthernet0/3
- switchport access vlan 10
-
switchport mode access
3.在router 0 上的fa0/0端口上面配置 ip地址 192.168.10.250/24 並且在接口下面配置hsrp協議 一定要開啓搶佔模式
-
- interface FastEthernet0/0
- ip address 192.168.10.252 255.255.255.0
- duplex auto
- speed auto
- standby version 2
- standby 0 ip 192.168.10.251(這個ip是虛擬ip。一般思科的hsrp是沒有開啓搶佔模式的,一定要開啓)
- standby priority 250
-
standby preempt
4..在router 1 上的fa0/0端口上面配置 ip地址 192.168.10.252/24 並且在接口下面配置hsrp協議 一定要開啓搶佔模式
- interface FastEthernet0/0
- ip address 192.168.10.252 255.255.255.0
- duplex auto
- speed auto
- standby version 2
- standby 0 ip 192.168.10.251(這個ip是虛擬ip。一般思科的hsrp是沒有開啓搶佔模式的,一定要開啓)
- standby priority 250
- standby preempt