1. 创建VLAN:

system-view [HUAWEI] vlan batch 10 20 30 40 //一次性创建VLAN 10、20、30、40

  1. 配置端口:

[HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] port link-type access [HUAWEI-GigabitEthernet0/0/1] port default vlan 10 //将端口设置为VLAN 10

  1. 配置子接口:

[HUAWEI] interface gigabitethernet 0/0/1.10 //创建子接口,VLAN ID为10 [HUAWEI-GigabitEthernet0/0/1.10] port link-type hybrid [HUAWEI-GigabitEthernet0/0/1.10] port hybrid vlan 10 untagged //将子接口设置为VLAN 10,同时设置为未打标签

  1. 配置Trunk端口:

[HUAWEI] interface gigabitethernet 0/0/2 [HUAWEI-GigabitEthernet0/0/2] port link-type trunk [HUAWEI-GigabitEthernet0/0/2] port trunk allow-pass vlan 10 20 30 //将端口设置为Trunk模式,允许通过VLAN 10、20、30的数据

  1. 配置IP地址:

[HUAWEI] interface vlanif 10 [HUAWEI-Vlanif10] ip address 192.168.1.1 24 //为VLAN 10配置IP地址为192.168.1.1/24

  1. 配置DHCP:

[HUAWEI] dhcp enable [HUAWEI] interface vlanif 10 [HUAWEI-Vlanif10] dhcp select interface [HUAWEI-Vlanif10] dhcp server dns-list 8.8.8.8 //开启DHCP功能,为VLAN 10设置DNS服务器地址为8.8.8.8


原文地址: https://www.cveoy.top/t/topic/bB9S 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录