交换机基于MAC地址划分VLAN
基于MAC地址划分的VLAN只处理Untagged数据帧,这里只讨论单层VLAN标签(QinQ可以实现双层VLAN标签),只有收到的数据帧中原来没有VLAN标签才可以根据交换机上所配置的MAC地址与VLAN ID映射关系,在数据帧中添加对应的VLAN标签。基于MAC地址划分VLAN仅可在Hybrid端口上进行,故这种VLAN划分方式主要针对终端用户设备,而非针对其他网络设备,因为在其他网络设备间连接的端口上发送的数据帧通常都是带有VLAN标签的,即使是Hybrid类型端口。
(一)交换机LSW1配置
针对交换机LSW1的应用,主要验证基于MAC的VLAN划分,对该设备采取缺省配置,不做任何划分,属于默认的VLAN 1。
(二)交换机LSW2配置
< Huawei>undo terminal monitor
Info: Current terminal monitor is off.
< Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]vlan 4
[Huawei-vlan4]mac-vlan mac-address 5489-98A1-08EE
[Huawei-vlan4]mac-vlan mac-address 5489-984E-0332
[Huawei-vlan4]interface g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type hybrid
[Huawei-GigabitEthernet0/0/1]port hybrid untagged vlan 4
[Huawei-GigabitEthernet0/0/1]mac-vlan en
[Huawei-GigabitEthernet0/0/1]mac-vlan enable
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei-GigabitEthernet0/0/1]interface g0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type hybrid
[Huawei-GigabitEthernet0/0/2]port hybrid tagged vlan 4
[Huawei-GigabitEthernet0/0/2]mac-vlan enable
对配置信息详细查看:
[Huawei]dis vlan
The total number of vlans is : 2
--------------------------------------------------------------------------------
U: Up; D: Down;