当前位置:文档之家› 计算机网络综合性实验报告

计算机网络综合性实验报告

华南农业大学数学与信息(软件)学院《计算机网络》综合性、设计性实验成绩单开设时间:2015-2016学年第一学期目录一、网络背景 (1)二、网络需求 (1)三、网络规划 (2)四、实验要求 (4)五、路由器配置 (4)六、交换机配置 (9)七、PC配置 (12)八、测试连通 (14)九、实验步骤 (24)十、实验总结 (26)一、网络背景为了适应业务的发展和国际化的需要,积极参与国家信息化进程,提高管理水平,展现全新的形象,某厂准备建立一个现代化的机构内部网,实现信息的共享、协作和通讯,并和属下个部门互连,并在此基础上开发建设现代化的企业应用系统,实现智能型、信息化、快节奏、高效率的管理模式。

二、网络需求1. 从企业对信息的需求来看面对着激烈的市场竞争,公司对信息的收集、传输、存储、查询以及预测决策等工作量越来越大,原来的电脑只是停留在单机工作模式,各科室间的数据不能实现共享,致使工作效率大大下降,纯粹的手工管理方式和手段已不能适应需求,这将严重妨碍公司的生存和发展。

社会进步要求企业必须改变现有的落后管理体系、管理方法和手段,建立现代企业的新形象,建议本企业的自动化管理信息系统,以提高管理水平,增加经济和社会效益。

2. 从企业管理和业务发展的角度出发通过网络对网络资源的共用来改善企业内部和企业与客户之间的信息交流方式。

满足业务部门对信息存储、检索、处理和共享需求,使企业能迅速掌握瞬息万变的市场行情,使企业信息更有效地发挥效力;提高办公自动化水平,提高工作效率,降低管理成本,提高企业在市场上的竞争力;通过对每项业务的跟踪,企业管理者可以了解业务进展情况,掌握第一手资料,以及掌握市场动态,为企业提供投资导向信息,为领导决策者提供数据支持;通过企业内部网建议,企业各业务部门可以有更方便的交流沟通,管理者可随时了解每一位员工的情况,并加强对企业人力资源合理调度,切实做到系统的集成化设计,使原有的设备、资源得到有效利用。

三、网络规划1.拓扑图2.VLAN划分划分两个VLAN其中:(1)VLAN2:PC0,PC2 (2)VLAN3:PC2,PC33.IP基本配置如下表格:四、实验要求1.实验目的(1)掌握路由器、PC的初始配置和基本IP地址配置;(2)理解掌握动态路由协议RIP配置;(3)掌握交换机初始配置VLAN划分Trunk配置;(4)理解掌握封装dot1q协议配置;(5)理解掌握ACL配置;(6)根据需求完成实验拓扑搭建及各项配置,达到对前面所做实验的综合回顾。

2.实验设备两台路由器(型号2621XM)、两台交换机(型号Generic)、四台PC-PT3.实验内容(1)路由器、PC的基本IP地址配置(2)动态路由协议RIP配置(3)交换机VLAN划分及Trunk配置(4)封装dot1q协议配置()ACL配置实现过滤五、路由器配置主要包括路由器的初始配置、接口IP地址配置、动态路由协议RIP配置、封装dot1q协议配置以及ACL配置。

1.路由器初始配置,接口IP地址配置(1)R1:Router>enableRouter#configure terminalRouter(config)#hostname R1R1(config)#no ip domain-lookupR1(config)#line console 0R1(config-line)#no exec-timeoutR1(config-line)#logging synchronous //初始配置interface Serial0/2ip address 10.1.1.1 255.255.255.0 //接口IP地址配置Router>enableRouter#configure terminalRouter(config)#hostname R2R2(config)#no ip domain-lookupR2(config)#line console 0R2(config-line)#no exec-timeoutR2(config-line)#logging synchronous //初始配置inerface Serial0/2ip address 10.1.1.2 255.255.255.0 //接口IP地址配置2.路由器RIP协议配置:(1)R1:R1(config)#router ripR1(config-router)#version 1R1(config-router)#network 10.0.0.0R1(config-router)#network 192.168.1.0R1(config-router)#network 192.168.2.0命令show ip protocols查看RIP信息:R2(config)#router ripR2(config-router)#version 1R2(config-router)#network 10.0.0.0R2(config-router)#network 192.168.3.0R2(config-router)#network 192.168.4.0命令show ip protocols查看RIP信息:3.路由器dot1q协议配置为了让处于VLAN2的PC0与PC2,VLAN3的PC1与PC3,能够访问路由器端口,需要配置相连的端口的子端口,封装dot1q协议。

