华为交换机创建vlan命令如下
<Huawei>system-view
[Huawei]vlan batch 10 20 30 批量创建 vlan 10 20 30 也可以用vlan10 这样的命令单个单个创建
![](https://i-blog.csdnimg.cn/blog_migrate/8b8fa78e21b144d1780b230f760f4d7a.png)
查看VLAN的详细配置
![](https://i-blog.csdnimg.cn/blog_migrate/755f8a6cd0c105b23977dd6f1ec46b4e.png)
配置vlanif 命令如下
[Huawei]interface Vlanif 10 进入虚拟vlan接口
[Huawei-Vlanif10]ip address 192.168.10.1 24 设置IP地址也入输入ip address 192.168.10.1 255.255.255.0
[Huawei-Vlanif10]qu 退出[Huawei]interface Vlanif 20
[Huawei-Vlanif20]ip address 192.168.20.1 24
[Huawei-Vlanif20]quit[Huawei]interface Vlanif 30
[Huawei-Vlanif30]ip address 192.168.30.1 24
![](https://i-blog.csdnimg.cn/blog_migrate/a16fe20ff6bb3d6c26689d71295a6197.png)
把端口划分到对应的vlan。端口1 vlan10 端口2 vlan20 端口3 vlan20
[Huawei]interface GigabitEthernet 0/0/1 进入端口1
[Huawei-GigabitEthernet0/0/1]port link-type access 设置端口模式为ACCESS
[Huawei-GigabitEthernet0/0/1]port default vlan 10 设置端口1为vlan10
[Huawei-GigabitEthernet0/0/1]qu 退出端口配置
![](https://i-blog.csdnimg.cn/blog_migrate/e12b6fd8a9ffc69966a749f77e4472d1.png)