




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、实验四配置路由器静态路由、默认路由和RIPv2、ospf协议RIPv2路由协议。一、实验目的本实验主要用来练习路由器的基本配置,包括静态路由、默认路由和二、配置静态路由和默认路由1.绘制拓扑图并保存,拓扑图如下图所示。Router 2Ftoutedl连接说明:路由器路由器路由器路由器1型号为2516,2和路由器4的型号均为2501 ;1的ethernet 0与路由器 2的ethernet 0相连;1的serial 0与路由器 4的serial 0相连;注意:在连接路由器 1禾n 4的串口时,请选择路由器 4作为DCE端;Fl uter42、以路由器1、路由器2和路由器4为配置对象,进行相关设置
2、。 按下表逐个设置路由器 1、路由器2和路由器4的相关接口的IP地址;Router1Router2Router4In terface Ether net 010.1.1.110.1.1.2255.255.255.0255.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(
3、co nfig)#i nterface 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(co nfig-if)#i p add 12.5.10.1 255.255.25
4、5.0Router1(c on fig-if)# no shutdow nRouter1(c on fig-if)#e nd对Router4操作:Route r>RjOEiter>e 口 工IsRouter#conf tEnter confiration cosmands one per lineRouter (Goafig #hostrLajiie Router4RjOT3ter4 (config' #lnterf sORotater4 (coInvalid Couiauidnouter4 (conCiq-if>ttipRjoater4 tconELg-if >
5、;ttnoEnd with CNTL/E *add 12,5,10,2 255.255.255*0add 12.5.ID.2 255-255.255.0 shutdown%LINK-3-UFDOWN: InterfaceRonter4config-if>#end %LrNB:-3-UPDOWN; Interface %LIHEPROTO-5-DPDOWN: LineSerialO,ctianged state to upSerlain, protocolchanged state to downon Interf且ce Seri且IC , clianged state to dcwiiR
6、oute r4#对Router2操作:ftou te r>enaJ91eRonter#conf tEnter conf i gnrat i on Dcnunsnds , oneRouter (conf ig) Ithastnaiiie route r2 router2 (conf ig fhostnaue Ronterfl RoTTte 匸2 口 an£ig) ft interface eORduVerS(config-1f)#ip 电说d 10,1.1.0 255.255.255,0Router2 Cconf ig-i f) #no stiutdown %LINK-3-aPD
7、OWN: Interface Eth电rnetO, Ghanged state to up Itouter2 (config- if) #efidper line. End with CNTL/E .对routerl操作:Rjoiiter>Hou te r Afi na£>j.&Route nt conr tEnter contlauration couiutartds, one i>er J.me. End with Router(confICO#hostnanw routerlrouterl< conf1a> #1ntet eOCMTL/Z.
8、电 Invalid 1 ra>nt detected nt '*' marker,roTitwrl (oonf i«0rontfltrl(confi a-'J # i P add 10.1.1.1355.355.255.0roTitFl (uenf i b-istintflown4LIKir-3-UE>DOWll: Int«r£*o« Etharn«t O, ohang'Sel 七to rQnt«rloonfi g-if#«ndrDnt«rl#aonf tEnter oo
9、nfigziratl on cozamands on« p«r Zina. End with rQQtorloonfi 9#i ntorfaso aOrouterl(oonfi 9 i f)R ip add 12.5.ID.1 25.255.255.0 routerl oonf i g-if) Rno etratdewn %LINK-3-Un5OW?; IntoTfaoo routcTl(confi g-if)Rend %LIHir-3-nPDOWH: Interface% CIHEPROTO - 5 -UPIXyHN ; LineCWTL/2-changed stato
10、to TspSertalO J prptvcolstate to iownQR interface ScrialO, chnAigud atatu to downroQt«rl#Router4(co nfig-if)#clock rate 6400说明:其他两个路由器的接口的 IP设置,由学生参照路由器1的示例自己完成; 注意:在设置路由器 4串口的时候,要设置其时钟速率: 在路由器4上试着PING其他接口的IP地址,查看并分析结果;Router4#ping IC. 1,1.1Type escape sequence to abort,Sending 5. 100-byte ICMP
11、 Echos to 10.1.1.1, timeout is 2 secoads:Success rate is 0 percent (C/5 , Tomwitrip min/avg/max = 1/2/4 las Router4#ping IC*1*1.2Type escape sequence to abort.Sending 5, IOC-byte TCMP Echos to 10.1.1.2 t imeoTit i s J seconds:Saccessis C percent t0/5> t TOWMi-trip min/avg/max - 1/2/4 blsEloutGr4#
12、ping 12.5 .ID .1Type escape seqcience to abort,Sending 5, 100-byte ICMP Echos to 12*5.10*1, timeout is 2 seconds:SnGcess rate is 0 percent (0/5) , Totmd-trip min/avg/max = 1/2/4 nasRouter4# 切换到路由器 4,设置静态路由;Router4(co nfig)#ip route 10.1.1.0 255.255.255.0 12.5.10.1/*目的站网段地址子网掩码下一站地址 在路由器4上,按如下PING,查看
13、各个结果,并分析原因;Router4# ping 12.5.10.1Router4# ping 10.1.1.1Router4# ping 10.1.1.2Router4ttping 1210.1Type escape sequence to abort.Sending 5, lOO-byte ICMF Echos to 12.5.10.1, timeout is 2 seconds:Success rate is percent (0/5), round-trip mla/avg/max = 1/2/4 ma Ronter4#conf tEnter configuration command
14、s oneRouterl(config)#ip route 10*1.1.0Router4(confLg)ftexltRonterlttping 12,5 _10,1per line. End vith CNTL/S.255.255.255.0 12.5,10-1Type escape sequence to atoort. Sandi-ng 5 lOO-byte ICMP Echos tc12.5.10.1, tinLecmt: la 2 seconds:Success rate is percent fC/5)i , Toxind-trip Roater4ttping 10-1.1.1Mi
15、 n/avg/wax = 1/2/4 msType escape setjnence to abort.Sending 5庁 100-byte ICMP Echos to 10.1*1.1,tisLeout i s 2 seconds:fiaccess rate is D percent (0/5Ji Tound-tripRonher4ing 10-1-1,2nti a./ a.vq-/iiajc = 1/2/4 msType escape sequence to al>ort. £eiidi.ng 5” lOO-byte ICMP Echos tc 10.1.1.2,匸ime
16、oLLt i. s 2 seconds:Success rate is percent fC/5)i t round-tripmi a/avq/aiax = 1/2/4 msRon ter-4查看路由器4上的路由表;Router4#show ip routeRjotiter4#shciw Ip routeCodes: C - qQunected, S - static 1 - iGRFr R - RIF M - mo£>i ie r & - BGPD - EIGRP EX - ETGRP exhernalO - OSPF TA OSPP inter 孔rea£
17、1 - OS PF external type 1, E2 - OSFF estternal type 2, E EGFi - IS-rs, Ll - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - p«r-user static routeGateflra.y of last resort is not set10.0.0.0/24 is suhnetted, 1 subnets10,1.1.0 I/O via 12,5.10.1Router4#切换到路由器2上,配置其静态路由;Router2(co nfig
18、)#ip route 12.5.10.0 255.255.255.0 10.1.1.1Router?(config-if)韩exitRocitep2 (Gonf ig>fifIp roGte 12.5.10.0 255.255.255.0 10.1.1.1Router?(config)帝再次切换到路由器 4,再次PING,查看其结果与上次的不同,并分析原因;Router4# ping 12.5.10.1Router4# ping 10.1.1.1Router4# ping 10.1.1.2Ron te;r4#pLng 12.5.10.1_Type 弓sequence toSending
19、5, lOQ-byte ICMP Echos to 12.5.10.1, timeout is 2 seconds:S口ac&ss rate 1s 0 percent (0/5). round-trip min/avg/max = 1/2/4 msIlouter4frpi ng 10.1.1.1Type escape segsenes to abort.Ssncli ng 5 lODbyte ICMP Echos to 10.1 _ 1.1 timeo口七 is 2 seconds :Success rate is 0 percent 0/5)卩 roond-trip min/avg/
20、max 1/2/4 msRjouter4#pi.ng 10.1.1.2Router4#切换到路由器2上,查看它的路由表;Router2#show ip routeuter2 (conf ig>#exittiter2#show tp renteodes: C - connected, S - static, I - ISRP, R - RTF, M - mobile, B - BGPD - EIGRF, EX - EIGRP external, O - OSPF, lA - OSPF Inter area El - OSPF external type 1, E2 - OSPF exter
21、nal type 2, E - EGP i - IS-IS, LI - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - psT-nser static routejflteway of last resort is not setIC , C . C . 0/2-4 IS siibnetted r i subnets10.1.1.0 is di rectly couxected., EtbanietD12 * C «Q > 0/24 is, X sulraets12.5*10»0 1/0 via
22、 10<l .1.1切换到路由器 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 routeRoa ter4 (config-J ttno ip roiite ID .1.1.0 2£5.255.25 0 13.S.10.1Rjotiter4 (conf tfip rotite 0 , D . D .
23、0 0 . D . Q 0 12.5,10.1Roi3ter4 (conf ig> #show ip route% Invalid Inp口t detected atmarker.Rauter4tconCig>tfexitRoater4#show ip routeCodes: C - connected, S - static, I - IGEP, R - RIP, M - niobi le, a - BGPD - EIGHP, EX - BIGBP external, O - OSPF, lA - OSPF inter areaEl - OSPF external type 1,
24、 E2 - OSFF ejcternal type 2, E - ESPL - IS-ISp LI - IS-IS level-1, L2 - IS-IS level-2, * - aandidate defa口Lt - per-oser static routeGateway of last resort is to network O.C+O.O £* Q.0.0.0 1/D) Yi亘 12.5.10.1Rjontar4#三、配置RIPv2和ospf路由协议1、设计如下图所示的拓扑图,R1和R2通过串旦接,PC为以太网口连接,各接口IP地址设置如图中已给出所示,路由器型号均为26
25、10 ;'172. 16. 1. 0/24R1172. 16.3.0/24172. IS. 2. 0/24E22、自己完成路由器 R1和R2的各自的以太网口和串口的配置; R1的配置Keal:«r>Roa tor AonMlfl七Bn tcsr con f iiTrit i on ccnuirnnciK . onu jmi- 1 i nv? . Hnri w i tTi Rcuter- < oo-iif L g > #1103niR1 (oonX 1 # L iiter-rcseKJ. (C:?onTlg-lEJ #lp mdU i节 H _Li 丄 J.
26、N3S d H 3口. 123 URJ. (e*rt±Mgf-i£) #no shti七Homei%LltTKi3UPDOWW : IntcTfa-ce EthenictC . chuuiccd state to R1 tc;otXi4-ir>cdtLdR1 »n r tTn-ttrri quT片11 已口 rc-uajuEins1*呼 11 门亡.R1 tlOonT 1 g- #inteT-ra-Cfe sDRi (con±iq:Lt#>p c±d X72 . J_e - & . 1wl til匕 Ikiva.J.id.
27、iiittat detected itmark-cr _Ri (ctokria-iavi iv? . iirt.衍 invj-icx mpKit tioteotaa atin 耳 Titer,Ri (conf ioifJ-Ril?172 .1R1 t con iQ- i f > -Wrict shin口Wn*viwir-a-upoowM = 工川上上亍亡口卍R1 czonriy-ir>t±n<l4 1-INK- J-UPDOWH : 工nt«T£O« %LIMEPROTO=5 UPIX3WW s Li nc255 _ 255.255.0
28、S4E-1 aio I PTDtDOOldlLdtiy电iJ U tcdt-Cftu 1_1JJto downariAn审*0on iTi'CfiX'f aoa ScnaLO j chancrod stat心 to dovn2#Fl#R2的配置Route r>Bba t e lX n mbLaRoTiter#conf tEiit«r co nfi ration comuLands oneBQTitrerconfig) ttiQstnaiue B2R2 (CQix匸i?)eOR2(conng-if tip add 172-16.3*2 255*255.255*0K
29、2 (coaf 1 i f #no shutdown% LINIC-3-OPDOWJ: Interface EttLernetO , changed state to iE2 (conlig-if) #endR5#conf tEnter gonf 1 guratton commaiids , one per line. End wi th *R2 (con.f i #interf ace sOR2(coafig-if#Lp add 172.16-2,2 255.253.255.0(con.fig-if) #no shutdown% LINK- 3 - UPDOWH i Interface Se
30、rialO , changed sta.te to upR2 (coafij-ifJ endper 11 n«, End withCMTL/S.opCNTL/S.PC的IP的配置:R2(co nfig-router)#version 2默认的是版本1,这里改成版本 23、分别查看R1和R2上的路由信息,在PC上互相测试连通性的情况,分析结果(未做);Ulttshow ip routeCodes: C - connected p S - static, I - I GRP, E. - RIP H - mobile, B - BGPD - SIijRP, EX - EIGRP ejcte
31、rnal, 0 - OSPP, lA - OSPF inter area El - OSPF eKUernal type 1, B2 一 OSPF external type 2” E 一 EGFi - TS-TS, LI - IS-IS level-1, L2 - TS-IS level-2, * - candidate default U - per-tiser static routeGateway ci last resort is not set172.16.0.0/24 is SEbnatted, 1 subnets172,16.1,0 is di recti Y connecte
32、d, E theme toRl#R2ttR2#sh.ow ip routeCodes : C - connected, S - sta.ti csj 1 - IGliT, R RIP, H - mobile R - BCPD - E3GPP r EX - EIGRP eLternal, O - OSPF,工A - OSPP inter areaEl - OSPF external type 1E2 - OSPF external type 2, E EGPi - IS-IS, LI - rS-IS level-1, L2 - IS-IS level-2, * - candidate defau
33、lt D - per-nser static roatfeGatevay of last resort is not satR2#4、在R1上配置 RI Pv2协议;参考命令如下:申明本设备的直连网段R1(config)#router rip/启用 rip 协议R1(co nfig-router)# network 172.16.0.0R1(co nfig-router)#version 2默认的是版本1,这里改成版本 2Rlftconf tEater c-onfi gnrati on conuoands one per line. End with CNTL/2 . RI fconfig&q
34、uot;) *roTi七er ripRIfconfig-router)tnetwork 172.15.0.0RItconfig-router)Aversion 2 pj. (config-router) #5、在R2上配置RI Pv2协议;参考命令如下:申明本设备的直连网段R2(config)#router rip/启用 rip 协议R2(co nfig-router)# network 172.16.0.0R2#con£ tEnter conf iguration ctrnmanfla , one per line, End wi tli CHTL/ER2(confiq)brout
35、er ripR2 (conf ig-ro口teT)#n它 tworlc 172.15.0.0R2(config-rooteT)#versi on 2R2(config-ro口tCT)#6、再查看R1和R2的路由信息,再测试两 PC的连通性,分析此时的结果。R1config-router)tfexitRJ. tconf ig) #exi. tRlfrstiow ip routeCodes: C - co 口 necteU, S - static, I - IGRF R 一 RHP, M - mobile, B - BGPD - EIGRP, EX - EIGRP externalt O - OS
36、PF, lA - OSPF Inter area El - OSPF external type 1, E2 - OSPF external type 2, E - EGP t - IS-IS, LI - rs-IS level-1, L2 - IS-IS level-2, * - candidate djefault U - per-user static r口teGateway of last resort is not set172.16.0.0/24 Is subnetted, 1 subnets172. L6. L . 0 is directly onnected, Etlierne
37、tDlbR2conf i g-route r 卜#exitR2(config)#eMtt4tstlCW ip routeCodes: C - aonnected, S - static, I - IGRP, R - RZP# M - mobilej B - BGPD - ElOEF BX - EIGRF external, O - OSPr,工A - OSFF inter areaEl - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS LI - IS-IS level-1, L2 - IS-IS level-
38、2/* - Candida匕e defaultU - per-nser statlc routeGateway of last resort is not set172 f le, O.D/S4 13 ndnatgg 1 subnets172.J. 0 is directly com;ecte<lr £thernetDR2#在 PC1 ping PC2:C;>ping PlnqingRequest Request Request Request Reoneattimed timed tinned timed timedout, out, ont. out. ont_Pin
39、g statistics for 172.16.3.22;Packets: Sent 5, Received 0, Lost 5 1.00E los9>ApproziiiLat; irotin<l trip times in mi 11 i-seconds:Mi nlmmu = Oms, Haiti mmn = Oms f Average =OmsPC2 上 ping PC1C : >pi ng Filing172.16.1.11172.1$.1.11 With 32 bytes o£ data:Rt©卫 eflt R-eqiaeat Bequest Re
40、cjnest Requestt-lm&d. t-lnbed. timed tlSKd tii&ed&at. nt. out. out. out.Ping statistics for 172.16,1.11:Packets: S«nt = 5卩 Received = 0, Lost = 5 Approxifflite round trip tines in milli-seconds:Mlrldlujil = Dins, Malmuni = Dxis, Average =loss,Dins7、在R1上配置ospf协议;R1(c on fig)# no rout
41、er rip取消rip协议R1(config)#router ospf 1启用ospf协议,“1 ” 代表进程,可以启用很多个ospf进程。R1(config-router)# network 172.16.1.0 0.0.0.255 area 0申明本设备的直连网段,属于区域172.16.1.0 0.0.0.255 是反掩码匹配。0,这里的R1(co nfig-router)# network 172.16.2.0 0.0.0.255 area 08、在R2上配置ospf协议R2(c on fig)# no router ripR2(co nfig)#router ospf 1R2(co n
42、fig-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 09、再查看R1和R2的路由信息,再测试两 PC的连通性,分析此时的结果。172.16.3.22172.16.3.22 wLtb 32 bytes of data;R1 (config-ro titer#ne two rlt 172* IS. 2.(3 D » 0 » 0 - 255 area 0R1 (confiQ-router #networJt 172.16.1.0 0*0*0,255 area 0R1(config-router)#exitR1 (config (exitRlttaliow ip routeCodes: C - connected r S - static, I - I GRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGHT external
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
评论
0/150
提交评论