A-A+

VLAN的作用:同一个物理网段的用户隔离

2015年12月25日 站长资讯 暂无评论

一、实验目的

通过此实验了解VLAN的作用:将同一物理网段的用户隔离开了,阻止其互相通信。

三、实验描述

1. 拓扑连接如上图所示,PCA接SWA的E0/4/0,PCB接SWA的E0/4/1

2. PCA与PCB的IP地址配置在同一网段

四、实验步骤

1. 在交换机上创建两个VLAN

2. 分别将相应接口加入不同VLAN

3. 从一个主机PING另一个主机,测试连通性。

五、实验过程

阶段一:SWA不做任何配置

则由PCA ping PCB: http://www.xiaoxiongboke.com

阶段二:增加VLAN的配置,PCA、PCB隶属于不同VLAN

  1. [H3C]sysname ZJSWA \\给设备命令  
  2. [ZJSWA]vlan 10 \\创建新的VLAN,默认只有VLAN 10  
  3. [SZJSWA-vlan10]vlan 20 \\同上,创建VLAN 20  
  4. [ZJSWA]interface Ethernet 0/4/0   
  5. [ZJSWA-Ethernet1/0/1]port access vlan 10 \\配置接口为access口,属于VLAN 10的接口  
  6. [ZJSWA-Ethernet1/0/1]quit  
  7. [ZJSWA]interface Ethernet 0/4/1  
  8. [ZJSWA-Ethernet1/0/2]port access vlan 20 \\配置接口为access口,属于VLAN 20的接口  
  9. [ZJSWA-Ethernet1/0/2]quit  

六、实验测试

通过PING的命令,由PCA ping PCB:

七、查看信息

  1. [ZJSWA]dis vlan 10 \\查看VLAN 10的相关信息  
  2. VLAN ID: 10  
  3. VLAN Type: static \\VLAN的类型,手动配置的  
  4. Route Interface: not configured  
  5. Description: VLAN 0010  
  6. Name: VLAN 0010  
  7. Broadcast MAX-ratio: 100%  
  8.  Tagged   Ports: none  
  9. Untagged Ports: \\VLAN 10的数据通过此接口时不用打标签  
  10. Ethernet0/4/0  
  11.    
  12. [SWA]display interface Ethernet 0/4/0  
  13. Ethernet1/0/24 current state : UP  
  14. IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 000f-e265-1f84  
  15. Media type is twisted pair, loopback not set  
  16. Port hardware type is 100_BASE_TX  
  17. 100Mbps-speed mode, full-duplex mode \\速率和双工模式  
  18. Link speed type is autonegotiation, link duplex type is autonegotiation \\速率和双工自协商  
  19. Flow-control is not enabled  
  20. The Maximum Frame Length is 9216 \\容许通过的最大帧长度,有时会导致丢包  
  21. Broadcast MAX-ratio: 100%  
  22. Unicast MAX-ratio: 100%  
  23. Multicast MAX-ratio: 100%  
  24. Allow jumbo frame to pass \\容许巨型帧通过  
  25. PVID: 1 \\不打标签通过的VLAN号  
  26. Mdi type: auto  
  27. Port link-type: access \\端口类型  
  28. VLAN passing : none \\容许通过的VLAN  
  29. VLAN permitted: 1  
  30. Last 300 seconds input: 0 packets/sec 2 bytes/sec  
  31. Last 300 seconds output: 0 packets/sec 2 bytes/sec  
标签:

给我留言