實驗八 HSRP協(xié)議原理及配置_第1頁
實驗八 HSRP協(xié)議原理及配置_第2頁
實驗八 HSRP協(xié)議原理及配置_第3頁
實驗八 HSRP協(xié)議原理及配置_第4頁
實驗八 HSRP協(xié)議原理及配置_第5頁
已閱讀5頁,還剩10頁未讀 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、實驗八 HSRP協(xié)議原理及配置8.1 實驗?zāi)康模?. 熟悉HSRP協(xié)議原理;2. 掌握HSRP的配置;3. 熟悉HSRP的應(yīng)用。8.2 實驗環(huán)境:本實驗至少需要三臺路由器、一臺交換機、兩臺主機。實驗中用交換機模擬局域網(wǎng),其中局域網(wǎng)A有兩臺路由器與局域網(wǎng)B相連,所以為了安全可靠,我們在兩臺路由器之間進行備份。這就是我們本實驗要討論的熱備份路由協(xié)議。具體的實驗組網(wǎng)如下:8.3 實驗步驟:8.3.1 實驗準備本實驗需要使用HSRP協(xié)議完成路由器之間的熱備份,在HSRP中需要使用到虛擬IP地址,用該IP地址用作主機的缺省網(wǎng)關(guān),就可以在一臺路由器故障時,不修改主機配置而仍然與主機PCC通信。所以我們首先

2、要規(guī)劃IP地址。本實驗的IP地址規(guī)劃如下:路由器的接口IP地址分配如下:RTARTBRTCE010.110.32.11/2110.110.32.10/2110.110.10.100/24S01.0.0.1/241.0.0.2S12.0.0.1/242.0.0.2各主機的IP地址分配如下:PCAPCBPCCIP10.110.32.2010.110.10.3010.110.10.1Gateway10.110.32.110.110.10.110.110.10.1008.3.2 單備份組配置本實驗需要路由器RTA與RTB實現(xiàn)熱備份,并且正常時以RTA為活動路由器,并且在RTA由故障狀態(tài)恢復(fù)正常時能繼續(xù)

3、擔當活動路由器。根據(jù)實驗要求和HSRP協(xié)議原理可以設(shè)定RTA的優(yōu)先級較高(默認值為100),同時置搶占標志,即可滿足要求。具體實驗配置步驟很簡單,不再贅述,下面列出各路由器的配置信息供您參考:RTA(config-if-Ethernet0)#show running-config Now create configuration. Current configuration ! version 1.5.6 hostname RTA ! interface Aux0 async mode interactive encapsulation ppp ! interface Ethernet0 sp

4、eed auto duplex auto no loopback ip address 10.110.32.11 255.255.248.0 standby 1 ip 10.110.32.1 /創(chuàng)建備份組并設(shè)定虛擬IP地址 standby 1 preempt /設(shè)定搶占標志 standby 1 priority 120 /設(shè)定優(yōu)先級 ip rip version 2 mcast /設(shè)定RIP協(xié)議版本 ! interface Serial0 encapsulation ppp ip address 1.0.0.1 255.255.255.0 ip rip version 2 mcast ! in

5、terface Serial1 encapsulation ppp ! exit router rip no auto-summary /取消自動聚合功能 network all ! endRTB(config-if-Serial1)#show running-config Now create configuration. Current configuration ! version 1.5.6 hostname RTB ! interface Aux0 async mode interactive encapsulation ppp ! interface Ethernet0 speed

6、 auto duplex auto no loopback ip address 10.110.32.10 255.255.248.0 standby 1 ip 10.110.32.1 standby 1 preempt ip rip version 2 mcast ! interface Serial0 encapsulation ppp ! interface Serial1 encapsulation ppp ip address 2.0.0.1 255.255.255.0 ip rip version 2 mcast ! exit router rip no auto-summary

7、network all ! endRTC(config-if-Serial1)#show running-config Now create configuration. Current configuration ! version 1.5.6 logging console hostname RTC ! interface Aux0 async mode interactive encapsulation ppp ! interface Ethernet0 speed auto duplex auto no loopback ip address 10.110.10.100 255.255