由此可实现单臂路由,即使PC处于不同的VLAN,也可实现全网通,配置如下:(1)R1:R1(config-if)#int f0/0.1R1(config-subif)#encapsulation dot1q 2 //对应VLAN2R1(config-subif)#ip add 192.168.1.254 255.255.255.0R1(config-subif)#no shutdownR1(config-subif)#int f0/0.2R1(config-subif)#encapsulation dot1q 3 //对应VLAN3 R1(config-subif)#ip add 192.168.2.254 255.255.255.0 R1(config-subif)#no shutdown命令show ip interface brief查看:(2)R2:R2(config-if)#int f0/0.1R2(config-subif)#encapsulation dot1q 2 //对应VLAN2 R2(config-subif)#ip add 192.168.3.254 255.255.255.0 R2(config-subif)#no shutdownR2(config-subif)#int f0/0.2R2(config-subif)#encapsulation dot1q 3 //对应VLAN3 R2(config-subif)#ip add 192.168.4.254 255.255.255.0 R2(config-subif)#no shutdown命令show ip interface brief查看:4.ACL配置为了使PC0仅能ping通PC2,PC1仅能ping通PC3,其余都ping不通。

但因为交换机属于二层设备,路由器属于三层设备,路由器转发时不会携带VLAN 信息,所以需要配置ACL来实现,配置如下:(1)R1:R1(config)#ip access-list extended ext1R1(config-ext-nacl)#deny icmp 192.168.1.0 0.0.0.255 host 192.168.2.1 R1(config-ext-nacl)#deny icmp 192.168.1.0 0.0.0.255 host 192.168.4.1 R1(config-ext-nacl)#deny icmp 192.168.2.0 0.0.0.255 host 192.168.3.1 R1(config-ext-nacl)#permit ip any anyR1(config-ext-nacl)#exitR1(config)#int f0/0.1R1(config-subif)#ip access-group ext1 inR1(config-subif)#int f0/0.2R1(config-subif)#ip access-group ext1 in命令show acc查看ACL信息:(2)R2:R2(config)#ip access-list extended ext1R2(config-ext-nacl)#deny icmp 192.168.3.0 0.0.0.255 host 192.168.4.1 R2(config-ext-nacl)#deny icmp 192.168.3.0 0.0.0.255 host 192.168.2.1 R2(config-ext-nacl)#deny icmp 192.168.4.0 0.0.0.255 host 192.168.1.1 R2(config-ext-nacl)#permit ip any anyR2(config-ext-nacl)#exitR2(config)#int f0/0.1R2(config-subif)#ip access-group ext1 inR2(config-subif)#int f0/0.2R2(config-subif)#ip access-group ext1 in命令show acc查看ACL信息:六、交换机配置主要包括交换机的初始配置、VLAN划分以及Trunk配置。

