




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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年宁波前湾新区卫生系统事业单位招聘副高及以上高层次人才2人考前自测高频考点模拟试题及答案详解(名校卷)
- 2025年中西医结合疗法临床应用考核答案及解析
- 2025年急重症医学大量出血抢救处理技巧考核答案及解析
- 2025年耳鼻喉科手术后护理技能检测答案及解析
- 2025年考古遗传学医学应用方法评估考卷答案及解析
- 2025海南成人高考真题及答案
- 2025成人高考真题范文及答案
- 2023年成人高考真题及答案
- 2025年康复科学专业康复评估测试技术考核模拟试卷答案及解析
- 2025年高考数学真题第一轮专项练习:计数原理与概率统计(含解析)
- 2025年湖南省安全员-B证考试题库及答案
- 北师大版六年级下册数学全册同步分层作业设计含答案解析
- 简易钢结构雨棚施工承包合同范本
- 苏州市前期物业管理委托合同范本
- 2022年冀教版七年级上册数学第一次月考试卷
- 《气管支架临床应用》课件
- 导数的应用-函数的零点问题(5题型分类)-2025年高考数学一轮复习(解析版)
- 8·12天津滨海新区爆炸事故调查报告分析及反思
- 2024新指南:中国阿尔茨海默病早期预防指南解读课件
- 江苏省南京市联合体2024-2025学年八年级上学期期中考试语文试题含答案
- 有限责任干股持有者分红权利具体合同版
评论
0/150
提交评论