8、.255.0 ip rip version 2 mcast ! interface Serial0 clock-select DTECLK1 encapsulation ppp ip address 1.0.0.2 255.255.255.0 ip rip version 2 mcast ! interface Serial1 clock-select DTECLK1 encapsulation ppp ip address 2.0.0.2 255.255.255.0 ip rip version 2 mcast ! exit router rip no auto-summary networ

9、k all ! end注意:在配置動態(tài)路由協(xié)議時,由于使用的是RIP協(xié)議,該協(xié)議默認版本version 1不支持可變長子網(wǎng)掩碼,而實驗中設(shè)定的IP地址又是A類地址。所以需要在接口上修改RIP協(xié)議版本為version 2,而且要取消路由協(xié)議的自動聚合功能。如果沒有這些設(shè)置,將看不到到對端局域網(wǎng)的路由信息。完成上述配置之后,測試網(wǎng)絡(luò)是否滿足設(shè)計需求。先用show standby查看路由器的狀態(tài)如下:RTA(config-if-Ethernet0)#show standby Ethernet0 |Group Number : 1 State : Active Hot Standby IP : 10.

10、110.32.1 Priority : 120 Preempt : may Hold Time : 10 Hello Time: 3 Use Virtual Mac Address : 00-e0-fc-00-5f-01RTB(config-if-Serial1)#show standby Ethernet0 |Group Number : 1 State : Standby Hot Standby IP : 10.110.32.1 Priority : 100 Preempt : may Hold Time : 10 Hello Time: 3 Use Virtual Mac Address

11、 : 00-e0-fc-00-5f-01在主機PCA上使用ping命令測試是否能與主機PCC通信,應(yīng)該能正常通信。然后關(guān)閉路由器RTA的E0口(shutdown),此時路由器的狀態(tài)又是什么呢?路由器RTB是不是已經(jīng)成為活動路由器了?應(yīng)該是。再次在主機PCA上測試應(yīng)該能與主機PCC通信。最后再把RTA的E0口恢復(fù)正常(no shutdown),它的狀態(tài)又有什么變換?我們的設(shè)計滿足需求嗎?如果時間充裕,您試試看僅僅關(guān)閉S0口,是什么現(xiàn)象?S0和E0同時關(guān)閉呢?HSRP協(xié)議的正常工作是依靠路由器之間周期性的發(fā)送報文來實現(xiàn)的,那么這個周期究竟是多少呢?實際上在上面的狀態(tài)信息中已經(jīng)有顯示。即Hello

12、Time:3,修改該參數(shù)的命令是:standby group-number timer hello-time hold-time。其中hold-time是用于確認路由器是否故障的,如果超過該時間仍沒有收到活動路由器或備份路由器的Hello報文,則認為該路由器故障。在一般情況下,路由器使用路由器自動映射生成的MAC地址為虛擬MAC地址,我們也可以人為的修改使其使用實際的MAC地址或指定的MAC地址為虛擬MAC地址。下面是修改后的顯示信息,供參考:RTA(config-if-Ethernet0)#standby use-biaRTA(config-if-Ethernet0)#show standb

13、y Ethernet0 |Group Number : 1 State : Listen Hot Standby IP : 10.110.32.1 Priority : 120 Preempt : may Hold Time : 60 Hello Time: 20Use Burned in Mac AddressRTA(config-if-Ethernet0)#standby use-ovmac 11-11-11-11-11-01RTA(config-if-Ethernet0)#show standby Ethernet0 |Group Number : 1 State : Standby H