1.交换机初始配置、接口VANL划分:交换机的初始配置,同路由器初始配置如重命名,关闭域名查找,设置会话时间等;交换机接口VLAN划分:将PC0与PC2划分至VLAN2,PC1与PC3划分至VLAN3,配置如下:(1)S1:Switch>enable//初始配置Switch#configure terminalSwitch(config)#hostname S1S1(config)#no ip domain-lookupS1(config)#line console 0S1(config-line)#no exec-timeoutS1(config-line)#logging synchronousS1(config)#vlan 2//接口VLAN划分S1(config-vlan)#name vlan2S1(config-vlan)#vlan 3S1(config-vlan)#name vlan3S1(config-vlan)#int f1/1S1(config-if)#switchport mode accessS1(config-if)#switchport access vlan 2 //Fa1/1接口划分到VLAN2S1(config-vlan)#int f2/1S1(config-if)#switchport mode accessS1(config-if)#switchport access vlan 3 //Fa2/1接口划分到VLAN3S1(config-if)#exit命令show vlan查看VLAN信息:(2)S2:Switch>enable//初始配置Switch#configure terminalSwitch(config)#hostname S2S2(config)#no ip domain-lookupS2(config)#line console 0S2(config-line)#no exec-timeoutS2(config-line)#logging synchronousS2(config)#vlan 2//接口VLAN划分S2(config-vlan)#name vlan2S2(config-vlan)#vlan 3S2(config-vlan)#name vlan3S2(config-vlan)#int f1/1S2(config-if)#switchport mode accessS2(config-if)#switchport access vlan 2 //Fa1/1接口划分到VLAN2 S2(config-vlan)#int f2/1S2(config-if)#switchport mode accessS2(config-if)#switchport access vlan 3 //Fa2/1接口划分到VLAN3 S2(config-if)#exit命令show vlan查看VLAN信息:2.交换机Trunk配置当一个VLAN 跨过不同的交换机时,在同一VLAN 上但是却是在不同的交换机上的计算机进行通信时需要使用Trunk,配置如下:(1)S1:S1(config)#int f0/1S1(config-if)#switchport mode trunkS1(config-if)#switchport trunk encanpsulation dot1q(2)S2:S2(config)#int f0/1S2(config-if)#switchport mode trunkS2(config-if)#switchport trunk encanpsulation dot1q七、PC配置进入PC配置窗口,选中IP Configuration为PC配置IP地址,其中默认网关为直连路由器端口IP地址:(1)PC0:(2)PC1:(3)PC2:(4)PC3:八、实验步骤1.搭建实验拓扑:使用 Cisco Packet Tracer模拟器搭建实验拓扑如下图所示:2.路由器接口IP地址配置(1)R1:Router>enableRouter#configure terminalRouter(config)#hostname R1R1(config)#no ip domain-lookupR1(config)#line console 0R1(config-line)#no exec-timeoutR1(config-line)#logging synchronous //初始配置interface Serial0/2ip address 10.1.1.1 255.255.255.0 //接口IP地址配置(2)R2:Router>enableRouter#configure terminalRouter(config)#hostname R2R2(config)#no ip domain-lookupR2(config)#line console 0R2(config-line)#no exec-timeoutR2(config-line)#logging synchronous //初始配置inerface Serial0/2ip address 10.1.1.2 255.255.255.0 //接口IP地址配置3.PC的IP地址配置进入PC配置窗口,选中IP Configuration为PC配置IP地址,其中默认网关为直连路由器端口IP地址:PC0:PC1:PC2:PC3:4.路由器RIP配置:(1)R1:R1(config)#router ripR1(config-router)#version 1R1(config-router)#network 10.0.0.0 R1(config-router)#network 192.168.1.0 R1(config-router)#network 192.168.2.0命令show ip protocols查看RIP信息:(2)R2:R2(config)#router ripR2(config-router)#version 1R2(config-router)#network 10.0.0.0R2(config-router)#network 192.168.3.0R2(config-router)#network 192.168.4.0命令show ip protocols查看RIP信息:5.交换机初始配置、接口VANL划分:交换机的初始配置,同路由器初始配置如重命名,关闭域名查找,设置会话时间等;交换机接口VLAN划分:将PC0与PC2划分至VLAN2,PC1与PC3划分至VLAN3,配置如下:(1)S1:Switch>enable //初始配置Switch#configure terminalSwitch(config)#hostname S1S1(config)#no ip domain-lookupS1(config)#line console 0S1(config-line)#no exec-timeoutS1(config-line)#logging synchronousS1(config)#vlan 2 //接口VLAN划分S1(config-vlan)#name vlan2S1(config-vlan)#vlan 3S1(config-vlan)#name vlan3S1(config-vlan)#int f1/1S1(config-if)#switchport mode accessS1(config-if)#switchport access vlan 2 //Fa1/1接口划分到VLAN2 S1(config-vlan)#int f2/1S1(config-if)#switchport mode accessS1(config-if)#switchport access vlan 3 //Fa2/1接口划分到VLAN3S1(config-if)#exit命令show vlan查看VLAN信息:(2)S2:Switch>enable //初始配置Switch#configure terminalSwitch(config)#hostname S2S2(config)#no ip domain-lookupS2(config)#line console 0S2(config-line)#no exec-timeoutS2(config-line)#logging synchronousS2(config)#vlan 2 //接口VLAN划分S2(config-vlan)#name vlan2S2(config-vlan)#vlan 3S2(config-vlan)#name vlan3S2(config-vlan)#int f1/1S2(config-if)#switchport mode accessS2(config-if)#switchport access vlan 2 //Fa1/1接口划分到VLAN2S2(config-vlan)#int f2/1S2(config-if)#switchport mode accessS2(config-if)#switchport access vlan 3 //Fa2/1接口划分到VLAN3S2(config-if)#exit命令show vlan查看VLAN信息:6.交换机Trunk配置当一个VLAN 跨过不同的交换机时,在同一VLAN 上但是却是在不同的交换机上的计算机进行通信时需要使用Trunk,配置如下:(1)S1:S1(config)#int f0/1S1(config-if)#switchport mode trunkS1(config-if)#switchport trunk encanpsulation dot1q(2)S2:S2(config)#int f0/1S2(config-if)#switchport mode trunkS2(config-if)#switchport trunk encanpsulation dot1q7.封装dot1q协议配置为了让处于VLAN2的PC0与PC2,VLAN3的PC1与PC3,能够访问路由器端口,需要配置相连的端口的子端口,封装dot1q协议。

相关主题