版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、PT实验(三) 交换机划分VLAN配置一、实验目标· 理解虚拟 LAN(VLAN)基本原理;· 掌握一般交换机按端口划分 VLAN的配置方法;· 掌握Tag VLAN配置方法。二、实验背景某一公司内财务部、销售部的PC通过2台交换机实现通信;要求财务部和销售部内的PC可以互通,但为了数据安全起见,销售部和财务部需要进行隔离,现要在交换机上做适当配置来实现这一目的。三、技术原理· VLAN是指在一个物理网段内,进行逻辑的划分,划分成若干个虚拟局域网。VLAN最大的特性是不受物理位置的限制,可以进行灵活的划分。VLAN具备了一个物理网段所具备的特性。相同VL
2、AN内的主机可以相互直接通信,不同VLAN间的主机之间互相访问必须经由路由设备进行转发。广播数据包只可以在本VLAN内进行广播,不能传输到其他VLAN中。· Port VLAN是实现VLAN的方式之一,它利用交换机的端口进行VLAN的划分,一个端口只能属于一个VLAN。· Tag VLAN是基于交换机端口的另外一种类型,主要用于使交换机的相同VLAN内的主机之间可以直接访问,同时对于不同VLAN的主机进行隔离。Tag VLAN遵循IEEE802.1Q协议的标准。在使用配置了Tag VLAN的端口进行数据传输时,需要在数据帧内添加4个字节的802.1Q标签信息,用于标示该数据
3、帧属于哪个VLAN,便于对端交换机收到数据帧后进行准确的过滤。四、实验步骤实验拓扑1、设置四台PC机IP地址如图所示。2、对交换机S1进行设置。Switch>enSwitch#conf tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#hostname S1 /设置主机名S1(config)#vlan 2 /划分VLAN 2S1(config-vlan)#exitS1(config)#vlan 3 /划分VLAN 3S1(config-vlan)#exitS1(config)#inter
4、face fa0/1S1(config-if)#switchport mode access /将fa0/1划分到VLAN 2S1(config-if)#switchport access vlan 2 /将fa0/1划分到VLAN 2S1(config-if)#exitS1(config)#interface fa0/2S1(config-if)#switchport mode accessS1(config-if)#switchport access vlan 3 /将fa0/2划分到VLAN 3S1(config-if)#exitS1(config)#interface fa0/24 /
5、设置fa0/24端口模式为trunk(级联模式)S1(config-if)#switchport mode trunkS1(config-if)#endS1#%SYS-5-CONFIG_I: Configured from console by consoleS1#show vlan /查看VLAN划分情况VLAN Name Status Ports- - - - default active Fa0/3, Fa0/4, Fa0/5, Fa0/6 Fa0/7, Fa0/8, Fa0/9, Fa0/10 Fa0/11, Fa0/12, Fa0/13, Fa0/14 Fa0/15, Fa0/16,
6、 Fa0/17, Fa0/18 Fa0/19, Fa0/20, Fa0/21, Fa0/22 Fa0/23, Gig1/1, Gig1/2 VLAN0002 active Fa0/1 VLAN0003 active Fa0/2 fddi-default act/unsup token-ring-default act/unsup fddinet-default act/unsup trnet-default act/unsupVLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 TranS1- - - - - - - - -
7、 - - enet 100001 1500 - - - - - 0 0 enet 100002 1500 - - - - - 0 0 enet 100003 1500 - - - - - 0 0 fddi 101002 1500 - - - - - 0 0 tr 101003 1500 - - - - - 0 0 fdnet 101004 1500 - - - ieee - 0 0 trnet 101005 1500 - - - ibm - 0 0 Remote SPAN VLANs-Primary Secondary Type Ports- - - -S1#show running-conf
8、igBuilding configuration.Current configuration : 1080 bytes!version 12.2no service timestamps log datetime msecno service timestamps debug datetime msecno service password-encryption!hostname S1!interface FastEthernet0/1 switchport access vlan 2!interface FastEthernet0/2 switchport access vlan 3!int
9、erface FastEthernet0/3!.!interface FastEthernet0/24 switchport mode trunk!interface GigabitEthernet1/1!interface GigabitEthernet1/2!interface Vlan1 no ip address shutdown!line con 0!line vty 0 4 loginline vty 5 15 login!endS1#3、对交换机S2进行设置。Switch>enSwitch#conf tEnter configuration commands, one pe
10、r line. End with CNTL/Z.Switch(config)#hostname S2S2(config)#vlan 2S2(config-vlan)#exitS2(config)#vlan 3S2(config-vlan)#exitS2(config)#interface fa0/1S2(config-if)#switchport access vlan 2S2(config-if)#exitS2(config)#interface fa0/2S2(config-if)#switchport access vlan 3S2(config-if)#exitS2(config)#i
11、nterface fa0/24S2(config-if)#switchport mode trunk S2(config-if)#endS2#%SYS-5-CONFIG_I: Configured from console by consoleS2#show vlanVLAN Name Status Ports- - - - default active Fa0/3, Fa0/4, Fa0/5, Fa0/6 Fa0/7, Fa0/8, Fa0/9, Fa0/10 Fa0/11, Fa0/12, Fa0/13, Fa0/14 Fa0/15, Fa0/16, Fa0/17, Fa0/18 Fa0/
12、19, Fa0/20, Fa0/21, Fa0/22 Fa0/23, Gig1/1, Gig1/2 VLAN0002 active Fa0/1 VLAN0003 active Fa0/2 fddi-default act/unsup token-ring-default act/unsup fddinet-default act/unsup trnet-default act/unsup VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2- - - - - - - - - - - enet 100001 15
13、00 - - - - - 0 0 enet 100002 1500 - - - - - 0 0 enet 100003 1500 - - - - - 0 0 fddi 101002 1500 - - - - - 0 0 tr 101003 1500 - - - - - 0 0 fdnet 101004 1500 - - - ieee - 0 0 trnet 101005 1500 - - - ibm - 0 0 Remote SPAN VLANs-Primary Secondary Type Ports- - - -S2#show running-config Building configu
14、ration.Current configuration : 1080 bytes!version 12.2no service timestamps log datetime msecno service timestamps debug datetime msecno service password-encryption!hostname S2!interface FastEthernet0/1 switchport access vlan 2!interface FastEthernet0/2 switchport access vlan 3!interface FastEtherne
15、t0/3!.!interface FastEthernet0/24 switchport mode trunk!interface GigabitEthernet1/1!interface GigabitEthernet1/2!interface Vlan1 no ip address shutdown!line con 0!line vty 0 4 loginline vty 5 15 login!endS2#五、验证打开PC1的Command PromptPacket Tracer PC Command Line 1.0PC>ipconfigIP Address.: 192.168.
16、1.2Subnet Mask.: 255.255.255.0Default Gateway.: 192.168.1.1PC>ping 192.168.1.3Pinging 192.168.1.3 with 32 bytes of data:Request timed out. /不同VLAN间无法PING通Request timed out.Request timed out.Request timed out.Ping statistics for 192.168.1.3: Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),PC>ping 192.168.1.4Pinging 192.168.1.4 with 32 bytes of data:Reply from 192.168.1.4: bytes=32 time=172ms TTL=128 /相同VLAN可以PING通Reply from 192.168.1.4: bytes=32 time=78ms TTL=128Reply from 192.168
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年石油化工班组长安全试题带答案
- 2026年四川省什邡市高一化学上册期末考试模拟卷(全优)附答案
- 2026年湖南省汨罗市高三生物下册期末考试模拟检测卷及参考答案
- 2026年吉林省集安市高三生物下册期末考试模拟试卷含答案
- 2026年福建省邵武市高三生物下册期末考试模拟测试卷及答案
- 2026年黑龙江省尚志市高三生物下册期末考试模拟测试卷(含答案)
- 2026年山东省安丘市高一化学上册期末考试试卷附参考答案(综合卷)
- 2026年江苏省如皋市高三物理下册期末考试模拟测试卷(含答案)
- 2026年安徽省宁国市高一化学上册期末考试考试卷含完整答案【夺冠】
- 2026年江苏省仪征市高三生物上册期末考试自测卷带答案
- 2026-2027学年四年级上学期统编版语文单元练习卷 第一单元-1(含答案)
- AQ3067-2026重大事故隐患判定准则专项培训考核试卷-答案卷
- 【应用方案】2026智慧农业农业机器人智能感知与精准作业一体化设计方案
- 2026事业单位笔试-云南-云南财务(医疗招聘)历年参考题库含答案详解
- T∕CCEAS008-2026 建设工程造价咨询成果文件质量标准
- 光伏项目运营代理
- 《山东省建设工程消防设计审查验收技术指南(建筑、结构)》
- 《理论力学教案》
- 薄膜制备技术CVD课件
- 成都国企招聘笔试真题答案
- 2024年北京燃气集团招聘笔试冲刺题(带答案解析)
评论
0/150
提交评论