基于Packettracer组建校园网-------实验指导书一、IP地址划分根据学校的部门数量划分,将学校分为以下几个VLAN:VLAN号VLAN名称IP网段默认网关说明交换机对应端口VLAN2Servers192.10.1.0/24192.10.1.2服务器群VLANFa0/2VLAN3teacher192.10.2.0/24192.10.2.2教师宿舍VLANFa0/3VLAN4student192.10.3.0/24192.10.3.2学生宿舍VLANFa0/4VLAN5laboratory192.10.4.0/24192.10.4.2实验室VLANFa0/5VLAN6teaching192.10.7.0/24192.10.7.2教学楼VLANFa0/6VLAN7library192.10.8.0/24192.10.8.2图书馆VLANFa0/7二、拓扑图1三、配置1.交换机配置核心交换机为Cisco3560,将其配置为vtpServer,vtpdomain为senya。将图书馆、教学楼和实验楼等交换机配置为vtpClient,vtpdomain为senya。这里以“中心交换机”和“服务器汇聚”交换机为例,讲解交换机的配置,其他交换机的配置可以参考“服务器汇聚”交换机。第一步:中心交换机配置VTPServerSwitch>enSwitch#Switch#vlandatabaseSwitch(vlan)#vtpdomainsenyaSwitch(vlan)#vtpserverSwitch(vlan)#exitSwitch#conftSwitch(config)#intfa0/1Switch(config-if)#switchporttrunkencapsulationdot1qSwitch(config-if)#switchportmodetrunkSwitch(config-if)#intfa0/2Switch(config-if)#switchporttrunkencapsulationdot1qSwitch(config-if)#switchportmodetrunk2Switch(config-if)#intfa0/3Switch(config-if)#switchporttrunkencapsulationdot1qSwitch(config-if)#switchportmodetrunkSwitch(config-if)#intfa0/4Switch(config-if)#switchporttrunkencapsulationdot1qSwitch(config-if)#switchportmodetrunkSwitch(config-if)#intfa0/5Switch(config-if)#switchporttrunkencapsulationdot1qSwitch(config-if)#switchportmodetrunkSwitch(config-if)#intfa0/6Switch(config-if)#switchporttrunkencapsulationdot1qSwitch(config-if)#switchportmodetrunkSwitch(config-if)#intfa0/7Switch(config-if)#switchporttrunkencapsulationdot1qSwitch(config-if)#switchportmodetrunkSwitch(config-if)#intfa0/8Switch(config-if)#switchporttrunkencapsulationdot1qSwitch(config-if)#switchportmodetrunkSwitch(config-if)#注意:此处端口要处于开启状态第二步:配置“服务器汇聚”交换机trunk链路,允许vlan标记的以太网帧通过该链路Switch>enSwitch#conftSwitch(config)#vtpdomainsenyaSwitch(config)#vtpmodeclientSwitch(config)#intfa0/1Switch(config-if)#switchportmodetrunkSwitch(config-if)#第三步:“中心交换机”创建vlan及端口划分一种方式:直接在VLAN库中添加:另外一种方式是采用命令行添加:直接在VLAN库中添加:Switch>en3Switch#vlandatabaseSwitch(vlan)#vlan1Switch(vlan)#vlan2Switch(vlan)#vlan3Switch(vlan)#vlan4Switch(vlan)#vlan5Switch(vlan)#vlan6Switch(vlan)#vlan7Switch(vlan)#vlan8VLAN8added:Name:VLAN0008Switch(vlan)#exitSwitch#showvlanVLANNameStatusPorts----------------------------------------------------------------------------1defaultactiveFa0/8,Fa0/9,Fa0/10,Fa0/11Fa0/12,Fa0/13,Fa0/14,Fa0/15Fa0/16,Fa0/17,Fa0/18,Fa0/19Fa0/20,Fa0/21,Fa0/22,Fa0/23Fa0/24,Gig0/1,Gig0/22serversactive3teacheractive4studentactive5laboratoryactive6theachingactive7libraryactive8VLAN0008active1002fddi-defaultact/unsup1003token-ring-defaultact/unsup1004fddinet-defaultact/unsup1005trnet-defaultact/unsup第四步:在“服务器汇聚“交换机上查看vlanSwitch#showvlanVLANNameStatusPorts----------------------------------------------------------------------------1defaultactiveFa0/2,Fa0/3,Fa0/4,Fa0/5Fa0/6,Fa0/7,Fa0/8,Fa0/9Fa0/10,Fa0/11,Fa0/12,Fa0/13Fa0/14,Fa0/15,Fa0/16,Fa0/17Fa0/18,Fa0/19,Fa0/20,Fa0/21Fa0/22,Fa0/23,Fa0/24,Gig1/1Gig1/22serversactive43teacheractive4studentactive5laboratoryactive6theachingactive7libraryactive8VLAN0008active1002fddi-defaultact/unsup1003token-ring-d...