《计算机网络实验报告 vlan间通信》由会员分享,可在线阅读,更多相关《计算机网络实验报告 vlan间通信(7页珍藏版)》请在金锄头文库上搜索。
1、1实验:VLAN 隔离及 VLAN 间通信一、 VLAN/802.1Q本交换机隔离一、实验目的1.理解并掌握 VLAN 的作用及特点。2.熟悉交换机的基本配置,学会在交换机上划分 VLAN 及如何将接口划分到指定的VLAN 中,学会给两台交换机互连的端口配置 TRUNK 模式。3.学会利用 VLAN 的虚拟接口,使处于不同 VLAN 间的计算机也可以进行通讯。二、实验内容及步骤1.实验用到的拓扑图2.实验过程清空交换机原有 VLAN 配置,新建两个 VLAN 10、VLAN 20 并将 f0/5 口加入 VLAN 10,将 f0/15 口加入 VLAN 20。3.交换机配置命令SW1#show
2、 vlanVLAN Name Status Ports - - - -1 VLAN0001 STATIC Fa0/1, Fa0/2, 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, Fa0/24 Gi0/25, Gi0/26, Gi0/27, Gi0/28 PC1:Ethernet adapter 本地连接:Connection-sp
3、ecific DNS Suffix : IP Address: 192.168.10.11Subnet Mask: 255.255.255.0Default Gateway :PC2:Ethernet adapter 本地连接:Connection-specific DNS Suffix : IP Address: 192.168.20.22Subnet Mask: 255.255.255.0Default Gateway :2SW1#config terminalEnter configuration commands, one per line. End with CNTL/Z.SW1(c
4、onfig)#vlan 10SW1(config-vlan)#name test10SW1(config-vlan)#exitSW1(config)#vlan 20SW1(config-vlan)#name test20SW1(config-vlan)#exitSW1(config)#interface fastEthernet 0/5SW1(config-if)#switchport access vlan 10SW1(config-if)#exitSW1(config)#interface fastEthernet 0/15SW1(config-if)#switchport access
5、vlan 20SW1(config-if)#endSW1#May 15 11:45:06 SW1 %5:Configured from console by console三、实验结果PC2 与 PC1 不能相互 ping 通Pinging 192.168.20.22 with 32 bytes of data:Destination host unreachable.Destination host unreachable.Destination host unreachable.Destination host unreachable.Ping statistics for 192.168
6、.20.22:Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),Approximate round trip times in milli-seconds:Minimum = 0ms, Maximum = 0ms, Average = 0ms二、VLAN/802.1Q跨交换机 VLAN一、实验内容及步骤1.实验拓扑图2.实验过程两台交换机的 f0/24 互联,其中一台交换机的 f0/5 和 f0/15 连接 PC1 和 PC2,另一台交换机的 f0/5 接 PC333.交换机配置命令SW1#show vlanVLAN Name Stat
7、us Ports - - - -1 VLAN0001 STATIC Fa0/1, Fa0/2, 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, Fa0/24 Gi0/25, Gi0/26, Gi0/27, Gi0/28 SW1#config terminalEnter configuration commands, one per l
8、ine. End with CNTL/Z.SW1(config)#vlan 10SW1(config-vlan)#name test10SW1(config-vlan)#vlan 20SW1(config-vlan)#name test20SW1(config-vlan)#exitSW1(config)#interface fastEthernet 0/5SW1(config-if)#switchport access vlan 10SW1(config-if)#exitSW1(config)#interface fastEthernet 0/15SW1(config-if)#switchpo
9、rt access vlan 20SW1(config-if)#exitSW1(config)#interface fastEthernet 0/24SW1(config-if)#switchport mode trunk SW1(config-if)#endSW1#May 15 11:50:34 SW1 %5:Configured from console by consoleSW1#show vlanVLAN Name Status Ports - - - -1 VLAN0001 STATIC Fa0/1, Fa0/2, Fa0/3, Fa0/4 Fa0/6, Fa0/7, Fa0/8,
10、Fa0/9 Fa0/10, Fa0/11, Fa0/12, Fa0/13 Fa0/14, Fa0/16, Fa0/17, Fa0/18 Fa0/19, Fa0/20, Fa0/21, Fa0/22 Fa0/23, Fa0/24, Gi0/25, Gi0/26 Gi0/27, Gi0/28 10 test10 STATIC Fa0/5, Fa0/24 20 test20 STATIC Fa0/15, Fa0/24 SW1#show int f0/24 switchport Interface Switchport Mode Access Native Protected VLAN lists-
11、- - - - - -4FastEthernet 0/24 enabled TRUNK 1 1 Disabled ALL(配置 SW1)SW2(config)#vlan 10SW2(config-vlan)#name test10SW2(config-vlan)#exitSW2(config)#interface fastEthernet 0/5SW2(config-if)#switchport access valn 10SW2(config-if)#exitSW2(config)#interface fastEthernet 0/24SW2(config-if)#switchport mo
12、de trunkSW2(config-if)#endSW2#May 16 13:31:16 SW2 %5:Configured from console by consoleshow vlanVLAN Name Status Ports - - - -1 VLAN0001 STATIC Fa0/1, Fa0/2, Fa0/3, Fa0/4 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, Fa0/24, Gi0/25 Gi0/26, Gi0/27, Gi0/28 10 test10 STATIC Fa0/5, Fa0/24 SW2#show int f0/24 swSW2#show int f0/24 switchport Interface Switchport Mode Access Native Protected VLAN lists- - - - - - -FastEthernet 0/24 enabl