实验5 动态路由协议RIP与OSPF的配置_第1页
实验5 动态路由协议RIP与OSPF的配置_第2页
实验5 动态路由协议RIP与OSPF的配置_第3页
实验5 动态路由协议RIP与OSPF的配置_第4页
实验5 动态路由协议RIP与OSPF的配置_第5页
免费预览已结束,剩余14页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

实验5 动态路由协议RIP与OSPF的配置实验学时:2一、实验目的1、熟悉CISCO IOS和CLI命令模式的使用;2、了解和掌握路由器基本配置命令的使用;3、掌握动态路由协议的配置;4、掌握VLAN中路由器的设置;3.掌握RIP与OSPF路由协议及其配置。二、实验设备与环境Windows 2000 Server/Advance Server主机局域网、CISCO Catalyst 2950交换机和2600系列路由器,Cisco Packet Tracer 7.0软件。三、预备知识3.1动态路由配置两个重要的命令用于配置动态路由:router和network。Router命令启动一个路由选择进程,格式:router(config)#router protocol keywork,network命令是每个IP路由选择进程所需要的。router(config-router)#network network-number参数如下表:ProtocolRIP,IGRP,OSPF和EIGRPNetwork例如一个自主系统,使用如IGRP这样的协议。Network命令是每个IP路由选择过程所必须的配置命令,以检查路由更新时哪个接口参与接收和发送Network-number具体说明一个直连网络3.2 RIP协议配置RIP的关键特点如下: 它是一个距离矢量路由选择协议; 选用跳计数作为路由选择的度量标准; 跳计数允许的最大值是15;缺省情况下,路由选择的更新数据每30秒种广播一次。第一版本不支持子网划分,如使用子网划分应使用第二版本(命令:version 2)。router rip命令选择RIP作为路由协议:Router(config)#router ripnetwork命令指定基于NIC网络号码,选择直连的网络:Router(config-router)#network network-number路由选择进程将接口与适合的地址相关联,并且开始在规定的网络上处理数据包。RIP配置实例: router rip:选择RIP作为路由选择协议; network 1.0.0.0:指定一个直接相连的网络; network 2.0.0.0:指定一个直接相连的网络;3.3 OSPF协议配置OSPF作为一种链路状态路由协议,除了路由器的数目外,还通过路程段之间的连接速率和负载平衡等多项参数计算出到达目标节点的度量值,并选择度量值最低的作为发送数据包的最佳途径。OSPF是层次化的路由选择协议,用于大型网络的互连,可以将网络划分多个区域,每个区域为一个段,区域0(area 0)是OSPF网络中必须具有的主干区域,其他所有区域要求通过区域0互连到一起。(1)OSPF路由进程ID的范围在1-65535之间,而且只有本地含义,不同路由器的路由进程ID可以不同。如果要想启动OSPF路由进程,至少确保有一个接口是up的。同一台路由器上可以启动多个OSPF进程,但会消耗更多的CPU 和内存等资源。(2)区域ID是0-4294967295的数,也可以是IP地址的格式A.B.C.D。当网络区域为0或0.0.0.0时称为主干区域。(3)Router ID选择遵循如下顺序: 1)最优先的是在OSPF进程中使用“router-id”指定了RID; 2)如果没有在OSPF进程中指定RID,则选择IP地址最大的环回接口的IP地址为RID; 3)如果没有环回接口,则选择活动的IP地址最大的物理接口的IP地址为RID。如果使用“secondary”配置IP地址时,该地址不起作用,即不参与RID竞选;使用“router-id”后,应使用命令“clear ip ospf process”重置ospf进程,新配置的RID才能生效;2、3步只有在下次重启路由器时才会生效,即后来加入大的IP地址也不能选举为RID直到路由器重启。(4)Router ID重新选举规则: 1使用“router-id”和“clear ip ospf process”命令; 2重启路由器(不一定)。四、实验内容4.1 课内实验任务1、路由器的RIP协议配置(1)实验准备工作运用Cisco Packet Tracer软件设计如下网络拓扑图。不同型号的交换机配置命令不同,这里选择2600系列路由器的2621型号,交换机选择2900系列。IP地址、掩码和连接路由器的端口号如图所示。将网络拓扑图保存,并在Cisco Packet Tracer模拟器中打开该图(参考实验4的方法)。f0/0f0/0f0/0f0/1se0/0se0/0f0/0f0/1f0/3f0/2IP: 11.0.0.2/24IP: 11.0.0.1/24IP: 12.0.0.1/24IP: 12.0.0.2/24IP: 10.0.0.1/24IP: 10.0.0.2/24IP: 192.168.1.2/24IP: 192.168.1.3/24IP: 192.168.1.1/24(2)实验过程1)采用配置PC1和PC2的IP地址和子网掩码。2)连接到路由器Router3,配置路由器的RIP,命令如下:RouterenableRouter#conf terminalRouter(config)#hostname R3R3(config)#interface FastEthernet 0/0R3(config-if)#ip address 11.0.0.1 255.255.255.0R3(config-if)#no shutdownR3(config-if)#interface FastEthernet 0/1R3(config-if)#ip address 12.0.0.1 255.255.255.0R3(config-if)#no shutdownR3(config-if)#interface serial 0R3(config-if)#ip address 10.0.0.1 255.255.255.0R3(config-if)#bandwidth 128 /设置链路带宽为128kbit/sR3(config-if)#clock rate 64000 /设置DCE设备的时钟速率R3(config-if)#no shutdownR3(config-if)#exit-设置路由器R3的RIP -R3(config)#router rip /设置RIPR3(config-router)#network 10.0.0.0 /设置接口S0连接的网络地址R3(config-router)#network 11.0.0.0 /设置接口E0连接的网络地址R3(config-router)#network 12.0.0.0 /设置接口E1连接的网络地址R3(config-router)#end4)按照步骤(3)分别完成对路由器R1、R2、R4的接口配置。5)按照步骤(3)分别完成对路由器R1、R2、R4的RIP配置。R1(config)#router rip /设置路由器R1的RIPR1(config-router)#network 11.0.0.0R1(config-router)#end-设置路由器R2的RIP -R2(config)#router rip /设置路由器R2的RIPR2(config-router)#network 12.0.0.0R2(config-router)#end-设置路由器R4的RIP-R4(config)#router rip /设置路由器R4的RIPR4(config-router)#network 10.0.0.0R4(config-router)#network 192.168.1.0R4(config-router)#end6)连接到路由器R1中,通过命令“show ip route”显示R1的动态路由表,观察路由表项,当目标网络是192.168.1.0/24时,需要多少跳数(hops)?通过命令“show ip protocols” 查看每台路由器的协议。需要2跳Router#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - 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 setR 10.0.0.0/8 120/1 via 11.0.0.1, 00:00:21, FastEthernet0/011.0.0.0/24 is subnetted, 1 subnetsC 11.0.0.0 is directly connected, FastEthernet0/0R 12.0.0.0/8 120/1 via 11.0.0.1, 00:00:21, FastEthernet0/0R 192.168.1.0/24 120/2 via 11.0.0.1, 00:00:21, FastEthernet0/0R1协议:Router#show ip protocols Routing Protocol is ripSending updates every 30 seconds, next due in 17 secondsInvalid after 180 seconds, hold down 180, flushed after 240Outgoing update filter list for all interfaces is not setIncoming update filter list for all interfaces is not setRedistributing: ripDefault version control: send version 1, receive any versionInterface Send Recv Triggered RIP Key-chainFastEthernet0/0 1 2 1 Automatic network summarization is in effectMaximum path: 4Routing for Networks:11.0.0.0Passive Interface(s):Routing Information Sources:Gateway Distance Last Update11.0.0.1 120 00:00:18Distance: (default is 120)R2协议:Router#show ip protocols Routing Protocol is ripSending updates every 30 seconds, next due in 0 secondsInvalid after 180 seconds, hold down 180, flushed after 240Outgoing update filter list for all interfaces is not setIncoming update filter list for all interfaces is not setRedistributing: ripDefault version control: send version 1, receive any versionInterface Send Recv Triggered RIP Key-chainFastEthernet0/0 1 2 1 Automatic network summarization is in effectMaximum path: 4Routing for Networks:12.0.0.0Passive Interface(s):Routing Information Sources:Gateway Distance Last Update12.0.0.1 120 00:00:22Distance: (default is 120)R3协议:R3#show ip protocols Routing Protocol is ripSending updates every 30 seconds, next due in 2 secondsInvalid after 180 seconds, hold down 180, flushed after 240Outgoing update filter list for all interfaces is not setIncoming update filter list for all interfaces is not setRedistributing: ripDefault version control: send version 1, receive any versionInterface Send Recv Triggered RIP Key-chainSerial0/0 1 2 1 FastEthernet0/0 1 2 1 FastEthernet0/1 1 2 1 Automatic network summarization is in effectMaximum path: 4Routing for Networks:10.0.0.011.0.0.012.0.0.0Passive Interface(s):Routing Information Sources:Gateway Distance Last Update10.0.0.2 120 00:00:08Distance: (default is 120)R4协议:Router#show ip protocols Routing Protocol is ripSending updates every 30 seconds, next due in 10 secondsInvalid after 180 seconds, hold down 180, flushed after 240Outgoing update filter list for all interfaces is not setIncoming update filter list for all interfaces is not setRedistributing: ripDefault version control: send version 1, receive any versionInterface Send Recv Triggered RIP Key-chainSerial0/0 1 2 1 FastEthernet0/0 1 2 1 Automatic network summarization is in effectMaximum path: 4Routing for Networks:10.0.0.0192.168.1.0Passive Interface(s):Routing Information Sources:Gateway Distance Last Update10.0.0.1 120 00:00:03Distance: (default is 120)Router#7)连接到R2、R3和R4,通过 “show ip route”和“show ip protocols” 命令查看每台路由器的路由表和协议。R2路由表:Router#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - 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 setR 10.0.0.0/8 120/1 via 12.0.0.1, 00:00:04, FastEthernet0/0R 11.0.0.0/8 120/1 via 12.0.0.1, 00:00:04, FastEthernet0/012.0.0.0/24 is subnetted, 1 subnetsC 12.0.0.0 is directly connected, FastEthernet0/0R 192.168.1.0/24 120/2 via 12.0.0.1, 00:00:04, FastEthernet0/0R2协议:Router#show ip protocols Routing Protocol is ripSending updates every 30 seconds, next due in 0 secondsInvalid after 180 seconds, hold down 180, flushed after 240Outgoing update filter list for all interfaces is not setIncoming update filter list for all interfaces is not setRedistributing: ripDefault version control: send version 1, receive any versionInterface Send Recv Triggered RIP Key-chainFastEthernet0/0 1 2 1 Automatic network summarization is in effectMaximum path: 4Routing for Networks:12.0.0.0Passive Interface(s):Routing Information Sources:Gateway Distance Last Update12.0.0.1 120 00:00:22Distance: (default is 120)R3路由表:R3#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - 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 set10.0.0.0/24 is subnetted, 1 subnetsC 10.0.0.0 is directly connected, Serial0/011.0.0.0/24 is subnetted, 1 subnetsC 11.0.0.0 is directly connected, FastEthernet0/012.0.0.0/24 is subnetted, 1 subnetsC 12.0.0.0 is directly connected, FastEthernet0/1R 192.168.1.0/24 120/1 via 10.0.0.2, 00:00:19, Serial0/0R3协议:R3#show ip protocols Routing Protocol is ripSending updates every 30 seconds, next due in 2 secondsInvalid after 180 seconds, hold down 180, flushed after 240Outgoing update filter list for all interfaces is not setIncoming update filter list for all interfaces is not setRedistributing: ripDefault version control: send version 1, receive any versionInterface Send Recv Triggered RIP Key-chainSerial0/0 1 2 1 FastEthernet0/0 1 2 1 FastEthernet0/1 1 2 1 Automatic network summarization is in effectMaximum path: 4Routing for Networks:10.0.0.011.0.0.012.0.0.0Passive Interface(s):Routing Information Sources:Gateway Distance Last Update10.0.0.2 120 00:00:08Distance: (default is 120)R4路由表:Router#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - 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 set10.0.0.0/24 is subnetted, 1 subnetsC 10.0.0.0 is directly connected, Serial0/0R 11.0.0.0/8 120/1 via 10.0.0.1, 00:00:15, Serial0/0R 12.0.0.0/8 120/1 via 10.0.0.1, 00:00:15, Serial0/0C 192.168.1.0/24 is directly connected, FastEthernet0/0R4协议:Router#show ip protocols Routing Protocol is ripSending updates every 30 seconds, next due in 10 secondsInvalid after 180 seconds, hold down 180, flushed after 240Outgoing update filter list for all interfaces is not setIncoming update filter list for all interfaces is not setRedistributing: ripDefault version control: send version 1, receive any versionInterface Send Recv Triggered RIP Key-chainSerial0/0 1 2 1 FastEthernet0/0 1 2 1 Automatic network summarization is in effectMaximum path: 4Routing for Networks:10.0.0.0192.168.1.0Passive Interface(s):Routing Information Sources:Gateway Distance Last Update10.0.0.1 120 00:00:03Distance: (default is 120)Router#8)使用ping命令测试到路由器各接口的连通状态,以检测路由器的配置。使用PC1 PING各路由器的各接口均可通C:ping 11.0.0.2Pinging 11.0.0.2 with 32 bytes of data:Reply from 11.0.0.2: bytes=32 time=31ms TTL=253Reply from 11.0.0.2: bytes=32 time=31ms TTL=253Ping statistics for 11.0.0.2:Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:Minimum = 31ms, Maximum = 31ms, Average = 31msControl-CCC:ping 12.0.0.2Pinging 12.0.0.2 with 32 bytes of data:Reply from 12.0.0.2: bytes=32 time=32ms TTL=253Reply from 12.0.0.2: bytes=32 time=47ms TTL=253Ping statistics for 12.0.0.2:Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:Minimum = 32ms, Maximum = 47ms, Average = 39msControl-CCC:ping 11.0.0.1Pinging 11.0.0.1 with 32 bytes of data:Reply from 11.0.0.1: bytes=32 time=32ms TTL=254Ping statistics for 11.0.0.1:Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:Minimum = 32ms, Maximum = 32ms, Average = 32msControl-CCC:ping 12.0.0.1Pinging 12.0.0.1 with 32 bytes of data:Reply from 12.0.0.1: bytes=32 time=47ms TTL=254Ping statistics for 12.0.0.1:Packets: Sent = 2, Received = 1, Lost = 1 (50% loss),Approximate round trip times in milli-seconds:Minimum = 47ms, Maximum = 47ms, Average = 47msControl-CCC:ping 10.0.0.1Pinging 10.0.0.1 with 32 bytes of data:Reply from 10.0.0.1: bytes=32 time=31ms TTL=254Ping statistics for 10.0.0.1:Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:Minimum = 31ms, Maximum = 31ms, Average = 31msControl-CCC:ping 10.0.0.2Pinging 10.0.0.2 with 32 bytes of data:Reply from 10.0.0.2: bytes=32 time1ms TTL=255Reply from 10.0.0.2: bytes=32 timeping 192.168.1.1Pinging 192.168.1.1 with 32 bytes of data:Reply from 192.168.1.1: bytes=32 time(3)实验小结RIP是一个距离矢量路由协议,非常简单,仅通过源节点与目的节点之间的路由器或路程段的数目(跳数)来决定发送数据包的最佳途径。由于RIP自身的一些限制,其允许的最大跳数为15,只适用于小型的网络。RIP有两种版本:RIPv1和RIPv2。前者不支持VLSM,而后者支持。 2、路由器的OSPF协议配置(1)实验准备工作运用Cisco Packet Tracer软件设计如下网络拓扑图。不同型号的交换机配置命令不同,这里选择2600系列路由器的2621型号,交换机选择2900系列。IP地址、掩码和连接路由器的端口号如图所示。将网络拓扑图保存,并在Cisco Packet Tracer模拟器中打开该图(参考实验4的方法)。f0/0f0/0f0/0f0/1se0/0se0/0f0/0f0/1f0/3f0/2IP: 11.0.0.2/24IP: 11.0.0.1/24IP: 12.0.0.1/24IP: 12.0.0.2/24IP: 10.0.0.1/24IP: 10.0.0.2/24IP: 192.168.1.2/24IP: 192.168.1.3/24IP: 192.168.1.1/24(2)实验过程1)使用上述的网络拓扑图作为本实验所需的网络,配置PC的IP地址和子网掩码。2)连接到路由器Router3,配置路由器的OSPF,命令如下:RouterenableRouter#conf terminalRouter(config)#hostname R3R3(config)#interface FastEthernet 0/0R3(config-if)#ip address 11.0.0.1 255.255.255.0R3(config-if)#no shutdownR3(config-if)#interface FastEthernet 0/1R3(config-if)#ip address 12.0.0.1 255.255.255.0R3(config-if)#no shutdownR3(config-if)#interface serial 0R3(config-if)#ip address 10.0.0.1 255.255.255.0R3(config-if)#bandwidth 128 /设置链路带宽为128kbit/sR3(config-if)#clock rate 64000 /设置DCE设备的时钟速率R3(config-if)#no shutdownR3(config-if)#exit/启动进程号为10的单区域OSPF路由选择进程R3(config)#router ospf 10 /在接口S0启动OSPF,加入区域0R3(config-router)#network 10.0.0.0 0.0.0.255 area 0 /通告直连网络/在接口F0/0启动OSPF,加入区域0R3(config-router)#network 11.0.0.0 0.0.0.255 area 0 /通告直连网络/在接口F0/1启动OSPF,加入区域0R3(config-router)#network 12.0.0.0 0.0.0.255 area 0 /通告直连网络R3(config-router)#exit 4)按照步骤(3)分别完成路由器R1、R2、R4的接口和OSPF配置。/在R1上启动进程号为10的单区域/OSPF路由选择进程R1(config)#router ospf 10 R1(config-router)#network 11.0.0.0 0.0.0.255 area 0 /在R2上启动进程号为10的单区域OSPF路由选择进程 R2(config)#router ospf 10 R2(config-router)#network 12.0.0.0 0.0.0.255 area 0 /在R4上启动进程号为10的单区域OSPF路由选择进程 R4(config)#router ospf 10 R4(config-router)#network 10.0.0.0 0.0.0.255 area 0 R4(config-router)#network 192.168.1.0 0.0.0.255 area 0 5)连接到路由器R1中,通过命令“show ip route”显示R1的动态路由表,观察路由表项,当目标网络是192.168.1.0/24时,度量值为多少?度量值为:110Router#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - 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 set10.0.0.0/24 is subnetted, 1 subnetsO 10.0.0.0 110/65 via 11.0.0.1, 00:01:55, FastEthernet0/011.0.0.0/24 is subnetted, 1 subnetsC 11.0.0.0 is directly connected, FastEthernet0/012.0.0.0/24 is subnetted, 1 subnetsO 12.0.0.0 110/2 via 11.0.0.1, 00:01:55, FastEthernet0/0O 192.168.1.0/24 110/66 via 11.0.0.1, 00:00:23, FastEthernet0/06)连接到R2、R3和R4,查看每台路由器的路由表。R2路由表:Router#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - 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 set10.0.0.0/24 is subnetted, 1 subnetsO 10.0.0.0 110/65 via 12.0.0.1, 00:03:20, FastEthernet0/011.0.0.0/24 is subnetted, 1 subnetsO 11.0.0.0 110/2 via 12.0.0.1, 00:03:20, FastEthernet0/012.0.0.0/24 is subnetted, 1 subnetsC 12.0.0.0 is

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论