OSPF綜合實(shí)驗(yàn)大全_第1頁(yè)
OSPF綜合實(shí)驗(yàn)大全_第2頁(yè)
OSPF綜合實(shí)驗(yàn)大全_第3頁(yè)
OSPF綜合實(shí)驗(yàn)大全_第4頁(yè)
OSPF綜合實(shí)驗(yàn)大全_第5頁(yè)
已閱讀5頁(yè),還剩29頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

...wd......wd......wd...OSPF綜合實(shí)驗(yàn)大全OSPF實(shí)驗(yàn)1:基本的OSPF配置實(shí)驗(yàn)級(jí)別:Assistant實(shí)驗(yàn)拓?fù)洌簩?shí)驗(yàn)步驟:1.首先在3臺(tái)路由器上配置物理接口,并且使用ping命令確保物理鏈路的暢通。2.在路由器上配置loopback接口:R1(config)#intloopback0R1(config-if)#ipadd1.1.1.1255.255.255.0R2(config)#intloopback0R2(config-if)#ipadd2.2.2.2255.255.255.0R3(config)#intloopback0R3(config-if)#ipadd3.3.3.3255.255.255.0路由器的RID是路由器接口的最高的IP地址,當(dāng)有環(huán)回口存在是,路由器將使用環(huán)回口的最高IP地址作為起RID,從而保證RID的穩(wěn)定。3.在3臺(tái)路由器上分別啟動(dòng)ospf進(jìn)程,并且宣告直連接口的網(wǎng)絡(luò)。R1(config)#routerospf10R1(config-router)#network192.168.1.00.0.0.255area0R1(config-router)#network1.1.1.00.0.0.255area0R1(config-router)#network192.168.3.0.0.0.255area0ospf的進(jìn)程號(hào)只有本地意義,既在不同路由器上的進(jìn)程號(hào)可以不一樣。但是為了日后維護(hù)的方便,一般啟用一樣的進(jìn)程號(hào)。ospf使用反向掩碼。Area0表示骨干區(qū)域,在設(shè)計(jì)ospf網(wǎng)絡(luò)時(shí),所有的非骨干區(qū)域都需要和骨干區(qū)域直連!R2,R3的配置和R1類(lèi)似,這里省略。不同的是我們?cè)赗2和R3上不宣告各自的環(huán)回口。*Aug1317:58:51.411:%OSPF-5-ADJCHG:Process10,Nbr2.2.2.2onSerial1/0fromLOADINGtoFULL,LoadingDone配置完畢后,我們可以看到鄰居關(guān)系已經(jīng)到達(dá)FULL狀態(tài)。

