




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、實驗四配置路由器靜態路由、默認路由和RIPv2、ospf協議一、實驗目的RIPv2路由協議。本實驗主要用來練習路由器的基本配置,包括靜態路由、默認路由和二、配置靜態路由和默認路由1.繪制拓撲圖并保存,拓撲圖如下圖所示。連接說明:Router 2Router4路由器1型號為2516, 路由器2和路由器4的型號均為2501 ;路由器1的ethernet 0與路由器2的ethernet 0相連; 路由器1的serial 0與路由器4的serial 0相連;注意:在連接路由器 1和4的串口時,請選擇路由器4作為DCE端;2、以路由器1、路由器2和路由器4為配置對象,進行相關設置。 按下表逐個設置路由器
2、 1、路由器2和路由器4的相關接口的IP地址;Router1Router2Router4In terface Ether net 010.1.1.1255.255.255.010.1.1.2255.255.255.0In terface Serial 012.5.10.1255.255.255.012.5.10.2255.255.255.0舉例:對路由器1的兩個接口的設置Router>e nableRouter#c onf term inalRouter(config)#hostname router1/*設置路由器 1 名稱為 router1;Router1(co nfig)#i nt
3、erface Ethernet 0/* 切換到路由器 1 的以太網接口 0Router1(config-if)#ip address 10.1.1.1 255.255.255.0/*設置該接口的 IP 地址等Router1(config-if)#no shutdown/* 開啟該接口Router1(co nfig-if)#e nd/* 退出特權模式Router1#conf t/*再進入配置串行接口0Router1(c on fig)# in terface serial 0Router1(config-if)#ip add 12.5.10.1 255.255.255.0Router1(c on
4、 fig-if)# no shutdow nRouter1(c on fig-if)#e nd對Router4操作:Router>Roti ter>enai3LeRoaterilconf 七Enter configuration cowiMands,. one per line. End with CNTL/E *Router (conf #hostnaiiie Router4Result:er-4 (Jeonfig') interf sORoater4(config-if> in add 12.5.10.2 255.255IiivaLid CQUunandEutar
5、4 Cacnfig-kf> #ip add 12厲丄口2 2552厲&QRouter4 Cconfig-i£)特no 呂h口七down%LLNK-3-UFDOWN: Interface SerialO, changed state to upRouteri(config-if> ttend%LINK-3-UPDOWN: Interface SeriaLO, changed state to down% LINE PROTO-5-UPDOWN : Line protocol on Interf 且 u 巳 SerialD , ctiangefl state to d
6、ownRouter4#對Router2操作:Rauter>enableRtrateroonf tHnter conf ignration oemmands f one per line. End with CJJTL/E .Ron七它r(uonf 1耳掛bomtnam總 tou七乜亍!?rou+er2 conf ig hostname Route r2(confiq)ffinterlace eORouter? (conrig-i f) #ip 電da 10 1 *1.2 255*255 23萬(JRouter?(config-if)#no sliut<lcwn%LIMK-3-UPD
7、OWN: Interface Etb« rnetO, atianged state to upRchiter? conf lg-i f) #etid對routerl操作:KouteoKjour-eonanieKjourernaont tmuter ogh±louration aommai'ids F one uer .line. £nd wi til chtl/z .Router (conti a) Whostnarne ronterlrouterl(conf1a>#intef euA% Invalid i nput detected at 1 *1
8、 marker *rout&rl(confi g)#i nterfaee «0routerl (conf i g- i f) # i p add 10.1-1-1 355 .95555.0rouitrl (conf i gr- if)shot down%LINir-3-UPDCiWN: Interfaatt Etliornat 0 r alia.ng«d stAt« to uprout«rl oonf i g- i f)rou七grl#oonf tEnter aonf igxira.t:i on commAnds one per JLina En
9、d wi th CNTL/2 rou七<3>rl (oonf i g) #i ntorfsqq sOto口tori(config if)frip add 12.5.10.1 25.255.255.0rou 七 <srl. (conf I g-if) frno Blnatdown% LINK 3 -UPDOWN: Intrfaae SrialQ f ahangrodto xiprout;srl (conf i g-if) #cnd.% LINK- 3 -UPDOWN: Interf acc Seri al 0 f changred s tate to down% LJNEPRO
10、TO-5 UPDOWNi: Line; prQ七QGQl qei HntuHfguu ScfIIO r uhdP百ud 尋七黑七心 七q down rout«Fl說明:其他兩個路由器的接口的IP設置,由學生參照路由器1的示例自己完成;注意:在設置路由器 4串口的時候,要設置其時鐘速率:Router4(config-if)#clock rate 6400 在路由器4上試著PING其他接口的IP地址,查看并分析結果;Type escape seqaenoe to abort,Sending 5, 100-tayte ICMP Echos to 10 + l .1 -1,timeout i
11、s 2 secoads:Snaeess rate is 0 percent 0/5, Tonnd-trip RcDterffping 1C »1.1,2mi n/avg/max = 1/2/4 dlsType escape sequence to abort.Sending 5 f 100-byte TCMP Eahos to 1C.1.±.2 ft imeout i s 5 seconds:zuin/avg/iuax = 1/2/4 ulsType escape sequence to abort;Sending 5, 100-byte ICMF Echos to 12
12、+ 5.10.1timeant is 2 seconds:Success rate Is 0 percent (C/5, Tound-trip min/avg/maj: 1/2/4 msRouter4# 切換到路由器 4,設置靜態路由;Router4(config)#ip route 10.1.1.0 255.255.255.0 12.5.10.1/*目的站網段地址子網掩碼下一站地址 在路由器4上,按如下PING,查看各個結果,并分析原因;Router4#pi ng 12.5.10.1Router4#pi ng 10.1.1.1Router4#pi ng 10.1.1.2Routersttpi
13、ng 12.10.1Type escape sequence to aiiort,Sending 100-byte ICMF Echos to 12 5.1 +1f timeout is 2 seconds:aftSciccess rate is 0 percent (0/5) , round-trip min/avg/max = 1/2/4 msRonter4#conf tEnter configuration aonunsnds, one per line, End wi th CNTL/ZRouterl<oonfigj #ip route 10 .1.1.C 255.255,255
14、.0 12-5.IQ.1Router4(aonfig)tRonter4#ping 12,5-10-1Type escape sequetice to abort.£ Sliding 5 r 100-byte ICMP Echos to 12.5.1 . 1 f tinLeemt i s 2 geands:Success rate is 0 percent C/5) t TOTjnd-trip min/avg'/wax = 1/2/4 msRanter4ttping 10.1.1.1Typ已 esoape sequence to atiort.Sending 5 f 100-b
15、yte ICMP Echos to 1C 4 1 «1 -1 r titaec口t i s 2 seconds :蟲口ccess rate is 0 percent (0/5) t Tound-t rip m.i ./avg/niajc = 1/2/4 msKou 七 Ei-4|pin 耳 10 R1 _ 1 - 2Type escape sequeLiae to at>ort SendLng S r 100-byte ICtW Echos tc 10 J. 1 2 , tiuLeout- 1 s 2 seconds:I ¥ I « l>Success
16、 rate is 0 percent (C/5) t round-trip Mi n/av/iaax = 1/2/4 ms蟲口口七 er-4 查看路由器4上的路由表;Router4#show ip routeRouter4#show ip £。口七電Codes : C - coEinecteci, S - stat;icr I - IGRPf R - RIP F M - mob! le r B - BSPD - EICIRP, EX - ETGRP ejc七ernal f O - OSPF, TA OSPF i n ter area El - OSPF external type 1
17、f E2 - OSPF external type 2, E - EGPi - IS-IS, Ll - IS-IS level-1 L2 - IS'IS level-2, * - candidate default n - per-user static rctiteGateway of last resort is not set10.0 + 0/24 is subnet七社1 subnetsS10.1.1.0 1/01 via 12,5,10.1Router4# 切換到路由器2上,配置其靜態路由;Router2(config)#ip route 12.5.10.0 255.255.
18、255.0 10.1.1.1Router2(confiq-i f)#exitRantar2eonf ig fjip r&trEw 12.5.10.0 255,255.255,0 10.1.1.1Router2(config> 帝 再次切換到路由器 4,再次PING,查看其結果與上次的不同,并分析原因;Router4#pi ng 12.5.10.1Router4#pi ng 10.1.1.1Router4#pi ng 10.1.1.2Route ir4*pi.Tiy 12.5 10.1Typesequence to aJ&srt *Sending 5r 100-byte I
19、CMP Echos tc 125.101 timeout is 2 seconds:S口crcess rate is O percent (O/5> r round-trip min/avg-/max = 1/2/4 msRoutar4 #pin? 161*1.1Typfi escape sequence to.Eendi 5 f 1ODbyte ICMP Echos to 10.1 _ 1.1 r timec口t; is 2 seconds :I l> I * ISuacess rate is Q percent (0/5> f round-trip min/avg/max
20、 1/2/-4 msRouter4#ping 10.1.1.2Rauter4# 切換到路由器2上,查看它的路由表;Router2#show ip routePouter2(confiq)KexitPouters# show ip routeodes: C - connected, S - stati a, I - I GRP, ft - RTP, M - mobile, B - BGFD - EIGKF, EX - EIGRP external r 0 - OSPF, IA - OSPF inter areaEl - OSPF ejcternal type 1, E2 - OSPF exter
21、nal type 2, E - EGPi - IS-IS, LI - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-nser static routeSateway of last resort i s not setID . 0.0.0/2-4 is subnet ted r 1 subnets二工。工工0 is directly CQiuieat-ed.f Et;heniet;O12 *D 叮.Q/2-1 js siibnetP I512+1C»C 1/0 via 10 .1 .1 < 1S
22、uter刊 切換到路由器 4上,刪除靜態路由,設置默認路由;Router4(co nfig)# no ip route 10.1.1.0 255.255.255.0 12.5.10.1/* 刪除靜態路由Router4(co nfig)#ip route 0.0.0.0 0.0.0.0 12.5.10.1/* 設置默認路由Router4#show ip route*21122Gateway of last resort is to network C.0,0.0S* 0.0.0.0 1/0 via 12.5.10.1Rjonter4三、配置RIPv2和ospf路由協議1、設計如下圖所示的拓撲圖,
23、R1和R2通過連接,PC為以太網口連接,各接口IP地址設置如圖中已給出所示,路由器型號均為2610 ;172. 1.6. I, 0/241T2- 1&. 2.172 1& 3 0/242、自己完成路由器 R1和R2的各自的以太網口和串口的配置; R1的配置Rj口ter4 (aonfttuo ip ro口七巳 1C .1.1.0 555.255.2£5.0 12 . £ . 10.1Rctiteri (conf ig ip rotrt 已12.5.10.1Router4 (conf igshow ip ro口七它% Invali-d input; detect
24、ed at; R A ' marker Ronter4 (config fiexitRouter4<show ip routeCodes: C - connected, S - static r I - 1GRP, R - K工F, M - mobile, B - BGPD - EIGRF, EK - EIGRP externalr O - OSPr, IA - OSPF inter areaO - per-oser static routeEl - OSPF external type 1E2 - OSFF external type L - IS-ISP LI - IS-IS
25、 level-1, L2 - IS-IS level-2r* - candidate defanitRoRo 口 tot" AQrxpJb 丄乞ones ipesr- 11 nc;.Ro ciitci r 4 g q* nf 七CTJTL/Z RdJLcst- cson f i njriTn t- i on conuiirtind.i?* rRo 口 teir c o n.:T1 y ) #lios tmuate Ft 1R.1 (ezsanX 1 qr> # L lite r-JTcse eOK±(c?omigr-ir)a did X72 iL>i_ Jl 3
26、3 * 2 53 .NBn.DHJ. (eon±>gr-it J #noLINBT 3 UPDOWN: IntcTf ace EthcriiatO chariLcrad. 3ta±,c to 貝 1 (coiiXia-iCJ -WtidR1 *Gonf tKrxte?r' oor> r 1 guiTat口cnuuLsmclN 丁 口rfcu 區>&匸 > 1.m (oomigr) wmTeT-raae so141 (oon±igr-zf Ja_dLd 172 丄石2 丄% IttValidL 1 ilptjt detecte
27、d at * A * mark_er -R1 (ookirigr-1 £*) # >1* rtdd 17 2 B 1 ® . 2 B 11A% Iwraisd 1 npxit: dLeeot:ea attR1 (conf icr-if) #ir> add. 1.7 2.1-6 £ :! 255.255 2號5。 R1 (con_f i gr i f ) #no 3H11 tHowii Litfflr蘭一tTPDOWN : TatLe直uesR1 (onr ly- 1 f) ««Eid曲 LINK-J-叮時 DOW1M : 丄Sflf
28、Ht衣 ©fl% LINE PROTO 5 UPDOWN ; Li ncol id ciy ed st t d Lesta i_ip>set-i axo r t>TOVOCOilUFLNin越 ©Cl on Int;orf aoo Sor lOtXQ f chanqredtto downBl#R2的配置RO 口trE T->Pouter>«na±>XeCMTL/Z.Ronterconf tEnter ecnficpiratLon commands r one per line, End with i R口口t-econ
29、63;ig) ffhQStname R2R2 (GOHfig-if#Lp Add 172-16 3,衛 255 呈廳®,215 廳DR2(coaf i g-1f#no shutdown%LINK3-UPDOWN: Interface EthernetO f changed. state to R2 (conrig-if7) fendCNTL/Z.R2#oonf tEnter aonf l guratlon comiiiaiidfi , one per Line. End wi th iZR2 (Gonf i q #interface sOH2(conrig-irjip add 172
30、*16.2*2 255*255(confi i f#no shutdowni LINK-3-UPDOWN! Interf aoe SerialO r changed sta_te t6 up R2 (cortfig-if) #endPC的IP的配置:3、 分別查看R1和R2上的路由信息,在PC上互相測試連通性的情況,分析結果(未做);Ip routeCodes: C - connected, S - static, I - IGRPf R - RIP, M - mobileT B - BGPD - EIG-RP T EX - EIGltP ejcternal, 0 - OS PF r LA -
31、 OSFF inter area £1 - QSPF external type 1, E2 - OS PF entemal type 2 E - EGPi - is-rsf LI - IS-IS level-1f L2 - IS-I£ level-2, * - candidate default U - p&r-user static routeGateway呂t resort Is not 呂e七172.16*0.0/24 is subnetted, 1 subnetsC172丄右,1D is direatly connected, EthernetORl#R2
32、#R2#sh.DV ip routeCodes : C - CoruieCted f £ - sta.tl a t I - I CUP r R - RIP f M - mobi Le f R - BGPD - EIGRP f EX - El GRP euztema.11 O OSPP f TA OSPF i nter a_rea El - OSPF external type 1, E2 - OSPF 七髯七ernal type 2, E - E<3Pi - IS-IS, LI - IS-IS Leval-1, L2 - IS-IS level-2, * - candidate
33、 default 0 - per-nser static rantsGateway of J.nst resort is net setR2#4、在R1上配置 RIPv2協議;參考命令如下:R1(config)#router rip/啟用 rip 協議R1(co nfig-router)# network 172.16.0.0申明本設備的直連網段R1(co nfig-router)#version 2默認的是版本1,這里改成版本 2Rl#c.onf tEnter confignration conmandsr one per line. End with CNTL/S.KI (c-onfig-
34、) frrou七&ripR1(configrQUtcr)fnetwark 172160.0R1(config-router)aversion 2KI(config-router)*5、在R2上配置RIPv2協議;參考命令如下:R2(config)#router rip/啟用 rip 協議R2(co nfig-router)# network 172.16.0.0申明本設備的直連網段R2(co nfig-router)#version 2默認的是版本1,這里改成版本2R3#conf tEnter conf ignva七了<?口 cQanjna.niis t onw per 1 in
35、eEnd witli CNTL/Z ,R2 (CQLifig) firouter ripR2 (conf ig-ro口匕總芝)172 1石 0 DR2 (conf ig-ront巴r)爭ver呂 i oll 2R2 (centigro口tir) #6、再查看R1和R2的路由信息,再測試兩 PC的連通性,分析此時的結果。R1 faanf ig-rauter) ffexitR1 (aontig) #exitRlstiow ip routeGodes; C - Gonnectedf S - static, I - IGRFf R - RIP, H - inofclie; B - BGFD - ETG
36、RP, EX - EIGRP eKternalp O - OSFF# IA - OSPF inter area El - OSPF external type 1 E2 - QSPF external type 2 T E - E<3P1 - IS-ISr LI - IS-IS level-1, L2 - IS-IS level-2 p * - candidate djefault U - per-口旨巴匸 static r口teGateway of last resort i s not set172.16.0.0/24 is subnetted, 1 subnetsC172.16.
37、L. 0 is directly ontiectedp EttiernetOIm *R2 config-router>R2 conf igj #exi tR2stiow ip font;已Cocies: C - Gonnected, S -帚 t西t ic, I - I GRP, K - RIP t M - inobi le, B - BOPD - E工EX - EIGRP external, O - OSPF, IA - OSPF 1口七& areaEl - OSPF external type 1t E2 - OSPF external type 2, E - EGP1 -
38、IS-ISf LI - IS-IS level-lf L2 - IS-IS level-2f * - candidAte default U - per-nser stati c routeGateway of last resort is not set172 11 - QiQ/24 is1,皿門wt目C172lEdQ is directLy GQLmecte<lr SthernetQR2#在 PC1 pi ng PC2:C:>ping 172-16.3.22Pinging 172.16.3.22 with 32 bytes of data:Rjetjuest tinie<
39、3 out,Reqoest timed out.Request timed out.Request timed out.Rsquest timed ont-Ping statistics for 172.16.3,22:Packets: Sent 5, Received 0r Lost 5 100% Lcss tApprcMima.t r-oiiiicl trip tin. mi 1.1 i seooncis ;Minimum = 0ms t Matti mi-mi = 0ms t Average = 0msPC2 上 pi ng PC1C ; Aping 172 J,百 1 11172414
40、11 with 32 byts q£ data:Request timed, outRoquest t-lned. ant;. Heqriest tinted out,Request timed out.Re<iuest tilled, out.Fing statistics Cor 172 1石 *1.-:1丄: Pack&ts: Sent = 5t Received = 0, Lost = 5 (100 loss),Approximite round trip times in milli-seconds :Mi ninLiuiL = Ohib f MazimLLm
41、 = Dms, Average = Dins7、在R1上配置ospf協議;R1(config)#no router rip取消 rip 協議R1(config)#router ospf 1/啟用ospf協議,“1 ” 代表進程,可以啟用很多個ospf進程。R1(config-router)# network 172.16.1.0 0.0.0.255 area 0申明本設備的直連網段,屬于區域0,這里的172.16.1.0 0.0.0.255 是反掩碼匹配。R1(co nfig-router)# network 172.16.2.0 0.0.0.255 area 0 8、在R2上配置ospf協議
42、R2(c on fig)# no router ripR2(co nfig)#router ospf 1R2(co nfig-router)# network 172.16.2.0 0.0.0.255 area 0R2(co nfig-router)# network 172.16.3.0 0.0.0.255 area 0 9、再查看R1和R2的路由信息,再測試兩 PC的連通性,分析此時的結果。R1(config-router#network 172.16.2,0 0.0 0 255 area 0R1 (config-routeT #network 172,16-1,0+ area 0R1(config-routerJ#exitR1(aonfigfrexitRltfsbow ip routeCodes: C - connected S - static I - IGRP, R - RIP, M - mobiler B - BGPD - EIGRPr EX - EIGRP external, O - OSPFr IA - OSPF inter area El - OSPF external type 1P E2 - OSPF external type 2r E - EGP i. - IS-ISr LI - ISIS Le
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 物理測試題大全及答案
- 教育教學改進與反思結合的試題及答案
- 能量轉化理論試題及答案2025
- 英語試題30題及答案
- 零售電商行業無人貨架技術發展趨勢報告
- 新能源汽車行業的國際合作試題及答案在2025年
- 新能源汽車的基礎設施建設研究試題及答案
- 教師教育教學反思與改進策略的實施路徑討論試題及答案
- 未來家具設計文化與科技的碰撞試題及答案
- 安健環知識試題及答案
- 輕型載貨汽車制動器設計
- 高考語文120個重點文言實詞
- 江蘇省糧食集團招聘筆試題庫2024
- 2023年全國職業院校技能大賽-老年護理與保健賽項規程
- 2024年深圳市彩田學校初中部小升初入學分班考試數學模擬試卷附答案解析
- 2024年安徽安慶市交通控股集團有限公司招聘筆試沖刺題(帶答案解析)
- 《沙龍培訓》課件
- 充電樁四方協議書范本
- 中考英語情景交際和看圖寫話
- 知道智慧網課《科學社會主義概論》章節測試答案
- 事故調查分析課件
評論
0/150
提交評論