1.实验拓扑图
2.IP地址自行规划设计和VLAN划分
3.对设备进行配置
(1)二层交换机配置
<Huawei>system-view
[Huawei]vlan 2
[Huawei-vlan2]quit
[Huawei]vlan 3
[Huawei-vlan3]quit
[Huawei]int e0/0/2
[Huawei-Ethernet0/0/2]port link-type access
[Huawei-Ethernet0/0/2]port default vlan 2
[Huawei]int e0/0/3
[Huawei-Ethernet0/0/3]port link-type access
[Huawei-Ethernet0/0/3]port default vlan 3
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]port link-type trunk
[Huawei-Ethernet0/0/1]port trunk allow-pass vlan all
(2)三层交换机配置
<Huawei>system-view
[Huawei]vlan batch 2 3
[Huawei]int vlan 2
[Huawei-Vlanif2]ip address 192.168.1.1 24
[Huawei]int vlan 3
[Huawei-Vlanif3]ip address 192.168.2.1 24
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all
4.实验结果
PC2 ping PC1