在交换机上创建VLAN,进入VLAN视图
[Huawei]vlan
10 | vlan batch 10 20 30
(可选)在特定VLAN视图下修改VLAN的名字
[Huawei-vlan10]name
techVLAN
为特定的VLAN添加接口
[Huawei-vlan10]port
gigabitethernet0/0/1
将特定的接口配置为access类型,并加入vlan
[Huawei]interface
gigabitethernet0/0/1
[Huawei-gigabitethernet0/0/1]port
link-type access
[Huawei-gigabitethernet0/0/1]port
default vlan 10
将特定接口配置为trunk类型
[Huawei]interface
gigabitethernet0/0/24
[Huawei-gigabitethernet0/0/24]port
link-type trunk
在该trunk接口上放行特定VLAN
[Huawei-gigabitethernet0/0/24]port
trunk allow-pass vlan 10 20 99
配置trunk接口的pvid,这个vlan的流量从trunk接口转发不会打标签,默认是vlan1
[Huawei-gigabitethernet0/0/24]port
trunk pvid vlan 99
静态划分VLAN
手工将交换机的接口加入到某个VLAN
[Huawei]vlan 10
[Huawei-vlan10]quit
[Huawei]interface g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type access
[Huawei-GigabitEthernet0/0/1]port default vlan 10
动态划分VLAN
根据MAC地址、网络层地址、网络层协议、IP广播域或管理策略划分VLAN
[Huawei]vlan 20
[Huawei-vlan20]mac-vlan mac-address 5489-98FC-5825
基于策略进行VLAN划分
[Huawei]vlan 20
[Huawei-vlan20]policy-vlan mac-address 0-1-1 ip 10.1.1.1 priority 7
基于策略划分VLAN:把MAC地址为0-1-1,IP地址为10.1.1.1的主机划分到VLAN20中,并配置该VLAN的802.1p优先级是7
标签:基本,vlan,配置,VLAN,gigabitethernet0,Huawei,trunk,port From: https://www.cnblogs.com/zx654042919/p/18100573