实验名称 交换VLAN划分实验 实验室 419 实验日期 2014.3.19 一、实验目的及要求 1、了解VLAN原理; 2、熟练掌握二层交换机VLAN的划分方法; 3、了解如何验证VLAN的划分。 二、实验环境 学校实验楼中有两个实验室位于同一楼层,一个是计算机软件实验室,一个是多媒体实验室,两个实验室的信息端口都连接在一台交换机上。学校已经为实验楼分配了固定的IP地址段,为了保证两个实验室的相对,就需要划分对应的VLAN,使交换机某些端口属于软件实验室,某些端口属于多媒体实验室,这样就能保证它们之间的数据互不干扰,也不影响各自的通信效率。 1、DCS-3926S交换机1台 2、PC机2台 3、Console线1根 4、直通网线2根 三、实验拓扑 使用一台交换机和两台PC机,还将其中PC1作为控制台终端,使用Console口配置方式;使用两根网线分别将PC1和PC2连接到交换机的RJ-45接口上。 四、实验内容 在交换机上划分两个基于端口的VLAN:VLAN100,VLAN200。 VLAN 端口成员 100 1~8 200 9~16
使得VLAN100的成员能够互相访问,VLAN200的成员能够互相访问;VLAN100和VLAN200成员之间不能互相访问。 PC1和PC2的网络设置为: 设备 IP地址 Mask 交换机A 192.168.1.11 255.255.255.0 PC1 192.168.1.101 255.255.255.0 PC2 192.168.1.102 255.255.255.0 PC1、PC2接在VLAN100的成员端口1~8上,两台PC互相可以ping通;PC1、PC2接在VLAN的成员端口9~16上,两台PC互相可以ping通;PC1接在VLAN100的成员端口1~8上,PC2接在VLAN200的成员端口9~16上,则互相ping不通。 若实验结果和理论相符,则本实验完成。 五、实验步骤 第一步:交换机恢复出厂设置 switch#set default switch#write switch#reload 第二步:给交换机设置IP地址即管理IP。 switch#config switch(Config)#interface vlan 1 switch(Config-If-Vlan1)#ip address 192.168.1.11 255.255.255.0 switch(Config-If-Vlan1)#no shutdown switch(Config-If-Vlan1)#exit switch(Config)#exit 第三步:创建vlan100和vlan200。 switch(Config)# switch(Config)#vlan 100 switch(Config-Vlan100)#exit switch(Config)#vlan 200 switch(Config-Vlan200)#exit switch(Config)# 验证配置: switch#show vlan VLAN Name Type Media Ports ---- ------------ ---------- --------- ---------------------------------------- 1 default Static ENET Ethernet0/0/1 Ethernet0/0/2 Ethernet0/0/3 Ethernet0/0/4 Ethernet0/0/5 Ethernet0/0/6 Ethernet0/0/7 Ethernet0/0/8 Ethernet0/0/9 Ethernet0/0/10 Ethernet0/0/11 Ethernet0/0/12 Ethernet0/0/13 Ethernet0/0/14 Ethernet0/0/15 Ethernet0/0/16 Ethernet0/0/17 Ethernet0/0/18
Ethernet0/0/19 Ethernet0/0/20 Ethernet0/0/21 Ethernet0/0/22 Ethernet0/0/23 Ethernet0/0/24 100 VLAN0100 Static ENET !已经创建了vlan100,vlan100中没有端口; 200 VLAN0200 Static ENET !已经创建了vlan200,vlan200中没有端口; 第四步:给vlan100和vlan200添加端口。 switch(Config)#vlan 100 !进入vlan 100 switch(Config-Vlan100)#switchport interface ethernet 0/0/1-8 !给vlan100加入端口1-8 Set the port Ethernet0/0/1 access vlan 100 successfully Set the port Ethernet0/0/2 access vlan 100 successfully Set the port Ethernet0/0/3 access vlan 100 successfully Set the port Ethernet0/0/4 access vlan 100 successfully Set the port Ethernet0/0/5 access vlan 100 successfully Set the port Ethernet0/0/6 access vlan 100 successfully Set the port Ethernet0/0/7 access vlan 100 successfully Set the port Ethernet0/0/8 access vlan 100 successfully switch(Config-Vlan100)#exit switch(Config)#vlan 200 !进入vlan 200 switch(Config-Vlan200)#switchport interface ethernet 0/0/9-16 !给vlan200加入端口9-16 Set the port Ethernet0/0/9 access vlan 200 successfully Set the port Ethernet0/0/10 access vlan 200 successfully Set the port Ethernet0/0/11 access vlan 200 successfully Set the port Ethernet0/0/12 access vlan 200 successfully Set the port Ethernet0/0/13 access vlan 200 successfully Set the port Ethernet0/0/14 access vlan 200 successfully Set the port Ethernet0/0/15 access vlan 200 successfully Set the port Ethernet0/0/16 access vlan 200 successfully switch(Config-Vlan200)#exit 验证配置: switch#show vlan VLAN Name Type Media Ports ---- ------------ ---------- --------- ---------------------------------------- 1 default Static ENET Ethernet0/0/17 Ethernet0/0/18 Ethernet0/0/19 Ethernet0/0/20 Ethernet0/0/21 Ethernet0/0/22 Ethernet0/0/23 Ethernet0/0/24 100 VLAN0100 Static ENET Ethernet0/0/1 Ethernet0/0/2 Ethernet0/0/3 Ethernet0/0/4 Ethernet0/0/5 Ethernet0/0/6 Ethernet0/0/7 Ethernet0/0/8 200 VLAN0200 Static ENET Ethernet0/0/9 Ethernet0/0/10
Ethernet0/0/11 Ethernet0/0/12 Ethernet0/0/13 Ethernet0/0/14 Ethernet0/0/15 Ethernet0/0/16 第五步:验证实验。 PC1位置 PC2位置 动作 结果 1-8端口 PC1 ping 192.168.1.11 不通 9-16端口 PC1 ping 192.168.1.11 不通 1-8端口 1-8端口 PC1 ping PC2 通 1-8端口 9-16端口 PC1 ping PC2 不通 六、调试过程及实验结果 1.交换机恢复出厂设置 (1)要通过命令行对交换机进行配置,必须进入特权模式:用en命令进入特权模式 ; (2)进入特权模式后,通过Config命令进入全局配置模式:可以对交换机的名称,密码等进行配置; 2.给交换机设置IP地址 3.创建VLAN100和VLAN200同时添加端口:
Show VLAN: 4.给VLAN100和VLAN200添加地址:
5.实验结果: Ping通 Ping不通: 七、总结 (1)默认情况下,交换机所有端口都VLAN 1,通常把VLAN 1作为管理VLAN,用户不能配置和删除VLAN 1,因此VLAN 1接口的IP地址就是交换机的管理地址; (2)Port VLAN是实现VLAN的方式之一,Port VLAN是利用交换机的端口进行VLAN的划分,一个端口只能属于一个VLAN。 (3)交换机划分了VLAN以后可以有效地隔绝冲突域。 (4)对于同一个交换机,相同的VLAN 能够ping通,即PC1、PC2接在VLAN100的成员端口1~8上,两台PC互相可以ping通,PC1、PC2接在VLAN的成员端口9~16上,两台PC互相可以ping通; (5)对于同一个交换机,不同的VLAN 不能ping通,即PC1接在VLAN100的成员端口1~8上,PC2接在VLAN200的成员端口9~16上,则互相ping不通。 (6)在ping的过程中,不同VLAN 要进行多次尝试,实验结果具有不稳定性。
因篇幅问题不能全部显示,请点此查看更多更全内容
Copyright © 2019- hzar.cn 版权所有 赣ICP备2024042791号-5
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务