1.配置VLAN
1.创建VLAN 10/20/30
2.将端口加入VLAN
3.查看VLAN信息
(1)如图所示:
步骤:实现此案例需要按照如下步骤进行。
创建VLAN 10/20/30
1.<Huawei>system-view切换系统模式
2.【Huawei】Undo vlan batch 10 20 30
如图所示:
2.将端口加入VLAN
(1)[Huawei]interface Ethernet0/0/1
(2)[Huawei-Ethernet0/0/1]port link-type access
(3)[Huawei-Ethernet0/0/1]port default vlan 10
(4)[Huawei]interface Ethernet0/0/2
【5】[Huawei-Ethernet0/0/2]port link-type access
【6】[Huawei-Ethernet0/0/2]port default vlan 10
【8】[Huawei]interface Ethernet0/0/3
【9】[Huawei-Ethernet0/0/3]port link-type access
【10】[Huawei-Ethernet0/0/3]port default vlan 20
【11】[Huawei]interface Ethernet0/0/4
【12】[Huawei-Ethernet0/0/4]port link-type access
【13】[Huawei-Ethernet0/0/4]port default vlan 20
【14】[Huawei]interface Ethernet0/0/5
【15】[Huawei-Ethernet0/0/5]port link-type access
【16】[Huawei-Ethernet0/0/5]port default vlan 20
【17】[Huawei]interface Ethernet0/0/6
【18】[Huawei-Ethernet0/0/6]port link-type access
【19】[Huawei-Ethernet0/0/6]port default vlan 30
【20】[Huawei]interface Ethernet0/0/7
【21】[Huawei-Ethernet0/0/7]port link-type access
【22】[Huawei-Ethernet0/0/7]port default vlan 30
如图所示:!
3.查看VLAN信息:
[Huawei]dis vlan
2 案例2:VLAN与Trunk配置![](http://i2.51cto.com/images/blog/201808/30
步骤:
[SW1]vlan 5
[SW1]vlan 10
[SW1]interface Ethernet0/0/1
[SW1-Ethernet0/0/1]port link-type access
[SW1-Ethernet0/0/1]port default vlan 5
[SW1]interface Ethernet0/0/2
[SW1-Ethernet0/0/2]port link-type access
[SW1-Ethernet0/0/2]port default vlan 10
[SW1]interface Ethernet0/0/24
[SW1-Ethernet0/0/24]port link-type trunk
[SW1-Ethernet0/0/24]port trunk allow-pass vlan 5 10
第二台:
[SW2]vlan 5
[SW2]vlan 10
[SW2]interface Ethernet0/0/3
[SW2-Ethernet0/0/3]port link-type access
[SW2-Ethernet0/0/3]port default vlan 5
[SW2]interface Ethernet0/0/4
[SW2-Ethernet0/0/4]port link-type access
[SW2-Ethernet0/0/4]port default vlan 10
[SW2]interface Ethernet0/0/24
[SW2-Ethernet0/0/24]port link-type trunk
[SW2-Ethernet0/0/24]port trunk allow-pass vlan 5 10
第二台
3.测试
VLAN 5的2台主机能够互通,VLAN 10的2台主机能够互通。
VLAN 5与VLAN 10的2台主机不能够互通
原文地址:http://blog.51cto.com/13934188/2167107