4.在R1上查看路由表,可以看到以下信息:R1#showiprouteCodes:C-connected,S-static,R-RIP,M-mobile,B-BGPD-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaN1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2E1-OSPFexternaltype1,E2-OSPFexternaltype2i-IS-IS,su-IS-ISsummary,L1-IS-ISlevel-1,L2-IS-ISlevel-2ia-IS-ISinterarea,*-candidatedefault,U-per-userstaticrouteo-ODR,P-periodicdownloadedstaticrouteGatewayoflastresortisnotset1.0.0.0/24issubnetted,1subnetsC1.1.1.0isdirectlyconnected,Loopback0C192.168.1.0/24isdirectlyconnected,Serial1/0O192.168.2.0/24[110/65]via192.168.1.2,00:03:42,Serial1/0C192.168.3.0/24isdirectlyconnected,FastEthernet0/我們看到R1學(xué)到了192.168.2.0/24這個(gè)網(wǎng)段的路由。后面的數(shù)字[110/65],分別表示OSPF的管理距離〔AD〕和路由的Metric值OSPF的Metric值是由cost值逐跳累加的。Cost=100Mb/帶寬值。5.在R1上showipospfneighbor、showipospfinterfaceR1#showipospfneighborNeighborIDPriStateDeadTimeAddressInterface3.3.3.31FULL/BDR00:00:34192.168.3.3FastEthernet0/02.2.2.20FULL/-00:00:32192.168.1.2Serial1/0我們看到R1和R3選取了DR和BDR,而R1和R2沒(méi)有選取。在ospf的五種網(wǎng)絡(luò)類(lèi)型中。Point-to-Point,Point-to-Multipoint(播送與非播送)這三種網(wǎng)絡(luò)類(lèi)型不選取DR與BDR;Broadcast,NBMA選取DR與BDR。R1#showipospfinterfaceFastEthernet0/0isup,lineprotocolisupInternetAddress192.168.3.1/24,Area0ProcessID10,RouterID1.1.1.1,NetworkTypeBROADCAST,Cost:1TransmitDelayis1sec,StateDR,Priority1DesignatedRouter(ID)1.1.1.1,Interfaceaddress192.168.3.1BackupDesignatedrouter(ID)3.3.3.3,Interfaceaddress192.168.3.3Timerintervalsconfigured,Hello10,Dead40,Wait40,Retransmit5oob-resynctimeout40Helloduein00:00:03Index3/3,floodqueuelength0Next0x0(0)/0x0(0)Lastfloodscanlengthis1,maximumis1Lastfloodscantimeis0msec,maximumis0msecNeighborCountis1,Adjacentneighborcountis1Adjacentwithneighbor3.3.3.3(BackupDesignatedRouter)Suppresshellofor0neighbor(s)Serial1/0isup,lineprotocolisupInternetAddress192.168.1.1/24,Area0ProcessID10,RouterID1.1.1.1,NetworkTypePOINT_TO_POINT,Cost:64TransmitDelayis1sec,StatePOINT_TO_POINT,Timerintervalsconfigured,Hello10,Dead40,Wait40,Retransmit5oob-resynctimeout40Helloduein00:00:02Index1/1,floodqueuelength0Next0x0(0)/0x0(0)Lastfloodscanlengthis1,maximumis1Lastfloodscantimeis4msec,maximumis4msecNeighborCountis1,Adjacentneighborcountis1Adjacentwithneighbor2.2.2.2Suppresshellofor0neighbor(s)Loopback0isup,lineprotocolisupInternetAddress1.1.1.1/24,Area0ProcessID10,RouterID1.1.1.1,NetworkTypeLOOPBACK,Cost:1LoopbackinterfaceistreatedasastubHost在這里我們看到環(huán)回口的網(wǎng)絡(luò)網(wǎng)絡(luò)類(lèi)型是Loopback,這是一種特殊的網(wǎng)絡(luò)類(lèi)型,只針對(duì)環(huán)回口存在。我們到R2上看看路由表:R2#showiprouteCodes:C-connected,S-static,R-RIP,M-mobile,B-BGPD-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaN1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2E1-OSPFexternaltype1,E2-OSPFexternaltype2i-IS-IS,su-IS-ISsummary,L1-IS-ISlevel-1,L2-IS-ISlevel-2ia-IS-ISinterarea,*-candidatedefault,U-per-userstaticrouteo-ODR,P-periodicdownloadedstaticrouteGatewayoflastresortisnotset1.0.0.0/32issubnetted,1subnetsO1.1.1.1[110/65]via192.168.1.1,00:12:34,Serial1/02.0.0.0/24issubnetted,1subnetsC2.2.2.0isdirectlyconnected,Loopback0C192.168.1.0/24isdirectlyconnected,Serial1/0C192.168.2.0/24isdirectlyconnected,Serial1/1O192.168.3.0/24[110/65]via192.168.1.1,00:12:34,Serial1/0[110/65]via192.168.2.3,00:12:34,Serial1/1R2的路由表顯示來(lái)自環(huán)回口的路由,掩碼為/32,既我們所說(shuō)的“主機(jī)路由〞。在實(shí)際應(yīng)用中,環(huán)回口以32位的居多,用作ospf的管理接口。但是如果你想讓環(huán)回口模擬一個(gè)網(wǎng)段,我們可以通過(guò)以下配置來(lái)消除。R1(config)#intloopback0R1(config-if)#ipospfnetworkpoint-to-point環(huán)回口只能配置成point-to-point這種類(lèi)型,不可以配置成其它的類(lèi)型。回到R2查看路由表:R2#showiprouteCodes:C-connected,S-static,R-RIP,M-mobile,B-BGPD-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaN1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2E1-OSPFexternaltype1,E2-OSPFexternaltype2i-IS-IS,su-IS-ISsummary,L1-IS-ISlevel-1,L2-IS-ISlevel-2ia-IS-ISinterarea,*-candidatedefault,U-per-userstaticrouteo-ODR,P-periodicdownloadedstaticrouteGatewayoflastresortisnotset1.0.0.0/24issubnetted,1subnetsO1.1.1.0[110/65]via192.168.1.1,00:00:24,Serial1/02.0.0.0/24issubnetted,1subnetsC2.2.2.0isdirectlyconnected,Loopback0C192.168.1.0/24isdirectlyconnected,Serial1/0C192.168.2.0/24isdirectlyconnected,Serial1/1O192.168.3.0/24[110/65]via192.168.1.1,00:00:24,Serial1/0[110/65]via192.168.2.3,00:00:24,Serial1/1我們看到主機(jī)路由沒(méi)有了,取而代之的是一個(gè)/24的網(wǎng)段。本文出自“蓋如鶴的步徒〞博客,請(qǐng)務(wù)必保存此出處://gairuhe.blog.51cto/77728/38127OSPF實(shí)驗(yàn)2:DR/BDR的選取實(shí)驗(yàn)級(jí)別:Professional情況一:我們都知道OSPF選取DR的過(guò)程是首先比較優(yōu)先級(jí),在優(yōu)先級(jí)一樣的情況下選擇RID較高的為DR,但是我屢次實(shí)驗(yàn)后發(fā)現(xiàn)在很多時(shí)候DR并非RID最高的路由器,這是什么原因呢在翻閱了卷一有關(guān)OSPFDR選取的介紹時(shí),發(fā)現(xiàn)了這么一句話:“在一個(gè)多址網(wǎng)絡(luò)上,最先初始化啟動(dòng)的兩臺(tái)具有DR選取資格的路由器將成為DR和BDR路由器。〞這是我總結(jié)了非最高RID而成為DR的實(shí)驗(yàn),發(fā)現(xiàn)這些路由器都是我在進(jìn)展OSPF配置的時(shí)候首先啟動(dòng)ospf的路由器,那會(huì)不會(huì)是因?yàn)檫@些路由器首先啟動(dòng)了OSPF,然后把自己設(shè)置為DR導(dǎo)致其他路由器啟動(dòng)OSPF后就不再進(jìn)展DR的選取了呢于是我做了下面的這個(gè)實(shí)驗(yàn)。實(shí)驗(yàn)的topo很簡(jiǎn)單,我就不畫(huà)了,就是兩臺(tái)路由器通過(guò)fa0/0口相連接。

R1:

conft

hoR1

intlo0

ipadd1.1.1.1255.255.255.0

intfa0/0

ipadd172.1.1.1255.255.255.0

nosh

routerospf10

net172.1.1.10.0.0.0a0R2:

conft

hoR2

intlo0

ipadd2.2.2.2255.255.255.0

intfa0/0

ipadd172.1.1.2255.255.255.0

noshR1啟動(dòng)ospf進(jìn)程后,我們?cè)赗2上暫時(shí)先不開(kāi)啟ospf,在R1上發(fā)現(xiàn)了以下信息:R1#shoipospfint

FastEthernet0/0isup,lineprotocolisupInternetAddress172.1.1.1/24,Area0ProcessID10,RouterID1.1.1.1,NetworkTypeBROADCAST,Cost:1

TransmitDelayis1sec,StateDR,Priority1DesignatedRouter(ID)1.1.1.1,Interfaceaddress172.1.1.1

Nobackupdesignatedrouteronthisnetwork

Timerintervalsconfigured,Hello10,Dead40,Wait40,Retransmit5

