海南大学信息科学技术学院实验报告实验课程:计算机网络实验名称:动态路由协议RIP与OSPF的配置学号:20151681310139 姓名:李新宇班级:电子信息类05班一、实验目的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 课内实验任务(2)实验过程0)创建拓扑图评定成绩指导教师1)采用配置PC1和PC2的IP地址和子网掩码。
2)连接到路由器Router3,配置路由器的RIP,命令如下:Router>enableRouter#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)#endR3(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)#endR3#%SYS-5-CONFIG_I: Configured from console by console4)按照步骤(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)#endR1(config)#router rip //设置路由器R1的RIPR1(config-router)#network 11.0.0.0R1(config-router)#endR1#%SYS-5-CONFIG_I: Configured from console by console------------设置路由器R2的RIP ---------------------------------------R2(config)#router rip //设置路由器R2的RIPR2(config-router)#network 12.0.0.0R2(config-router)#endR2(config)#router rip //设置R2的RIPR2(config-router)#network 12.0.0.0R2(config-router)#endR2#%SYS-5-CONFIG_I: Configured from console by console------------设置路由器R4的RIP---------------------------------------R4(config)#router rip //设置路由器R4的RIPR4(config-router)#network 10.0.0.0R4(config-router)#network 192.168.1.0R4(config-router)#endR4(config)#rout 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”查看每台路由器的协议。
R1>show ip routeCodes: 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:20, 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:20, FastEthernet0/0R 192.168.1.0/24 [120/2] via 11.0.0.1, 00:00:20, FastEthernet0/0答;有路由表可知,到达192.168.1.0需要两跳。
显示协议如下R1>show ip protocolRouting Protocol is "rip"//协议是RIP协议Sending updates every 30 seconds, next due in 13 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 1Automatic 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:19Distance: (default is 120)7)连接到R2、R3和R4,通过“show ip route”和“show ip protocols”命令查看每台路由器的路由表和协议。
R2: R2的路由表:R2>show ip routeCodes: 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:19, FastEthernet0/0R 11.0.0.0/8 [120/1] via 12.0.0.1, 00:00:19, 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:19, FastEthernet0/0R2所用协议:R2>show ip protocolsRouting Protocol is "rip"Sending updates every 30 seconds, next due in 11 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 set Redistributing: ripDefault version control: send version 1, receive any versionInterface Send Recv Triggered RIP Key-chainFastEthernet0/0 1 2 1Automatic 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:25Distance: (default is 120)R3:R3路由表:R3>show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - 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:09, Serial0/0R3协议:R3>show ip protocolRouting Protocol is "rip"Sending updates every 30 seconds, next due in 12 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 set Redistributing: ripDefault version control: send version 1, receive any versionInterface Send Recv Triggered RIP Key-chainSerial0/0 1 2 1FastEthernet0/0 1 2 1FastEthernet0/1 1 2 1Automatic 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:14Distance: (default is 120)R4:R4路由表:R4>show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - 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:03, Serial0/0R 12.0.0.0/8 [120/1] via 10.0.0.1, 00:00:03, Serial0/0C 192.168.1.0/24 is directly connected, FastEthernet0/0R4协议:R4>show ip protocolsRouting Protocol is "rip"Sending updates every 30 seconds, next due in 1 seconds Invalid after 180 seconds, hold down 180, flushed after 240 Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Redistributing: ripDefault version control: send version 1, receive any version Interface Send Recv Triggered RIP Key-chainSerial0/0 1 2 1FastEthernet0/0 1 2 1Automatic 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:24Distance: (default is 120)8)使用ping命令测试到路由器各接口的连通状态,以检测路由器的配置。