小型校园网的设计与组建实验报告一.实验目的计算机网络是一门实践性较强的技术,课堂教学应该和实践环节紧密结合。
计算机网络实验培养学生具有独立进行计算机网络架构和设计能力,提高学生的网络设备使用水平,以及将理论与实践相结合的能力。
二.实验环境及设备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 分配表用途网段网络号子网掩码子网号起始 IP 地址结束 IP 地址总校网1 210.100.10.32 255.255.255.224001210.100.10.33 210.100.10.62路由器间2 210.100.10.64 255.255.255.22401210.100.10.65 210.100.10.94分校网 1 3 210.100.10.96 255.255.255.224011210.100.10.97 210.100.10.126分校网 2 4 210.100.10.128255.255.255.22410210.100.10.129210.100.10.158三、拓扑结构六.实验配置本人做主校交换机和路由器配置主校交换机配置switchA>en 14Password:switchA#configure terminalEnter configuration commands, one per line. End with CNTL/Z. switchA(config)#vlan 30 // 创建 vlanswitchA(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#showvlan // 对 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 UPR2632(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? Statusserial 4/0 no address YES DOWNserial 4/1 no address YES DOWNFastEthernet 3/0.30 210.100.10.33/27 YES DOWNFastEthernet 3/0 no address YES DOWNFastEthernet 3/1 no address YES DOWNNull 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? Statuss erial 4/0 210.100.10.65/27 YES UPserial 4/1 no address YES DOWNFastEthernet 3/0.30 210.100.10.33/27 YES UPFastEthernet 3/0 no address YES DOWNFastEthernet 3/1 no address YES DOWNNull 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.66R2632(config)#endR2632#Configured from console by consoleR2632#show iproute // 对主校路由器配置验证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#configureterminal ! 进入全局配置模式SwitchA(config)#SwitchA(config)#vlan 10SwitchA(config-vlan)#exitSwitchA(config)#vlan 20SwitchA(config-vlan)#exitswitchA(config)#interface range fastEthernet 0/1-10 switchA(config-if-range)#switchport access vlan 10 SwitchA(config-if)#exitSwitchA(config)#interface range fastethernet 0/11-20 SwitchA(config-if-range)#switchaport access vlan 20 SwitchA(config-if)#exitSwitchA(config)#interface fastethernet 0/24SwitchA(config-if)#switchaport mode trunkSwitchA(config-if)#endSwitchA#showvlan // 对 switchA 的配置进行验证VLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 d efault active Fa0/23,Fa0/2410 network2 activ e Fa0/1 ,Fa0/2 ,Fa0/3 ,Fa0/4 Fa0/5 ,Fa0/6 ,Fa0/7 ,Fa0/8 Fa0/9 ,Fa0/10,Fa0/2420 network3 active Fa0/11,Fa0/12,Fa0/13,Fa0/14Fa0/15,Fa0/16,Fa0/17,Fa0/18 Fa0/19,Fa0/20,Fa0/24SwitchA#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 addressR2632(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? Statusserial 4/0 210.100.10.66/27 YES UPserial 4/1 no address YES DOWNF astEthernet 3/0.20 210.100.10.129/27 YES UPF astEthernet 3/0.10 210.100.10.97/27 YES UPFastEthern et 3/0 no address YES DOWNFastEthernet 3/1 no address YES DOWNNull 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.65 R2632(config)#endR2632#Con figured 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.10 C 210.100.10.97/32 is local host.C 210.100.10.128/27 is directly connected, FastEthernet 3/0.20 C 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 )要使总校局域网能够与分校两个局域网通信,如何配置静态路由?分别为分校的两个网段配置静态路由,并且全部经过的连接分校交换机的路由器。