oob-resynctimeout40

Helloduein00:00:01

Index1/1,floodqueuelength0

Next0x0(0)/0x0(0)

Lastfloodscanlengthis0,maximumis0

Lastfloodscantimeis0msec,maximumis0msec

NeighborCountis0,Adjacentneighborcountis0Suppresshellofor0neighbor(s)我們看到R1已經(jīng)把自己設(shè)定為DR了,按照OSPF的規(guī)則,新參加的路由器即使RID比DR高,也不會(huì)替換DR。這就說(shuō)明了為什么在有些時(shí)候DR并非RID最高的路由器。當(dāng)然這個(gè)實(shí)驗(yàn)也順便驗(yàn)證了ospf中DR選取完畢后,除非DR路由器出現(xiàn)故障,否則就是有更高優(yōu)先級(jí)或者RID的路由器進(jìn)入OSPF進(jìn)程,也是無(wú)法改變DR的。既DR是不可以搶奪的!情況二〔本實(shí)驗(yàn)參照了ITAA實(shí)驗(yàn)室Netfish的實(shí)驗(yàn)〕:ospf中有一個(gè)WaitTimer計(jì)時(shí)器,在這個(gè)計(jì)時(shí)器所限定的時(shí)間內(nèi)起來(lái)的OSPF可以視為同時(shí)起機(jī)。TCP/IP卷1第292頁(yè)對(duì)于這個(gè)時(shí)間間隔是這樣定義的:WaitTimer:在開(kāi)場(chǎng)選舉DR和BDR之間,路由器等待鄰居路由器的Hello數(shù)據(jù)包通告DR和BDR的時(shí)長(zhǎng)。長(zhǎng)度就是RouterDeadInterval的時(shí)間。本實(shí)驗(yàn)拓?fù)渑c情況一一樣,不同的地方在于當(dāng)我們?cè)赗1上啟動(dòng)OSPF后,迅速〔一定要迅速,非常迅速!40s之內(nèi)〕在R2上也啟動(dòng)ospf,通過(guò)debug信息可以看到以下情況:R1#debugipospfadj

OSPFadjacencyeventsdebuggingison

R1#debugipospfev

OSPFeventsdebuggingison*Aug1400:56:19.047:OSPF:InterfaceFastEthernet0/0goingUp

*Aug1400:56:19.051:OSPF:Sendhelloto224.0.0.5area0onFastEthernet0/0from172.1.1.1

*Aug1400:56:19.551:OSPF:BuildrouterLSAforarea0,routerID1.1.1.1,seq0x80000001

*Aug1400:56:19.555:OSPF:Rcvhellofrom2.2.2.2area0fromFastEthernet0/0172.1.1.2

*Aug1400:56:19.555:OSPF:Endofhelloprocessing

R1(config-router)#

*Aug1400:56:29.051:OSPF:Sendhelloto224.0.0.5area0onFastEthernet0/0from172.1.1.1

*Aug1400:56:29.451:OSPF:Rcvhellofrom2.2.2.2area0fromFastEthernet0/0172.1.1.2

*Aug1400:56:29.455:OSPF:2WayCommunicationto2.2.2.2onFastEthernet0/0,state2WAY

*Aug1400:56:29.455:OSPF:Endofhelloprocessing

R1(config-router)#

*Aug1400:56:39.051:OSPF:Sendhelloto224.0.0.5area0onFastEthernet0/0from172.1.1.1

*Aug1400:56:39.427:OSPF:Rcvhellofrom2.2.2.2area0fromFastEthernet0/0172.1.1.2

*Aug1400:56:39.427:OSPF:Endofhelloprocessing

R1(config-router)#

*Aug1400:56:49.051:OSPF:Sendhelloto224.0.0.5area0onFastEthernet0/0from172.1.1.1

*Aug1400:56:49.447:OSPF:Rcvhellofrom2.2.2.2area0fromFastEthernet0/0172.1.1.2

*Aug1400:56:49.447:OSPF:Endofhelloprocessing

R1(config-router)#

*Aug1400:56:59.051:OSPF:endofWaitoninterfaceFastEthernet0/0*Aug1400:56:59.051:OSPF:DR/BDRelectiononFastEthernet0/0

*Aug1400:56:59.051:OSPF:ElectBDR2.2.2.2

*Aug1400:56:59.055:OSPF:ElectDR2.2.2.2

*Aug1400:56:59.055:DR:2.2.2.2(Id)BDR:2.2.2.2(Id)

*Aug1400:56:59.055:OSPF:SendDBDto2.2.2.2onFastEthernet0/0seq0x826opt0x52flag0x7len32

*Aug1400:56:59.059:OSPF:Sendhelloto224.0.0.5area0onFastEthernet0/0from172.1.1.1

*Aug1400:56:59.459:OSPF:Rcvhellofrom2.2.2.2area0fromFastEthernet0/0172.1.1.2

*Aug1400:56:59.463:OSPF:NeighborchangeEventoninterfaceFastEthernet0/0

*Aug1400:56:59.463:OSPF:DR/BDRelectiononFastEthernet0/0

*Aug1400:56:59.463:OSPF:ElectBDR1.1.1.1

*Aug1400:56:59.467:OSPF:ElectDR2.2.2.2

*Aug1400:56:59.467:OSPF:ElectBDR1.1.1.1

*Aug1400:56:59.467:OSPF:ElectDR2.2.2.2

*Aug1400:56:59.471:DR:2.2.2.2(Id)BDR:1.1.1.1(Id)這個(gè)時(shí)候我們發(fā)現(xiàn)兩個(gè)路由器進(jìn)展了DR/BDR的選取,并且結(jié)論和書(shū)上介紹的完全一致。從Debug信息的時(shí)間上來(lái)看,從啟動(dòng)OSPF進(jìn)程到開(kāi)場(chǎng)選舉DR和DBR的時(shí)間間隔是40秒,在這個(gè)時(shí)間段內(nèi),無(wú)論R1還是R2并沒(méi)有選舉DR和DBR。在RFC2328中對(duì)這個(gè)時(shí)間間隔的定義如下:

