PT_实验(三)_交换机划分VLAN配置.doc

上传人:飞****2 文档编号:54320896 上传时间:2022-10-28 格式:DOC 页数:7 大小:64KB
返回 下载 相关 举报
PT_实验(三)_交换机划分VLAN配置.doc_第1页
第1页 / 共7页
PT_实验(三)_交换机划分VLAN配置.doc_第2页
第2页 / 共7页
点击查看更多>>
资源描述

《PT_实验(三)_交换机划分VLAN配置.doc》由会员分享,可在线阅读,更多相关《PT_实验(三)_交换机划分VLAN配置.doc(7页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、PT实验(三) 交换机划分VLAN配置一、实验目标 理解虚拟 LAN(VLAN)基本原理; 掌握一般交换机按端口划分 VLAN的配置方法; 掌握Tag VLAN配置方法。二、实验背景某一公司内财务部、销售部的PC通过2台交换机实现通信;要求财务部和销售部内的PC可以互通,但为了数据安全起见,销售部和财务部需要进行隔离,现要在交换机上做适当配置来实现这一目的。三、技术原理 VLAN是指在一个物理网段内,进行逻辑的划分,划分成若干个虚拟局域网。VLAN最大的特性是不受物理位置的限制,可以进行灵活的划分。VLAN具备了一个物理网段所具备的特性。相同VLAN内的主机可以相互直接通信,不同VLAN间的主

2、机之间互相访问必须经由路由设备进行转发。广播数据包只可以在本VLAN内进行广播,不能传输到其他VLAN中。 Port VLAN是实现VLAN的方式之一,它利用交换机的端口进行VLAN的划分,一个端口只能属于一个VLAN。 Tag VLAN是基于交换机端口的另外一种类型,主要用于使交换机的相同VLAN内的主机之间可以直接访问,同时对于不同VLAN的主机进行隔离。Tag VLAN遵循IEEE802.1Q协议的标准。在使用配置了Tag VLAN的端口进行数据传输时,需要在数据帧内添加4个字节的802.1Q标签信息,用于标示该数据帧属于哪个VLAN,便于对端交换机收到数据帧后进行准确的过滤。四、实验步

3、骤实验拓扑1、设置四台PC机IP地址如图所示。2、对交换机S1进行设置。SwitchenSwitch#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)#interface fa0/1S1(config-if)#switchport mode

4、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 /设置fa0/24端口模式为trunk(级联模式)S1(config-if)#sw

5、itchport 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, Fa0/17, Fa0/18 Fa0/19, Fa0/20, Fa0/21,

6、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- - - - - - - - - - - enet 1500 - - - - - 0 0 enet 1500 -

7、 - - - - 0 0 enet 1500 - - - - - 0 0 fddi 1500 - - - - - 0 0 tr 1500 - - - - - 0 0 fdnet 1500 - - - ieee - 0 0 trnet 1500 - - - ibm - 0 0 Remote SPAN VLANs-Primary Secondary Type Ports- - - -S1#show running-configBuilding configuration.Current configuration : 1080 bytes!version 12.2no service timest

8、amps 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!interface FastEthernet0/3!.!interface FastEthernet0/24 switchport mode trunk!interface Gigab

9、itEthernet1/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进行设置。SwitchenSwitch#conf tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#hostname S2S2(config)#vlan 2S2(config-vlan)#exitS2(con

10、fig)#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)#interface fa0/24S2(config-if)#switchport mode trunk S2(config-if)#endS2#%SYS-5-CONFIG_I: Confi

11、gured 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/19, Fa0/20, Fa0/21, Fa0/22 Fa0/23, Gig1/1, Gig1/2 VLAN0002 active Fa0/1 VLAN0003 active Fa0/2

12、 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 1500 - - - - - 0 0 enet 1500 - - - - - 0 0 enet 1500 - - - - - 0 0 fddi 1500 - - - - - 0 0 tr 1500 - -

13、 - - - 0 0 fdnet 1500 - - - ieee - 0 0 trnet 1500 - - - ibm - 0 0 Remote SPAN VLANs-Primary Secondary Type Ports- - - -S2#show running-config Building configuration.Current configuration : 1080 bytes!version 12.2no service timestamps log datetime msecno service timestamps debug datetime msecno servi

14、ce password-encryption!hostname S2!interface FastEthernet0/1 switchport access vlan 2!interface FastEthernet0/2 switchport access vlan 3!interface FastEthernet0/3!.!interface FastEthernet0/24 switchport mode trunk!interface GigabitEthernet1/1!interface GigabitEthernet1/2!interface Vlan1 no ip addres

15、s shutdown!line con 0!line vty 0 4 loginline vty 5 15 login!endS2#五、验证打开PC1的Command PromptPacket Tracer PC Command Line 1.0PCipconfigIP Address.: 192.168.1.2Subnet Mask.: 255.255.255.0Default Gateway.: 192.168.1.1PCping 192.168.1.3Pinging 192.168.1.3 with 32 bytes of data:Request timed out. /不同VLAN间

16、无法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),PCping 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: by

17、tes=32 time=78ms TTL=128Reply from 192.168.1.4: bytes=32 time=63ms TTL=128Reply from 192.168.1.4: bytes=32 time=79ms TTL=128Ping statistics for 192.168.1.4: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: Minimum = 63ms, Maximum = 172ms, Average = 98ms

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 教案示例

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