配置和查看 OSPF協(xié)議.doc_第1頁
配置和查看 OSPF協(xié)議.doc_第2頁
配置和查看 OSPF協(xié)議.doc_第3頁
配置和查看 OSPF協(xié)議.doc_第4頁
配置和查看 OSPF協(xié)議.doc_第5頁
已閱讀5頁,還剩5頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

本實(shí)驗(yàn)是對OSPF協(xié)議的基本配置,涉及到配置OSPF協(xié)議所必須的命令和常用的show命令。1.實(shí)驗(yàn)?zāi)康耐ㄟ^本實(shí)驗(yàn),讀者可以掌握以下技能:在路由器上啟動(dòng)OSPF協(xié)議;聲明相應(yīng)網(wǎng)絡(luò)進(jìn)入OSPF路由進(jìn)程;查看OSPF路由信息;查看OSPF協(xié)議配置信息;查看OSPF鄰居路由器信息。2.設(shè)備需求本實(shí)驗(yàn)需要以下設(shè)備:Cisco路由器3臺(tái),分別命名為R1。R2和R3,其中R2要求具有2個(gè)串行接口,R1和R3均要求具有1個(gè)串行接口和1個(gè)以太網(wǎng)接口;2條DCE電纜和2條DTE電纜 (或2條DCE轉(zhuǎn)DTE電纜);1臺(tái)終端服務(wù)器,如Cisco 2509路由器,及用于反向Telnet的相應(yīng)電纜;4臺(tái)帶有超級終端程序的PC機(jī),以及Console電纜及轉(zhuǎn)接器。3.拓?fù)浣Y(jié)構(gòu)及配置說明本實(shí)驗(yàn)的拓?fù)浣Y(jié)構(gòu)如圖11-1所示,利用DCE和DTE電纜把R1。R2和R3路由器連接起來。各路由器使用的接口及其編號如圖11-1中的標(biāo)注。各接口IP地址分配如下:R1:S1192.168.1.130,E0172.16.1.1/24R2:S0192.168.1.5/30,S1192.168.1.2/30R3:S0192.168.1.6/30,E0172.16.3.1/24實(shí)驗(yàn)中R1、R2之間串行線路速率設(shè)置為 125kbit/s;R2、R3之間串行線路速率設(shè)置為64kbit/s。本實(shí)驗(yàn)要求通過對OSPF路由選擇協(xié)議的配置,實(shí)現(xiàn)拓?fù)渲腥W(wǎng)的連通性。4.實(shí)驗(yàn)配置及監(jiān)測結(jié)果按照拓?fù)浣Y(jié)構(gòu)圖連接好所有設(shè)備后,給設(shè)備加電,開始進(jìn)行實(shí)驗(yàn)。第1部分:配置接口和OSPF首先對各路由器的接口和OSPF協(xié)議進(jìn)行配置。配置清單11-1記錄了對3臺(tái)路由器的配置。配置清單11-1 OSPF協(xié)議的基本配置第1段:配置R1路由器RouterenRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#no logg consoleRouter(config)#hostn R1R1(config)#int e0R1(config-if)#no keepaR1(config-if)#ip addr 172.16.1.1255.255.255.0R1(config-if)#no shR1(config-if)#R1(config-if)#int s1R1(config-if)#ip addr 192.168.1.1255.255.255.252R1(config-if)#clock rate 125000R1(config-if)#no shutR1(config-if)#exitR1(config)#router ospf 100R1(config-router)#network 192.168.1.1 0.0.0.0 area 0R1(config-router)#network 172.16.1.1 0.0.0.0 area 0R1(config-router)#ZR1#第2段:配置R2路由器Term_Server#2Resuming connection 2 to r2 . RouterenRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#no logg consoleRouter(config)#shostn R2R2(config)#int s0R2(config-if)#ip addr 192.168.1.5 255.255.255.252R2(config-if)#no shR2(config-if)#int s1R2(config-if)#ip addr 192.168.1.2 255.255.255.252R2(config-if)#no shR2(config-if)#exitR2(config)#router ospf 100R2(config-router)#netw 192.168.1.2 0.0.0.0 area 0R2(config-router)#netw 192.168.1.5 0.0.0.0 area 0R2(config-router)#ZR2#第3段:配置R3路由器Term_Server#3Resuming connection 3 to r3 . RouterenRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#no logg consoleRouter(config)#shostn R3R3(config)#int s0R3(config-if)#ip addr 192.168.1.6 255.255.255.252R3(config-if)#clock rate 64000R3(config-if)#no shutR3(config)#int e0R3(config-if)#no keepaR3(config-if)#ip addr 172.16.3.1255.255.255.0R3(config-if)#no shR3(config-if)#exitR3(config)#router ospf 100R3(config-router)#netw 192.168.1.6 0.0.0.0 area 0R3(config-router)#netw 172.16.3.1 0.0.0.0 area 0R3 (config-router)#exitR3(config-if)#ZR3#(1)在上述配置中,首先對每臺(tái)路由器的接口進(jìn)行了配置。需要注意以下兩點(diǎn):在配置串行接口時(shí),應(yīng)按照接口所連接的電纜類型,對連接DCE電纜的接口配置時(shí)鐘;在配置以太網(wǎng)接口時(shí),使用了no keepalive命令,以便在不連接網(wǎng)線的情況下,使接口處于激活狀態(tài)。(2)router ospf 100命令啟動(dòng)一個(gè)OSPF路由選擇協(xié)議進(jìn)程(Process),其中的100為進(jìn)程號。與配置IGRP和EIGRP協(xié)議中的AS號不同的是,在配置OSPF時(shí),并不需要每臺(tái)路由器中的進(jìn)程號一致。AS和進(jìn)程是完全不同的兩個(gè)概念。(3)network命令使相應(yīng)酌網(wǎng)段加入OSPF路由進(jìn)程中,其格式為:network網(wǎng)絡(luò)地址(或IP地址)通配碼area區(qū)域號在本實(shí)驗(yàn)的配置中,使用了相應(yīng)接口IP地址,并且把通配碼寫成0.0.0.0,區(qū)域號為0,即主干區(qū)域。在OSPF的配置中,只要把接口加入到OSPF進(jìn)程中,此接口所對應(yīng)的網(wǎng)段就加入到OSPF路由進(jìn)程中了。(4)對于另外2臺(tái)路由器重復(fù)類似的配置,完成OSPF協(xié)議的基本配置。第2部分:查看IP路由表和測試連通性下面對配置后的各路由器進(jìn)行查看和測試,看是否實(shí)現(xiàn)了全網(wǎng)的連通。在這一部分,我們使用了show ip route、ping、trace等命令。監(jiān)測清單11-1記錄了所有的操作及其結(jié)果。監(jiān)測清單11-1查看IP路由表并測試連通性R3#sh ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, 0 - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not set172.16.0.0/24 is subnetted, 2 subnetsO172.16.1.0110/138via 192.168.1.5,00:00:21,Serial0C172.16.3.0 is directly connected, Ethernet0192.168.1.0/30 is subnetted, 2 subnetsO192.168.1.0110/128via 192.168.1.5,00:00:21,Serial0C192.168.1.4 is directly connected, Serial0R3#Term_Server#2Resuming connection 2 to r2 . R2#sh ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, 0 - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not set172.16.0.0/24 is subnetted, 2 subnetsO172.16.1.0 110/74 via 192.168.1.1,00:00:43,Serial1O172.16.3.0 110/74 via 192.168.1.6,00:00:43,Serial0192.168.1.0/30 is subnetted, 2 subnetsC192.168.1.0 is directly connected, Serial1C192.168.1.4 is directly connected, Serial0R2#ping 172.16.1.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:!Success rate is 100 percent (5/5), round-tdp min/avg/max =16/18/20 msR2#ping 172.163.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 172.16.3.1, timeout is 2 seconds:!Success rate is 100 percent(5/5),round-trip min/avg/max=28/31/32 msR2#(1)首先在R3路由器上使用show ip route命令查看其IP路由表,可以看到有2條行首標(biāo)注為O的路由項(xiàng),它們就是由OSPF協(xié)議學(xué)習(xí)到的路由。這2條路由的目的網(wǎng)段分別為172.16.1.0/24和192.168.1.0/30,它們的下一跳點(diǎn)均為192.168.1.5(R2 S0接口)。在第1個(gè)路由表項(xiàng)中有110/138字段,其中110是OSPF的缺省管理距離,138則是本條路由的Cost。Cost即費(fèi)用,是OSPF中的度量值標(biāo)準(zhǔn),路由器用Cost來比較到達(dá)同一目的網(wǎng)段的不同路徑的耗費(fèi)。低的Cost表示是好的路徑,相反則是差的路徑。(2)接下來切換到R2路由器的控制臺(tái)界面上,show ip route命令顯示有2條OSPF路由,它們分別是通過192.168.1.1(R1 S1接口)到達(dá)172.16.1.0/24網(wǎng)段和通過192.168.1.6(R3 S0接口)到達(dá)172.16.3.0/24網(wǎng)段的路由項(xiàng)。(3)在R2路由器上分別間172.16.1.1和172.16.3.1發(fā)出了ping測試,結(jié)果是成功的。(4)在R1路由器上查看路由表,同樣得到2條OSPF路由,分別指向目的網(wǎng)段172.16.3.0/24和192.168.1.4/30,其網(wǎng)關(guān)地址均為192.168.1.2(R2 S1接口)。(5)為測試172.16.1.0/24網(wǎng)段到172.16.1.0/24網(wǎng)段的端到端連通性,我們使用了擴(kuò)展的ping命令。測試結(jié)果是成功的,表明從R1的E0接口到R3的E0接口之間是在IP層是正常連通的。(6)接下來的trace命令測試了從R1到R3的E0接口所經(jīng)過的各個(gè)網(wǎng)關(guān),它們依次是192.168.1.2和192.168.1.6。第3部分:查看OSPF協(xié)議相關(guān)信息下面使用有關(guān)命令查看OSPF協(xié)議的配置、鄰居、接口和路由等信息。監(jiān)測清單11-2記錄了所使用的命令和相應(yīng)的結(jié)果。監(jiān)測清單11-2查看OSPF相關(guān)信息R2#sh ip protocolRouting Protocol is ospf 100Invalid after 0 seconds, hold down 0, flushed after 0Outgoing update filter list for all interfaces isIncoming update filter list for all interfaces isRouting for Networks:192.168.1.2/32192,168.1.5/32Routing Infottuation Sources:GatewayDistanceLast Update192.168.1.111000:09:26192.168.1.611000:09:26Distance: (default is 110)R2#sh ip ospf neighborNeighbor IDPriStateDead TimeAddressInterface192.168.1.61FULL/ -00:00:34192.168.1.6Serial0192.168.1.11FULL/ -00:00:36192.168.1.1Serial1R2#sh ip ospf neighbor detailNeighborIn the area 0 via interface Serial0Neighbor priority is 1,State is FULL,6 state changesDR is 0.0.0.0 BDR is 0.0.0.0Options is 0x42Dead timer-due in 00:00:38Neighbor is up for 00:10:40Index 2/2, retransmission queue length 0, number of retransmission 1First 0x0(0/0x0(0) Next 0x0(0)/0x0(0)Last retransmission scan length is 1, maximum is 1Last retransmission scan time is 0 msec, maximum is 0 msecNeighbor 192.168.1.1,interface address 192.168.1.1In the area 0 via interface Serial 1Neighbor priority is 1,State is FULL, 6 state changesDR is 0.0.0.0 BDR is 0.0.0.0Options is 0x42Dead timer due in 00:00:39Neighbor is up- for 00:10:50Index 1/1, retransmission queue length 0, number of retransmission 1First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)Last retransmission scan length is 1, maximum is 1Last retransmission scan time is 0 msec, maximum is 0 msecR2#sh ip ospf interface s0Serial0 is up, line protocol is upInternet Address 192.168.1.5/30, Arca0Proems ID 100, Router ID 192.168.1.5,Network Type POINT_TO_POINT,Cost:64 Transmit Delay is 1 sec. State POINT_TO_POINT,Timer ititervals configured Hello 10,1ead 40, Wait 40, Retransmit 5Hello due in 00:00:00Index 2/2, flood queue length 0Next 0x0(0)/0x0(0)Last flood scan length is 1, maximum is 1Last flood scan time is 0 msec, maximum is 0 msecNeighbor Count is-: 1,Adjacent neighbor count is 1Adjacent with neighbor 192.168.1.6Suppress hello for 0 neighbor(s)R2#sh ip ospf databaseOSPF Router with ID (192.168.1.5) (Process ID 100)Router Link States(Area 0)Link IDADV RouterAgeSeq#Checksum Link count192.168.1.1192.168.1.18320x800000050xF6B83192.168.1.5192.168,1.58200x800000060xF6B84192.168.1.6192.168.1.68060x800000050xF6B83R2#Term_Server1Resuming connection 1 to r1 . R1#sh ip ospf neighborNeighbor IDPriStateDead TimeAddressInterface192.168.1.51FULL/-00:00:36192.168.1.2Serial1R1#Term_Server3Resuming connection 3 to r3.R3#sh ip ospf neighborNeighbor IDPriStateDead TimeAddressInterface192.168.1.51FULL/-00:00:35192.168.1.5Serial0R3#sh ip route ospf172.16.0.0/24 is subnetted,2 subnetsO172.16.1.0110/138via 192.168.1.5,00:12:12,Serial0192.168.1.0/30 is subnetted,2 subnetsO192.168.1.0110/128via 192.168.1.5,00:12:12,Serial0R3#sh ip route 172.16.1.0Routing entry for 172.16.1./24Known viaospf 100,distance 110,metric 138,type intra areaLast update from 192.168.1.5 on Serial0,00:12:20 agoRouting Descriptor Blocks:* 192J68.1.5, from 192.168.1.1, 00:12:20 ago, via Serial

溫馨提示

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

評論

0/150

提交評論