WaitTimer

Asingleshottimerthatcausestheinterfacetoexitthe

Waitingstate,andasaconsequenceselectaDesignatedRouter

onthenetwork.ThelengthofthetimerisRouterDeadInterval

seconds.因?yàn)樵诓ニ玩溌分械腞outerDeadInterval是40秒,所以我們看到的這個(gè)時(shí)間間隔為40秒。結(jié)論:并不是先啟動(dòng)OSPF進(jìn)程的路由器就是DR,而是有一個(gè)時(shí)間間隔讓路由器來(lái)等待其他路由器,在這個(gè)時(shí)間間隔內(nèi),路由器相互監(jiān)聽(tīng)Hello包中的DR和DBR字段中的信息,并且服從優(yōu)先級(jí)原則,可以這樣認(rèn)為——選舉是公平的。實(shí)際情況:在實(shí)際的網(wǎng)絡(luò)中,即使是40秒內(nèi)同時(shí)起進(jìn)程的情況也少見(jiàn);實(shí)際情況下是率先啟用ospf進(jìn)程的路由器就很有可能成為DR,第二個(gè)啟動(dòng)的就很有可能成為BDR,考慮到路由器故障或者重啟等情況,實(shí)際的運(yùn)行效果是:“活〞得最久的路由器成為DR〔比多長(zhǎng)時(shí)間不重起〕.OSPF實(shí)驗(yàn)3:OSPFoverNBMA下的五種網(wǎng)絡(luò)類(lèi)型實(shí)驗(yàn)等級(jí):Professional實(shí)驗(yàn)拓?fù)洌簩?shí)驗(yàn)基本配置:1.首先將R1配置成為幀中繼交換機(jī):frame-relayswitching!interfaceSerial1/0noipaddressencapsulationframe-relayclockrate64000frame-relaylmi-typeansiframe-relayintf-typedceframe-relayroute101interfaceSerial1/1102!interfaceSerial1/1noipaddressencapsulationframe-relayclockrate64000frame-relaylmi-typeansiframe-relayintf-typedceframe-relayroute102interfaceSerial1/01012.R2和R3的基本配置:R2:interfaceLoopback0ipaddress2.2.2.2255.255.255.0!interfaceSerial1/0ipaddress12.1.1.2255.255.255.0encapsulationframe-relayserialrestart-delay0frame-relaymapip12.1.1.3101broadcastnoframe-relayinverse-arp!routerospf10router-id2.2.2.2log-adjacency-changesnetwork2.2.2.00.0.0.255area0network12.1.1.00.0.0.255area0R3:interfaceLoopback0ipaddress3.3.3.3255.255.255.0!interfaceSerial1/1ipaddress12.1.1.3255.255.255.0encapsulationframe-relayserialrestart-delay0frame-relaymapip12.1.1.2102broadcastnoframe-relayinverse-arp!routerospf10router-id3.3.3.3log-adjacency-changesnetwork3.3.3.00.0.0.255area0network12.1.1.00.0.0.255area0Type1----Non_Broadcast〔默認(rèn)〕我們?cè)赗2上showipospfneighbor,發(fā)現(xiàn)沒(méi)有鄰居。說(shuō)明在這種情況下鄰居需要手動(dòng)配置!配置如下:R2:R2(config)#routerospf10R2(config-router)#neighbor12.1.1.3R3:R3(config)#routerospf10R3(config-router)#neighbor12.1.1.2此時(shí)在R2上查看鄰居:R2#shoipospfneiNeighborIDPriStateDeadTimeAddressInterface3.3.3.31FULL/DR00:01:4612.1.1.3Serial1/0發(fā)現(xiàn)鄰居已經(jīng)形成并且有DR與BDR的選舉!在R2上查看接口R2#showipospfinterfaceSerial1/0isup,lineprotocolisupInternetAddress12.1.1.2/24,Area0ProcessID10,RouterID2.2.2.2,NetworkTypeNON_BROADCAST,Cost:64TransmitDelayis1sec,StateBDR,Priority1DesignatedRouter(ID)3.3.3.3,Interfaceaddress12.1.1.3BackupDesignatedrouter(ID)2.2.2.2,Interfaceaddress12.1.1.2FlushtimerforoldDRLSAduein00:01:40Timerintervalsconfigured,Hello30,Dead120,Wait120,Retransmit5在這種網(wǎng)絡(luò)類(lèi)型中,hello的間隔是30s。翻開(kāi)debug信息,我們可以看到在這種網(wǎng)絡(luò)類(lèi)型中,OSPF的數(shù)據(jù)包是單播傳送的。R2#*Aug1414:52:52.819:OSPF:Sendhelloto12.1.1.3area0onSerial1/0from12.1.1.2R2#*Aug1414:52:57.087:OSPF:Rcvhellofrom3.3.3.3area0fromSerial1/012.1.1.3*Aug1414:52:57.091:OSPF:EndofhelloprocessingType2----Broadcast首先去掉剛剛手動(dòng)配置的鄰居關(guān)系:R2(config)#routerospf10R2(config-router)#noneighbor12.1.1.3R3(config)#routerospf10R3(config-router)#noneighbor12.1.1.2將R2和R3接口的網(wǎng)絡(luò)類(lèi)型改成broadcastR2(config-router)#ints1/0R2(config-if)#ipospfnetworkbroadcastR3(config-router)#ints1/1R3(config-if)#ipospfnetworkbroadcast一會(huì)我們就看到了如下信息R3#*Aug1414:59:52.823:%OSPF-5-ADJCHG:Process10,Nbr2.2.2.2onSerial1/1fromLOADINGtoFULL,LoadingDone這說(shuō)明了在這種網(wǎng)絡(luò)類(lèi)型下是不需要手動(dòng)配置鄰居關(guān)系的!R2#showipospfneiNeighborIDPriStateDeadTimeAddressInterface3.3.3.31FULL/DR00:00:3912.1.1.3Serial1/0有DR與BDR的選舉。R2#shoipospfintSerial1/0isup,lineprotocolisupInternetAddress12.1.1.2/24,Area0ProcessID10,RouterID2.2.2.2,NetworkTypeBROADCAST,Cost:64TransmitDelayis1sec,StateBDR,Priority1DesignatedRouter(ID)3.3.3.3,Interfaceaddress12.1.1.3BackupDesignatedrouter(ID)2.2.2.2,Interfaceaddress12.1.1.2Timerintervalsconfigured,Hello10,Dead40,Wait40,Retransmit5Hello時(shí)間間隔為10s。R2#*Aug1415:02:20.443:OSPF:Sendhelloto224.0.0.5area0onSerial1/0from12.1.1.2*Aug1415:02:20.959:OSPF:Rcvhellofrom3.3.3.3area0fromSerial1/012.1.1.3*Aug1415:02:20.963:OSPF:Endofhelloprocessing使用224.0.0.5這個(gè)組播地址傳送數(shù)據(jù)包。Type3----Point-to-Point將R2,R3接口的網(wǎng)絡(luò)類(lèi)型改成Point-to-PointR2(config-if)#ipospfnetpoint-to-pointR3(config-if)#ipospfnetpoint-to-point很快我們就可以看到如下信息R3(config-if)#*Aug1415:06:07.559:%OSPF-5-ADJCHG:Process10,Nbr2.2.2.2onSerial1/1fromLOADINGtoFULL,LoadingDone說(shuō)明這種網(wǎng)絡(luò)類(lèi)型也不需要手動(dòng)指定鄰居R2#shoipospfneiNeighborIDPriStateDeadTimeAddressInterface3.3.3.30FULL/-00:00:3712.1.1.3Serial1/0沒(méi)有DR/BDR的選舉R2#shipospfintSerial1/0isup,lineprotocolisupInternetAddress12.1.1.2/24,Area0ProcessID10,RouterID2.2.2.2,NetworkTypePOINT_TO_POINT,Cost:64TransmitDelayis1sec,StatePOINT_TO_POINT,Timerintervalsconfigured,Hello10,Dead40,Wait40,Retransmit5Hello時(shí)間間隔為10sR2#*Aug1415:08:25.311:OSPF:Sendhelloto224.0.0.5area0onSerial1/0from12.1.1.2R2#*Aug1415:08:30.259:OSPF:Rcvhellofrom3.3.3.3area0fromSerial1/012.1.1.3*Aug1415:08:30.263:OSPF:Endofhelloprocessing同樣也是使用224.0.0.5這個(gè)組播地址傳送數(shù)據(jù)。Type4----Point-to-Multipoint將接口改為Point-to-MultipointR2(config-if)#ipospfnetworkpoint-to-multipointR3(config-if)#ipospfnetworkpoint-to-multipoint*Aug1415:10:51.739:%OSPF-5-ADJCHG:Process10,Nbr2.2.2.2onSerial1/1fromLOADINGtoFULL,LoadingDone同樣也不需要手動(dòng)指定鄰居R2#shoipospfneiNeighborIDPriStateDeadTimeAddressInterface3.3.3.30FULL/-00:01:4812.1.1.3Serial1/0沒(méi)有DR和BDR的選舉R2#shoipospfintSerial1/0isup,lineprotocolisupInternetAddress12.1.1.2/24,Area0ProcessID10,RouterID2.2.2.2,NetworkTypePOINT_TO_MULTIPOINT,Cost:64TransmitDelayis1sec,StatePOINT_TO_MULTIPOINT,Timerintervalsconfigured,Hello30,Dead120,Wait120,Retransmit5Hello時(shí)間間隔為30sR2#*Aug1415:12:49.759:OSPF:Sendhelloto224.0.0.5area0onSerial1/0from12.1.1.2R2#*Aug1415:12:57.443:OSPF:Rcvhellofrom3.3.3.3area0fromSerial1/012.1.1.3*Aug1415:12:57.447:OSPF:Endofhelloprocessing以224.0.0.5這個(gè)組播地址發(fā)送數(shù)據(jù)Type5----Point-to-Multipoint〔Non_Broadcast〕改變接口類(lèi)型為Point-to-Multipoint(Non_Broadcast)R2(config-if)#ipospfnetworkpoint-to-multipointnon-broadcastR3(config-if)#ipospfnetworkpoint-to-multipointnon-broadcast這個(gè)時(shí)候鄰居沒(méi)有被自動(dòng)發(fā)現(xiàn)。我們?cè)赗2上手動(dòng)指定鄰居R2(config-if)#routerospf10R2(config-router)#neighbor12.1.1.3R2(config-router)#*Aug1415:18:38.955:%OSPF-5-ADJCHG:Process10,Nbr3.3.3.3onSerial1/0fromLOADINGtoFULL,LoadingDone鄰居只要在一邊指定即可。說(shuō)明在這種網(wǎng)絡(luò)類(lèi)型下鄰居需要手動(dòng)指定。R2#shoipospfneiNeighborIDPriStateDeadTimeAddressInterface3.3.3.30FULL/-00:01:5712.1.1.3Serial1/0同樣沒(méi)有DR和BDR的選取R2#shoipospfintSerial1/0isup,lineprotocolisupInternetAddress12.1.1.2/24,Area0ProcessID10,RouterID2.2.2.2,NetworkTypePOINT_TO_MULTIPOINT,Cost:64TransmitDelayis1sec,StatePOINT_TO_MULTIPOINT,Timerintervalsconfigured,Hello30,Dead120,Wait120,Retransmit5Hello時(shí)間間隔為30sR2#*Aug1415:21:03.099:OSPF:Sendhelloto12.1.1.3area0onSerial1/0from12.1.1.2*Aug1415:21:03.295:OSPF:Rcvhellofrom3.3.3.3area0fromSerial1/012.1.1.3*Aug1415:21:03.299:OSPF:Endofhelloprocessing使用單播傳送OSPF數(shù)據(jù)??偨Y(jié):在NBMA網(wǎng)絡(luò)下5種網(wǎng)絡(luò)類(lèi)型具體情況如下表所示:網(wǎng)絡(luò)類(lèi)型鄰居自動(dòng)發(fā)現(xiàn)有無(wú)DR選舉Hello間隔傳輸方式Non_broadcast否有30s單播Broadcast是有10s組播Point-to-Point是無(wú)10s組播Point-to-Multipoint是無(wú)30s組播Point-to-Multipoint(非播送)否無(wú)30s單播本文出自“蓋如鶴的步徒〞博客,請(qǐng)務(wù)必保存此出處://gairuhe.blog.51cto/77728/38241OSPF實(shí)驗(yàn)4:虛鏈路實(shí)驗(yàn)等級(jí):Professional實(shí)驗(yàn)拓?fù)洌簩?shí)驗(yàn)分析:上面這個(gè)網(wǎng)絡(luò)的設(shè)計(jì)在OSPF中是比較失敗的,因?yàn)镺SPF建議所有的非骨干區(qū)域都和骨干區(qū)域直連。上面這個(gè)網(wǎng)絡(luò)的設(shè)計(jì)將會(huì)導(dǎo)致Area2的數(shù)據(jù)和Area0無(wú)法通信。為了解決這個(gè)問(wèn)題,一種方法可以在R3和R1上增加一條物理鏈路。還有一種過(guò)渡的方法就是使用虛鏈路。實(shí)驗(yàn)基本配置:R1:interfaceLoopback0ipaddress1.1.1.1255.255.255.0ipospfnetworkpoint-to-point!interfaceSerial1/0ipaddress10.1.1.1255.255.255.0serialrestart-delay0!routerospf10router-id1.1.1.1log-adjacency-changesnetwork10.1.1.00.0.0.255area0R2:interfaceLoopback0ipaddress2.2.2.2255.255.255.0!interfaceSerial1/0ipaddress10.1.1.2255.255.255.0serialrestart-delay0!interfaceSerial1/1ipaddress11.1.1.1255.255.255.0serialrestart-delay0!routerospf10router-id2.2.2.2log-adjacency-changesnetwork10.1.1.00.0.0.255area0network11.1.1.00.0.0.255area1R3:interfaceLoopback0ipaddress3.3.3.3255.255.255.0!interfaceSerial1/0ipaddress11.1.1.2255.255.255.0serialrestart-delay0!routerospf10router-id3.3.3.3log-adjacency-changesnetwork3.3.3.00.0.0.255area2network11.1.1.00.0.0.255area1我們?cè)赗1上查看路由表,發(fā)現(xiàn)沒(méi)有R3的Loopback接口路由:R1#shoiprouCodes:C-connected,S-static,R-RIP,M-mobile,B-BGPD-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaN1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2E1-OSPFexternaltype1,E2-OSPFexternaltype2i-IS-IS,su-IS-ISsummary,L1-IS-ISlevel-1,L2-IS-ISlevel-2ia-IS-ISinterarea,*-candidatedefault,U-per-userstaticrouteo-ODR,P-periodicdownloadedstaticrouteGatewayoflastresortisnotset1.0.0.0/24issubnetted,1subnetsC1.1.1.0isdirectlyconnected,Loopback010.0.0.0/24issubnetted,1subnetsC10.1.1.0isdirectlyconnected,Serial1/011.0.0.0/24issubnetted,1subnetsOIA11.1.1.0[110/128]via10.1.1.2,00:04:50,Serial1/0為了讓R1學(xué)習(xí)到R3的路由,我們配置虛鏈路。虛鏈路的配置:虛鏈路必須配置在ABR上,在這個(gè)網(wǎng)絡(luò)中ABR是R2和R3。虛鏈路的配置使用的命令是areatransit-area-idvirtual-linkrouter-id。我們現(xiàn)在在R2和R3上進(jìn)展配置。R2(config)#routerospf10R2(config-router)#area1virtual-link3.3.3.3R3(config)#routerospf10R3(config-router)#area1virtual-link2.2.2.2等虛鏈路起來(lái)后,我們查看其狀態(tài):R2#shoipospfvirtual-linksVirtualLinkOSPF_VL0torouter3.3.3.3isupRunasdemandcircuitDoNotAgeLSAallowed.Transitarea1,viainterfaceSerial1/1,Costofusing64TransmitDelayis1sec,StatePOINT_TO_POINT,Timerintervalsconfigured,Hello10,Dead40,Wait40,Retransmit5Helloduein00:00:05AdjacencyStateFULL(Hellosuppressed)Index2/3,retransmissionqueuelength0,numberofretransmission1First0x0(0)/0x0(0)Next0x0(0)/0x0(0)Lastretransmissionscanlengthis1,maximumis1Lastretransmissionscantimeis0msec,maximumis0msec在上面的信息中我們可以看到。虛鏈路在邏輯上是等同于一條物理的按需鏈路,既只有在兩端路由器的配置有變動(dòng)的時(shí)候才進(jìn)展更新,并且使用的是不老化〔DoNotAge〕LSA,既虛鏈路是無(wú)須Hello包控制的。R1#shoiprouCodes:C-connected,S-static,R-RIP,M-mobile,B-BGPD-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaN1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2E1-OSPFexternaltype1,E2-OSPFexternaltype2i-IS-IS,su-IS-ISsummary,L1-IS-ISlevel-1,L2-IS-ISlevel-2ia-IS-ISinterarea,*-candidatedefault,U-per-userstaticrouteo-ODR,P-periodicdownloadedstaticrouteGatewayoflastresortisnotset1.0.0.0/24issubnetted,1subnetsC1.1.1.0isdirectlyconnected,Loopback03.0.0.0/32issubnetted,1subnetsOIA3.3.3.3[110/129]via10.1.1.2,00:03:02,Serial1/010.0.0.0/24issubnetted,1subnetsC10.1.1.0isdirectlyconnected,Serial1/011.0.0.0/24issubnetted,1subnetsOIA11.1.1.0[110/128]via10.1.1.2,00:03:02,Serial1/0這時(shí)看到R1已經(jīng)學(xué)習(xí)到了R3環(huán)回口的路由。Metric值為129,虛鏈路的Metric等同于所經(jīng)過(guò)的全部鏈路開(kāi)銷(xiāo)之和,在這個(gè)網(wǎng)絡(luò)中,Metric=1〔Loopback〕+64+64=129。在R1上查看OSPF數(shù)據(jù)庫(kù):R1#showipospfdatabaseOSPFRouterwithID(1.1.1.1)(ProcessID10)RouterLinkStates(Area0)LinkIDADVRouterAgeSeq#ChecksumLinkcount1.1.1.11.1.1.17970x800000020x00B9C022.2.2.22.2.2.23690x800000040x00DD2933.3.3.33.3.3.36(DNA)0x800000020x008B351SummaryNetLinkStates(Area0)LinkIDADVRouterAgeSeq#Checksum3.3.3.33.3.3.312(DNA)0x800000010x00AE7511.1.1.02.2.2.27890x800000010x0029BE11.1.1.03.3.3.312(DNA)0x800000010x000BD8這里的〔DNA〕就是DoNotAge??偨Y(jié):虛鏈路被看成網(wǎng)絡(luò)設(shè)計(jì)失敗的一種補(bǔ)救手段,它不僅可以讓沒(méi)有和骨干區(qū)域直連的非骨干區(qū)域在邏輯上建立一條鏈路,還可以連接兩個(gè)別離的骨干區(qū)域。但是由于虛鏈路的配置會(huì)造成日后維護(hù)和排錯(cuò)的困難。所以在進(jìn)展網(wǎng)絡(luò)設(shè)計(jì)的時(shí)候,不能將虛鏈路考慮進(jìn)去。本文出自“蓋如鶴的步徒〞博客,請(qǐng)務(wù)必保存此出處://gairuhe.blog.51cto/77728/38402OSPF實(shí)驗(yàn)7:OSPF特殊區(qū)域?qū)嶒?yàn)級(jí)別:Professional實(shí)驗(yàn)拓?fù)洌簩?shí)驗(yàn)說(shuō)明:R2為ABR和ASBR,R3在NSSA實(shí)驗(yàn)時(shí)會(huì)成為ASBR。在做這個(gè)實(shí)驗(yàn)之前,首先我們要了解一下OSPFLSA的類(lèi)型。見(jiàn)下表:類(lèi)型代碼類(lèi)型名稱描述1路由器LSA每臺(tái)路由器都會(huì)產(chǎn)生,在區(qū)域內(nèi)泛洪2網(wǎng)絡(luò)LSADR產(chǎn)生,在區(qū)域內(nèi)泛洪3網(wǎng)絡(luò)匯總LSAABR始發(fā),在整個(gè)OSPF域中泛洪4ASBR匯總LSAABR始發(fā),在整個(gè)OSPF域中泛洪5AS外部LSAASBR始發(fā),在整個(gè)OSPF域中泛洪6組成員LSA標(biāo)識(shí)OSPF組播中的組成員,不做討論7NSSA外部LSAASBR始發(fā),8外部屬性LSA沒(méi)有實(shí)現(xiàn)9OpaqueLSA〔本地鏈路范圍〕

