//(建立vlan,交换机g0/0/1加入vlan <Huawei>sys [Huawei]vlan 11 [Huawei-vlan11]q [Huawei]int g0/0/1 [Huawei-GigabitEthernet0/0/1]port link-type access [Huawei-GigabitEthernet0/0/1]port default vlan 11 [Huawei-GigabitEthernet0/0/1]q [Huawei]q <Huawei>save -------------------------------------------------------------------------------- //建立多个vlan,多个端口加入vlan,清除端口配置 [Huawei]vlan batch 10 100 //建立vlan10和vlan100两个vlan [Huawei]vlan batch 10 to 100 //建立10-100这90个vlan //多个端口加入vla [Huawei] port-group temp [Huawei]group-member g0/0/1 to g0/0/10 [Huawei]port link-type access [Huawei]port default vlan 10 [Huawei]quit //清除端口配置 [Huawei]clear configuration interface GigabitEthernet 0/0/10 -------------------------------------------------------------------------------- //删除交换机g0/0/1的vlan,删除交换机g0/0/1的access,删除vlan11 [Huawei]int g0/0/1 [Huawei-GigabitEthernet0/0/1]undo port default vlan [Huawei-GigabitEthernet0/0/1]undo port link-type [Huawei-GigabitEthernet0/0/1]q [Huawei]undo vlan 11 [Huawei]q <Huawei>save

------------------------------------------------------------------------------------

//建立基于MAC的vlan,基于PC1 MAC的vlan23,基于PC2 MAC的vlan24

华为交换机的基本配置(华为交换机基础配置命令)(1)

<Huawei>sys [Huawei]int g0/0/23 [Huawei-GigabitEthernet0/0/23]port link-type access [Huawei-GigabitEthernet0/0/23]port default vlan 23 [Huawei-GigabitEthernet0/0/23]q [Huawei]int g0/0/24 [Huawei-GigabitEthernet0/0/24]port link-type access [Huawei-GigabitEthernet0/0/24]port default vlan 24 [Huawei-GigabitEthernet0/0/24]dis th # interface GigabitEthernet0/0/24 port link-type access port default vlan 24 # return [Huawei-GigabitEthernet0/0/24]q [Huawei]

华为交换机的基本配置(华为交换机基础配置命令)(2)

[Huawei]vlan 23 [Huawei-vlan23]mac-vlan mac-address 0000-0000-0011 [Huawei]int g0/0/1 [Huawei-GigabitEthernet0/0/1]port hybrid untagged vlan 23 [Huawei-GigabitEthernet0/0/1]mac-vlan enable

华为交换机的基本配置(华为交换机基础配置命令)(3)

[Huawei]vlan 24 [Huawei-vlan24]mac-vlan mac-address 0000-0000-0022 [Huawei]int g0/0/2 [Huawei-GigabitEthernet0/0/2]port hybrid untagged vlan 24 [Huawei-GigabitEthernet0/0/2]mac-vlan enable

华为交换机的基本配置(华为交换机基础配置命令)(4)

---------------------------------------------------------------------------------------

//删除 [Huawei-GigabitEthernet0/0/1]undo mac-vlan enable [Huawei-GigabitEthernet0/0/1]undo port hybrid vlan 23 [Huawei-GigabitEthernet0/0/1]q [Huawei]int g0/0/23 [Huawei-GigabitEthernet0/0/23]undo port link-type [Huawei-GigabitEthernet0/0/23]undo port default vlan [Huawei-GigabitEthernet0/0/23]q [Huawei]vlan 23 [Huawei-vlan23]undo mac-vlan mac-address 0000-0000-0011 [Huawei-vlan23]q [Huawei]undo vlan 11 [Huawei]q <Huawei>save ----------------------------------------------------------------------------------- //查看vlan详细情况 [Huawei]dis vlan 23 verbose //关闭信息提示 [Huawei]]undo info-center enable //改名 [Huawei]sysname Huawei //查看端口与vlan对应关系 [Huawei]dis port vlan //查看端口详细信息 [Huawei]dis int g0/0/1 //建vlan23和vlan24 [Huawei]int vlan batch 23 24 //建vlan20-vlan30,10个vlan [Huawei]int vlan batch 20 to 30 //多个端口加入同一vlan [Huawei]port-group caiwu [Huawei]group-member g0/0/1 to g0/0/24 [Huawei]port link-type access [Huawei]port default vlan 10 [Huawei]quit //清除交换机所有配置并重启 <Huawei>reset saved-configuration <Huawei>reboot

,