小型校园网的设计与组建实验报告一.实验目的计算机网络是一门实践性较强的技术,课堂教学应该和实践环节紧密结合。
计算机网络实验培养学生具有独立进行计算机网络架构和设计能力,提高学生的网络设备使用水平,以及将理论与实践相结合的能力。
二.实验环境及设备2台路由器、2台交换机、3台PC机三.实验的内容和要求根据要求,设计并搭建一个校园网。
要求进行子网划分和结构设计,并将网络结构建立起来。
最后完成网络设备的调试。
四.实验说明某大学分为总校和分校,为该校设计校园网,总校有一个局域网共20台计算机,分校由VLAN划分为两个局域网,分别有10台计算机。
该校被分配了一个C类网段210.100.10.0,总校和分校各有一台路由器及一台交换机。
请进行网络设计,将总校和分校各个局域网连接起来。
根据要求,设计IP地址分配表,设计网络结构,画出网络拓扑图。
根据设计搭建网络结构。
配置网络设备,完成网络调试。
提示:1)使用IP子网掩码的原理设计IP地址分配表。
2)用到的设备为两台路由器,以及两台交换机。
五.实验设计一、设计思路总校局域网20台计算机,分校2个局域网各有10台计算机,若要满足要求,则至少需要5位主机位,即大小为2^5=32台主机的局域网。
由于是C类网段,最后8计算机ID码5位用作主机号,还有3位可以用作子网号,即可以划分2^3-2=6个子网(000和111不可用作子网号),因此子网掩码为255.255.255.224(1111 1111.1111 1111.1111 1111.1110 0000)。
而总校、分校各个局域网只需从6个子网中任选其一并且不重复即可。
由此可以设计IP分配表如下二、IP分配表三、拓扑结构六.实验配置本人做主校交换机和路由器配置主校交换机配置switchA>en 14Password:switchA#configure terminalEnter configuration commands, one per line. End with CNTL/Z. switchA(config)#vlan 30 //创建vlan switchA(config-vlan)#exitswitchA(config)#exitswitchA#configureEnter configuration commands, one per line. End with CNTL/Z.switchA(config)#interface range fastEthernet 0/1-20 //将1-20端口划入vlan30中switchA(config-if-range)#switchport access vlan 30switchA(config-if-range)#exitSwitch (config)# interface fastethernet 0/24Switch (config-if)# switchport mode trunk !配置trunk端口Switch (config-if)# endswitchA(config)#exitswitchA#show vlan //对switchA的配置进行验证VLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Fa0/21,Fa0/22,Fa0/23,Fa0/24, 30 VLAN0030 active Fa0/1 ,Fa0/2 ,Fa0/3 ,Fa0/4Fa0/5 ,Fa0/6 ,Fa0/7 ,Fa0/8Fa0/9 ,Fa0/10,Fa0/11,Fa0/12Fa0/13,Fa0/14,Fa0/15,Fa0/16Fa0/17,Fa0/18,Fa0/19,Fa0/20Fa0/24switchA#Press RETURN to get started!主校路由器配置R2632>en 14Password:R2632#configure terminalEnter configuration commands, one per line. End with CNTL/Z.R2632(config)#show ip interface brief //查看路由器的端口Interface IP-Address(Pri) OK? Statusserial 4/0 no address YES DOWNserial 4/1 no address YES DOWNFastEthernet 3/0 no address YES DOWNFastEthernet 3/1 no address YES DOWNNull 0 no address YES UP R2632(config)#interface fastEthernet 3/0.30R2632(config-subif)#encapsulation dot1Q 30R2632(config-subif)#ip address 210.100.10.33 255.255.255.224R2632(config-subif)#exitR2632(config)#show ip interface briefInterface IP-Address(Pri) OK? Status serial 4/0 no address YES DOWN serial 4/1 no address YES DOWN FastEthernet 3/0.30 210.100.10.33/27 YES DOWN FastEthernet 3/0 no address YES DOWN FastEthernet 3/1 no address YES DOWN Null 0 no address YES UPR2632(config)#exitR2632#Configured from console by consoleR2632#conEnter configuration commands, one per line. End with CNTL/Z.R2632(config)#interface serial 4/0R2632(config-if)#ip adR2632(config-if)#ip address 210.100.10.65 255.255.255.224 //设置交换机ip地址和子网掩码R2632(config-if)#no shutdownR2632(config-if)#endR2632#Configured from console by consoleR2632#show ip interface briefInterface IP-Address(Pri) OK? Status serial 4/0 210.100.10.65/27 YES UP serial 4/1 no address YES DOWN FastEthernet 3/0.30 210.100.10.33/27 YES UP FastEthernet 3/0 no address YES DOWN FastEthernet 3/1 no address YES DOWN Null 0 no address YES UPR2632#conEnter configuration commands, one per line. End with CNTL/Z.R2632(config)#ip route 210.100.10.96 255.255.255.224 210.100.10.66 //写入静态路由表R2632(config)#ip route 210.100.10.128 255.255.255.224 210.100.10.66 R2632(config)#endR2632#Configured from console by consoleR2632#show ip route //对主校路由器配置验证Codes: C - connected, S - static, R - RIPO - 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* - candidate defaultGateway of last resort is no setC 210.100.10.32/27 is directly connected, FastEthernet 3/0.30C 210.100.10.33/32 is local host.C 210.100.10.64/27 is directly connected, serial 4/0C 210.100.10.65/32 is local host.S 210.100.10.96/27 [1/0] via 210.100.10.66S 210.100.10.128/27 [1/0] via 210.100.10.66R2632#分校的交换机和路由器配置由小组另一成员完成分校交换机配置SwitchA>enable 14Password:Switcha#configure terminal !进入全局配置模式SwitchA(config)#SwitchA(config)#vlan 10SwitchA(config-vlan)#exitSwitchA(config)#vlan 20SwitchA(config-vlan)#exitswitchA(config)#interface range fastEthernet 0/1-10switchA(config-if-range)#switchport access vlan 10SwitchA(config-if)#exitSwitchA(config)#interface range fastethernet 0/11-20SwitchA(config-if-range)#switchaport access vlan 20SwitchA(config-if)#exitSwitchA(config)#interface fastethernet 0/24SwitchA(config-if)#switchaport mode trunkSwitchA(config-if)#endSwitchA#show vlan //对switchA的配置进行验证VLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Fa0/23,Fa0/2410 network2 active Fa0/1 ,Fa0/2 ,Fa0/3 ,Fa0/4Fa0/5 ,Fa0/6 ,Fa0/7 ,Fa0/8Fa0/9 ,Fa0/10,Fa0/2420 network3 active Fa0/11,Fa0/12,Fa0/13,Fa0/14Fa0/15,Fa0/16,Fa0/17,Fa0/18Fa0/19,Fa0/20,Fa0/24 SwitchA#Press RETURN to get started!分校路由器配置R2632>en 14Password:R2632#conEnter configuration commands, one per line. End with CNTL/Z.R2632#conEnter configuration commands, one per line. End with CNTL/Z.R2632(config)#interface serial 4/0R2632(config-if)#ip address 210.100.10.66 255.255.255.224R2632(config-if)#clock rate 64000R2632(config-if)#no shutdownR2632(config-if)#exitR2632(config)#interface fastEthernet 3/0R2632(config-if)#no ip addressR2632(config-if)#no shutdownR2632(config-if)#exitR2632(config)#interface fastEthernet 3/0.10R2632(config-subif)#no ip address.. R2632(config-subif)#exitR2632(config)#interface fastEthernet 3/0.10R2632(config-subif)#encapsulation dot1Q 10R2632(config-subif)#ip address 210.100.10.97 255.255.255.224R2632(config-subif)#exitR2632(config)#interface fastEthernet 3/0.20R2632(config-subif)#encapsulation dot1Q 20R2632(config-subif)#ip address 210.100.10.129 255.255.255.224R2632(config-subif)#endR2632#Configured from console by consoleR2632#show ip interface brief //对分校路由器配置验证Interface IP-Address(Pri) OK? Status serial 4/0 210.100.10.66/27 YES UP serial 4/1 no address YES DOWN FastEthernet 3/0.20 210.100.10.129/27 YES UP FastEthernet 3/0.10 210.100.10.97/27 YES UP FastEthernet 3/0 no address YES DOWN FastEthernet 3/1 no address YES DOWN Null 0 no address YES UPR2632#conEnter configuration commands, one per line. End with CNTL/Z.R2632(config)#ip route 210.100.10.32 255.255.255.224 210.100.10.65R2632(config)#endR2632#Configured from console by consoleR2632#show ip routeCodes: C - connected, S - static, R - RIPO - 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* - candidate defaultGateway of last resort is no setS 210.100.10.32/27 [1/0] via 210.100.10.65C 210.100.10.64/27 is directly connected, serial 4/0C 210.100.10.66/32 is local host.C 210.100.10.96/27 is directly connected, FastEthernet 3/0.10C 210.100.10.97/32 is local host.C 210.100.10.128/27 is directly connected, FastEthernet 3/0.20C 210.100.10.129/32 is local host. R2632#R2632 CON0 is now availablePress RETURN to get started七.实验测试分校之间的通信:pc2 与pc3之间通信pc3Pc2主校与分校的通信:pc1与pc3之间通信pc1pc3:八.思考题1)要使总校局域网能够与分校两个局域网通信,如何配置静态路由?分别为分校的两个网段配置静态路由,并且全部经过的连接分校交换机的路由器。