用于MPLS流量工程,不做討論10OpaqueLSA〔本地區(qū)域范圍〕11OpaqueLSA〔AS范圍〕在一個(gè)OSPF的普通區(qū)域,會(huì)存在LSA1,LSA2,LSA3,LSA4,LSA5這些LSA,并且數(shù)量很多。我們可以通過(guò)OSPF的特殊區(qū)域的配置讓某些區(qū)域減少LSA數(shù)目和路由表的條目?;九渲茫篟1:interfaceLoopback0ipaddress1.1.1.1255.255.255.0ipospfnetworkpoint-to-point!interfaceSerial1/0ipaddress10.1.1.1255.255.255.0serialrestart-delay0!routerospf10router-id1.1.1.1log-adjacency-changesnetwork1.1.1.00.0.0.255area0network10.1.1.00.0.0.255area0R2:interfaceLoopback0ipaddress2.2.2.2255.255.255.0!interfaceSerial1/0ipaddress10.1.1.2255.255.255.0serialrestart-delay0!interfaceSerial1/1ipaddress11.1.1.1255.255.255.0serialrestart-delay0!routerospf10router-id2.2.2.2log-adjacency-changesredistributeconnectedsubnetsnetwork10.1.1.00.0.0.255area0network11.1.1.00.0.0.255area1R3:interfaceLoopback0ipaddress3.3.3.3255.255.255.0!interfaceFastEthernet0/0noipaddressshutdownduplexhalf!interfaceSerial1/0ipaddress11.1.1.2255.255.255.0serialrestart-delay0!routerospf10router-id3.3.3.3log-adjacency-changesnetwork11.1.1.00.0.0.255area1在R1和R3上查看路由表:R1#shoiprouCodes:C-connected,S-static,R-RIP,M-mobile,B-BGPD-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaN1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2E1-OSPFexternaltype1,E2-OSPFexternaltype2i-IS-IS,su-IS-ISsummary,L1-IS-ISlevel-1,L2-IS-ISlevel-2ia-IS-ISinterarea,*-candidatedefault,U-per-userstaticrouteo-ODR,P-periodicdownloadedstaticrouteGatewayoflastresortisnotset1.0.0.0/24issubnetted,1subnetsC1.1.1.0isdirectlyconnected,Loopback02.0.0.0/24issubnetted,1subnetsOE22.2.2.0[110/20]via10.1.1.2,00:03:00,Serial1/010.0.0.0/24issubnetted,1subnetsC10.1.1.0isdirectlyconnected,Serial1/011.0.0.0/24issubnetted,1subnetsOIA11.1.1.0[110/128]via10.1.1.2,00:03:00,Serial1/0R3#shoiprouCodes:C-connected,S-static,R-RIP,M-mobile,B-BGPD-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaN1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2E1-OSPFexternaltype1,E2-OSPFexternaltype2i-IS-IS,su-IS-ISsummary,L1-IS-ISlevel-1,L2-IS-ISlevel-2ia-IS-ISinterarea,*-candidatedefault,U-per-userstaticrouteo-ODR,P-periodicdownloadedstaticrouteGatewayoflastresortisnotset1.0.0.0/24issubnetted,1subnetsOIA1.1.1.0[110/129]via11.1.1.1,00:02:51,Serial1/02.0.0.0/24issubnetted,1subnetsOE22.2.2.0[110/20]via11.1.1.1,00:02:51,Serial1/03.0.0.0/24issubnetted,1subnetsC3.3.3.0isdirectlyconnected,Loopback010.0.0.0/24issubnetted,1subnetsOIA10.1.1.0[110/128]via11.1.1.1,00:02:51,Serial1/011.0.0.0/24issubnetted,1subnetsC11.1.1.0isdirectlyconnected,Serial1/0OE2的路由是通過(guò)LSA5傳播,OIA的路由是通過(guò)LSA3來(lái)傳播。1.StubArea我們觀察拓?fù)?,發(fā)現(xiàn)Area1不管去外部的那個(gè)目的網(wǎng)絡(luò),都必須通過(guò)ABRR2進(jìn)展轉(zhuǎn)發(fā)。在這種情況下,Area1可以配置成StubArea。StubArea可以阻止LSA5,,并且處在區(qū)域邊界的ABR將會(huì)通過(guò)LSA3發(fā)送一個(gè)默認(rèn)路由給StubArea。處在StubArea內(nèi)的所有路由器都必須配置成為StubArea。首先查看R3的OSPF數(shù)據(jù)庫(kù)R3#shoipospfdaOSPFRouterwithID(3.3.3.3)(ProcessID10)RouterLinkStates(Area1)LinkIDADVRouterAgeSeq#ChecksumLinkcount2.2.2.22.2.2.290x800000070x00309C13.3.3.33.3.3.310x800000060x00451E2SummaryNetLinkStates(Area1)LinkIDADVRouterAgeSeq#Checksum0.0.0.02.2.2.21990x800000010x0075C01.1.1.02.2.2.290x800000030x00B13D10.1.1.02.2.2.290x800000030x0032B4Type-5ASExternalLinkStatesLinkIDADVRouterAgeSeq#ChecksumTag2.2.2.02.2.2.28420x800000010x00632F0通過(guò)以下配置可以將Area1配置成為StubArea。R2(config)#routerospf10R2(config-router)#area1stubR3(config)#routerospf10R3(config-router)#area1stub在R3上查看路由表:R3#shoiprouCodes:C-connected,S-static,R-RIP,M-mobile,B-BGPD-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaN1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2E1-OSPFexternaltype1,E2-OSPFexternaltype2i-IS-IS,su-IS-ISsummary,L1-IS-ISlevel-1,L2-IS-ISlevel-2ia-IS-ISinterarea,*-candidatedefault,U-per-userstaticrouteo-ODR,P-periodicdownloadedstaticrouteGatewayoflastresortis11.1.1.1tonetwork0.0.0.01.0.0.0/24issubnetted,1subnetsOIA1.1.1.0[110/129]via11.1.1.1,00:00:16,Serial1/03.0.0.0/24issubnetted,1subnetsC3.3.3.0isdirectlyconnected,Loopback010.0.0.0/24issubnetted,1subnetsOIA10.1.1.0[110/128]via11.1.1.1,00:00:16,Serial1/011.0.0.0/24issubnetted,1subnetsC11.1.1.0isdirectlyconnected,Serial1/0O*IA0.0.0.0/0[110/65]via11.1.1.1,00:00:16,Serial1/0發(fā)現(xiàn)原來(lái)的OE2路由沒(méi)有了,取代了1條默認(rèn)路由O*IA0.0.0.0/0[110/65]〔通過(guò)LSA3通告〕在看R3的OSPF數(shù)據(jù)庫(kù)R3#shoipospfdaOSPFRouterwithID(3.3.3.3)(ProcessID10)RouterLinkStates(Area1)LinkIDADVRouterAgeSeq#ChecksumLinkcount2.2.2.22.2.2.270x8000000A0x00BEA623.3.3.33.3.3.360x800000080x005F042SummaryNetLinkStates(Area1)LinkIDADVRouterAgeSeq#Checksum0.0.0.02.2.2.2120x800000010x0075C01.1.1.02.2.2.2120x800000040x00CD2210.1.1.02.2.2.2120x800000040x004E9此時(shí)已經(jīng)沒(méi)有Type-5ASExternalLinkStates的LSA了。2.TotallyStubArea對(duì)于本實(shí)驗(yàn)的Area1來(lái)說(shuō),其實(shí)域間路由OIA也是不需要的。我們可以將Area1配置成為T(mén)otallyStubArea,從而來(lái)阻止LSA3和LSA4在這個(gè)區(qū)域的傳播,出了通告缺省路由的那一條類(lèi)型3的LSA。TotallyStubArea的配置也很簡(jiǎn)單,只需要在ABR上將其配置成為totallystubarea,并且這個(gè)區(qū)域的所有路由器配置成為stubarea就可以了。在這個(gè)實(shí)驗(yàn)中,我們?cè)谏厦嬉呀?jīng)將R3配置成stubarea,只要在R2上配置area1成為T(mén)otallyStubArea即可。R2(config-router)#area1stubno-summary在R3上查看路由表和數(shù)據(jù)庫(kù)R3#shoiprouCodes:C-connected,S-static,R-RIP,M-mobile,B-BGPD-EIGRP,EX-EIGRPexternal,O-OSPF,IA

溫馨提示

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

評(píng)論

0/150

提交評(píng)論