1、目的:将PC1和PC3划分于VLAN10,将PC2和PC4划分于VLAN20ide
2、初始拓扑图测试
3、操做命令ui
测试PC1:spa
PC> ping 192.168.1.2 能够通讯blog
PC> ping 192.168.1.3 能够通讯get
PC> ping 192.168.1.4 能够通讯it
测试PC2:io
PC> ping 192.168.1.1 能够通讯class
PC> ping 192.168.1.3 能够通讯配置
PC> ping 192.168.1.4 能够通讯
S1配置以下:
<Huawei> system
[Huawei] sysname S1
[S1] vlan 10
[S1-vlan10] vlan 20
[S1-vlan20] display vlan
[S1-vlan20] interface e0/0/1
[S1-Ethernet0/0/1] port link-type access
[S1-Ethernet0/0/1] int e0/0/2
[S1-Ethernet0/0/2] port link-type access
[S1-Ethernet0/0/2] vlan 10
[S1-vlan10] port e0/0/1
[S1-vlan10] vlan 20
[S1-vlan20] port e0/0/2
[S1-vlan20] quit
[S1] int e0/0/3
[S1-Ethernet0/0/3] port link-type trunk
[S1-Erhernet0/0/3] port trunk allow-pass vlan 10 20
[S1-Ethernet0/0/3] dis vlan
S2配置以下:
<Huawei> sys
[Huawei] sysname S2
[S2] vlan 10
[S2-vlan10] vlan 20
[S2-vlan20] dis vlan
[S2-vlan20] int e0/0/1
[S2-Ethernet0/0/1] port link-type access
[S2-Ethernet0/0/1] int e0/0/2
[S2-Ethernet0/0/2] port link-type access
[S2-Ethernet0/0/2] vlan 10
[S2-vlan10] port e0/0/1
[S2-vlan10] vlan 20
[S2-vlan20] port e0/0/2
[S2-vlan20] int e0/0/3
[S2-Ethernet0/0/3] port link-type trunk
[S2-Ethernet0/0/3] port trunk allow-pass vlan 10 20
[S2-Ethernet0/0/3] dis vlan
测试PC1:
PC> ping 192.168.1.2 没法通讯
PC> ping 192.168.1.3 能够通讯
PC> ping 192.168.1.4 没法通讯
测试PC2:
PC> ping 192.168.1.1 没法通讯
PC> ping 192.168.1.3 没法通讯
PC> ping 192.168.1.4 能够通讯