14、ot Standby IP : 10.110.32.1 Priority : 120 Preempt : may Hold Time : 60 Hello Time: 20 Use Virtual Mac Address : 11-11-11-11-11-01修改后,您迅速查看RTB的狀態(tài)會看到該路由器從INIT-LISTEN-SPEAK-STANDBY的過程,這是因為修改參數(shù)后,路由器有一個學(xué)習過程。在實際應(yīng)用中還可能會修改路由器之間的確認口令(默認為quidway),該配置簡單,只需要同一備份組各路由器的口令一致即可(standby group-number authentication

15、passwaord)。8.3.3 多備份組配置上面的實驗中,如果只是關(guān)閉RTA的S0口,會發(fā)現(xiàn)RTA仍是活動路由器(ACTIVE)。如果我們采用下面的監(jiān)視指定端口技術(shù),就不會有此現(xiàn)象了。仍然使用上面的組網(wǎng),只需要在RTA上多配置一條命令(standby 1 track serial0 40)即可,其中40是指當serial0故障時,就降低自己的優(yōu)先級40,此時優(yōu)先級為80,低于RTB的優(yōu)先級100,所以RTB成為活動路由器。實驗現(xiàn)象是這樣的嗎?Quidway系列路由器允許一臺路由器為多個備份組作備份,所以我們可以通過設(shè)置多備份組實現(xiàn)負荷分擔。如上面的實驗,我們將RTA設(shè)為group 1的活動路

16、由器group 2的備份路由器,RTB作相反設(shè)置,即可實現(xiàn)負荷分擔。配置完成后的配置信息如下:RTA(config-if-Ethernet0)#show running-config Now create configuration. Current configuration ! version 1.5.6 hostname RTA ! interface Aux0 async mode interactive encapsulation ppp ! interface Ethernet0 speed auto duplex auto no loopback ip address 10.11

17、0.32.11 255.255.248.0 standby 2 ip 10.110.32.2 standby 2 preempt standby 1 ip 10.110.32.1 standby 1 preempt standby 1 priority 120 ip rip version 2 mcast ! interface Serial0 encapsulation ppp ip address 1.0.0.1 255.255.255.0 ip rip version 2 mcast ! interface Serial1 encapsulation ppp ! exit router

18、rip no auto-summary network all ! endRTB(config-if-Ethernet0)#show running-config Now create configuration. Current configuration ! version 1.5.6 hostname RTB ! interface Aux0 async mode interactive encapsulation ppp ! interface Ethernet0 speed auto duplex auto no loopback ip address 10.110.32.10 25

19、5.255.248.0 standby 2 ip 10.110.32.2 standby 2 preempt standby 2 priority 120 standby 1 ip 10.110.32.1 standby 1 preempt ip rip version 2 mcast ! interface Serial0 encapsulation ppp ! interface Serial1 encapsulation ppp ip address 2.0.0.1 255.255.255.0 ip rip version 2 mcast ! exit router rip no aut

20、o-summary network all ! end路由器RTC的配置不變。當然負荷分擔還需要依靠主機的缺省網(wǎng)關(guān)來決定。比如本實驗,將主機PCB的缺省網(wǎng)關(guān)改為10.110.32.2,就可以實現(xiàn)負荷分擔了。此時各路由器的狀態(tài)信息如下:RTA(config-if-Ethernet0)#show standby Ethernet0 |Group Number : 2 State : Standby Hot Standby IP : 10.110.32.2 Priority : 100 Preempt : may Hold Time : 10 Hello Time: 3 Use Virtual Ma

21、c Address : 00-e0-fc-00-5f-02 Ethernet0 |Group Number : 1 State : Active Hot Standby IP : 10.110.32.1 Priority : 120 Preempt : may Hold Time : 10 Hello Time: 3 Use Virtual Mac Address : 00-e0-fc-00-5f-01RTB(config-if-Ethernet0)#show standby Ethernet0 |Group Number : 2 State : Active Hot Standby IP :

22、 10.110.32.2 Priority : 120 Preempt : may Hold Time : 10 Hello Time: 3 Use Virtual Mac Address : 00-e0-fc-00-5f-02 Ethernet0 |Group Number : 1 State : Standby Hot Standby IP : 10.110.32.1 Priority : 100 Preempt : may Hold Time : 10 Hello Time: 3 Use Virtual Mac Address : 00-e0-fc-00-5f-01從此可以明確兩臺路由器都在其中一個備份組充當活動路由器,在另一備份組中充當備份路由器。如果某一路由器故障,則另一路由器充當兩個備份組的活動路由器,如:RTB(config-if-Ethernet0)#shutdownRTB(config-if-Ethernet0)#show standby Ethernet0 |Group Number : 2 State : Init Hot Standby IP : 10.110.32.2 Priority

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論