当前位置:文档之家› 计算机网络动态路由

计算机网络动态路由

华南农业大学实验报告实验项目名称:动态路由实验实验项目性质:计划学时:8所属课程名称:计算机网络开设时间: 2013学年第2学期授课学生:11软件工程 4-7 班授课人数:120人实验课指导教师:所在班级:软件R1姓名:邝倍浩学号: 201131000414动态路由实验一、实验目的(1)理解路由器的工作原理。

(2)理解路由协议的分类,掌握动态路由的配置方法。

(3)掌握查看路由器的路由表信息的方法。

(4)提高在实体机器上的操作能力。

(5)通过本实验固课堂所学,全面熟悉、掌握计算机网络的基本原理和技术,进一步提高网络工程、网络应用的能力。

二、实验设备3个路由器,2台PC机。

三、实验内容和要求1.请按下面的网络图作出网络规划。

并写出路由器的端口地址和各节点网络地址。

2.通过配置动态路由,尝试主机通过路由器连接,并且接通。

四、实验步骤1.按题目要求得到实验拓扑图:2.配置过程(1)首先基本的接口IP地址配置,以及测试直连连通性(2)如同静态路由实验的情况一样,PC0要ping通PC1,则数据包去到路由器上时会查看路由表,在没配静态路由的情况下,路由器上是没有目的网段的路由,数据包会在路由器上丢包,为解决这一问题,可以用动态路由协议RIPR1(config)#router ripR1(config-router)#version 1R1(config-router)#network 10.0.0.0R1(config-router)#network 192.168.12.0查看:版本1R1#show ip protocolsRouting Protocol is "rip"Sending 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 1Interface Send Recv Triggered RIP Key-chainFastEthernet0/1 1 1FastEthernet0/0 1 1Automatic network summarization is in effectMaximum path: 4Routing for Networks:10.0.0.0192.168.12.0Passive Interface(s):Routing Information Sources:Gateway Distance Last UpdateDistance: (default is 120)R1#sh 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 set10.0.0.0/24 is subnetted, 1 subnetsC 10.1.1.0 is directly connected, FastEthernet0/1R 20.0.0.0/8 [120/2] via 192.168.12.2, 00:00:10, FastEthernet0/0R 172.16.0.0/16 [120/1] via 192.168.12.2, 00:00:10, FastEthernet0/0C 192.168.12.0/24 is directly connected, FastEthernet0/0可以发现路由器上已经学习到目标网段的路由,同样的情况也会在R2和R3上发现。

版本2R1#show ip protocolsRouting 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 setRedistributing: ripDefault version control: send version 2, receive 2Interface Send Recv Triggered RIP Key-chainFastEthernet0/1 2 2FastEthernet0/0 2 2Automatic network summarization is in effectMaximum path: 4Routing for Networks:10.0.0.0192.168.12.0Passive Interface(s):Routing Information Sources:Gateway Distance Last UpdateDistance: (default is 120)路由表也版本1一样可以通过查看R1、R2、R3上的路由表是否都有目标网段的地址,如果都有则实验成功,成功后:OSPF实验与RIP基本一致,不同在于使用的路由协议不一样而已R1(config)#router ospf 1R1(config-router)#router-id 1.1.1.1(给该进程一个RID,自己取一个IPV4的地址,每台路由器要不一样的RID)R1(config-router)#network 10.1.1.0 0.0.0.255 area 0(宣告网段,路由表上是多少位子网,宣告时就要宣告多少位,如10.1.1.0网段是24位,network宣告就是10.1.1.0;而后面是反掩码,简单理解就是掩码反过来,即24位掩码是255.255.255.0,反过来就是0.0.0.255;再后面是区域号,因为OSPF是分区域的,所以一定要有区域号,一般简单实验只需用一个区域0即可)R1(config-router)#network 192.168.12.0 0.0.0.255 area 0OSPF邻居建立起来时会看到:00:46:45: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on FastEthernet0/0 from LOADING to FULL,Loading Done可通过查看命令:R1#show ip ospf neighborNeighbor ID Pri State Dead Time Address Interface2.2.2.2 1 FULL/BDR 00:00:33 192.168.12.2 FastEthernet0/0 Full即OSPF建立起来查看路由表: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 set10.0.0.0/24 is subnetted, 1 subnetsC 10.1.1.0 is directly connected, FastEthernet0/120.0.0.0/24 is subnetted, 1 subnetsO 20.1.1.0 [110/3] via 192.168.12.2, 00:02:00, FastEthernet0/0172.16.0.0/24 is subnetted, 1 subnetsO 172.16.23.0 [110/2] via 192.168.12.2, 00:03:08, FastEthernet0/0C 192.168.12.0/24 is directly connected, FastEthernet0/0查看路由表发现目标网段路由已经在路由表上,同样情况也会在R2和R3上,则实验成功五、实验总结在本次试验中运用RIP协议与OSPF协议相关知识对路由器进行配置,这个试验的内容相对比较少也相对比较简单,所以在实验中并未出现太大的问题,通过这次试验了解到了更多的路由器的协议及配置命令。

认识了网络ip地址的划分,对网络号、主机号、掩码、网关和是否处于同一网段等概念有更加深刻的理解。

相关主题