A-A+
VLAN的作用:同一个物理网段的用户隔离
一、实验目的
通过此实验了解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
- [H3C]sysname ZJSWA \\给设备命令
- [ZJSWA]vlan 10 \\创建新的VLAN,默认只有VLAN 10
- [SZJSWA-vlan10]vlan 20 \\同上,创建VLAN 20
- [ZJSWA]interface Ethernet 0/4/0
- [ZJSWA-Ethernet1/0/1]port access vlan 10 \\配置接口为access口,属于VLAN 10的接口
- [ZJSWA-Ethernet1/0/1]quit
- [ZJSWA]interface Ethernet 0/4/1
- [ZJSWA-Ethernet1/0/2]port access vlan 20 \\配置接口为access口,属于VLAN 20的接口
- [ZJSWA-Ethernet1/0/2]quit
六、实验测试
通过PING的命令,由PCA ping PCB:
七、查看信息
- [ZJSWA]dis vlan 10 \\查看VLAN 10的相关信息
- VLAN ID: 10
- VLAN Type: static \\VLAN的类型,手动配置的
- Route Interface: not configured
- Description: VLAN 0010
- Name: VLAN 0010
- Broadcast MAX-ratio: 100%
- Tagged Ports: none
- Untagged Ports: \\VLAN 10的数据通过此接口时不用打标签
- Ethernet0/4/0
- [SWA]display interface Ethernet 0/4/0
- Ethernet1/0/24 current state : UP
- IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 000f-e265-1f84
- Media type is twisted pair, loopback not set
- Port hardware type is 100_BASE_TX
- 100Mbps-speed mode, full-duplex mode \\速率和双工模式
- Link speed type is autonegotiation, link duplex type is autonegotiation \\速率和双工自协商
- Flow-control is not enabled
- The Maximum Frame Length is 9216 \\容许通过的最大帧长度,有时会导致丢包
- Broadcast MAX-ratio: 100%
- Unicast MAX-ratio: 100%
- Multicast MAX-ratio: 100%
- Allow jumbo frame to pass \\容许巨型帧通过
- PVID: 1 \\不打标签通过的VLAN号
- Mdi type: auto
- Port link-type: access \\端口类型
- VLAN passing : none \\容许通过的VLAN
- VLAN permitted: 1
- Last 300 seconds input: 0 packets/sec 2 bytes/sec
- Last 300 seconds output: 0 packets/sec 2 bytes/sec