一、VLAN
1、创建VLAN
[Huawei]vlan 10 //创建并进入VLAN10
[Huawei]vlan batch 10 20 //创建VLAN10和20
[Huawei]vlan batch 10 to 20 //创建VLAN10至20
2、查看VLAN
display vlan
3、配置接口类型(access、trunk和hybrid,默认为Hybrid)
[Huawei-Ethernet0/0/1]port link-type access
4、将Access接口加入VLAN(两种方法)
1)VLAN视图下
[Huawei-vlan2]port Ethernet 0/0/1
2)接口视图下
[Huawei-Ethernet0/0/1]port default vlan 2
5、将Trunk类型接口加入VLAN
[Huawei-Ethernet0/0/1]port trunk allow-pass vlan 2

二、单臂路由
1、创建vlan10和vlan20
[Huawei]vlan batch 10 20
2、设置接口类型为access并加入VLAN
[Huawei]interface Ethernet 0/0/1
[Huawei-Ethernet0/0/1]port link-type access
[Huawei-Ethernet0/0/1]port default vlan 10
3、配置中继口trunk并向允许通过的VLAN中
[Huawei-Ethernet0/0/22]port link-type trunk
[Huawei-Ethernet0/0/22]port trunk allow-pass vlan 10 20
4、配置单臂路由
[Huawei]interface GigabitEthernet 0/0/0
[Huawei-GigabitEthernet0/0/0]undo shutdown
[Huawei]interface GigabitEthernet 0/0/0.10
[Huawei-GigabitEthernet0/0/0.10]dot1q termination vid 10
//配置VLAN类型和封装协议
[Huawei-GigabitEthernet0/0/0.10]arp broadcast enable
//使子接口支持ARP广播