华为设备vlan配置命令

[Huawei]vlan 10 //创建VLAN并进入VLAN视图
[Huawei]vlan batch 11 to 20 //批量创建VLAN
[Huawei-GigabitEthernet0/0/1]port link-type access
[Huawei-GigabitEthernet0/0/1]port default vlan 10 //配置接口的缺省VLAN并将接口加入到指定VLAN
[Huawei-GigabitEthernet0/0/1]port discard tagged-packet //配置接口丢弃入方向带VLAN Tag的报文
[Huawei-GigabitEthernet0/0/2]port link-type trunk
[Huawei-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 to 11 //将接口加入到指定的VLAN中
[Huawei-GigabitEthernet0/0/2]port trunk pvid vlan 10 //配置Trunk接口的缺省VLAN
[Huawei-GigabitEthernet0/0/3]port link-type hybrid
[Huawei-GigabitEthernet0/0/3]port hybrid untagged vlan 10 //将Hybrid接口以Untagged方式加入VLAN
[Huawei-GigabitEthernet0/0/3]port hybrid tagged vlan 10 //将Hybrid接口以Tagged方式加入VLAN
[Huawei-GigabitEthernet0/0/3]port hybrid pvid vlan 10 //配置Hybrid接口的缺省VLAN
[Huawei]display port vlan //查看VLAN中包含的接口信息
[Huawei]display vlan //查看VLAN的相关信息
[Huawei-vlan10]mac-vlan mac-address 1-2-3 //关联MAC地址和VLAN
[Huawei-GigabitEthernet0/0/1]vlan precedence mac-vlan //优先基于MAC地址划分VLAN,缺省优先基于MAC地址划分VLAN
[Huawei-GigabitEthernet0/0/1]mac-vlan enable //使能基于MAC地址划分VLAN,缺省未使能
[Huawei]display mac-vlan mac-address all //查看基于MAC地址划分VLAN的配置信息
[Huawei-vlan11]ip-subnet-vlan 1 ip 10.1.1.1 24 //关联IP子网和VLAN
[Huawei-GigabitEthernet0/0/2]vlan precedence ip-subnet-vlan //优先基于IP子网划分VLAN
[Huawei-GigabitEthernet0/0/2]ip-subnet-vlan enable //使能基于IP子网划分VLAN的功能,缺省未使能
[Huawei]display ip-subnet-vlan vlan all //查看VLAN上所配置的IP子网信息
[Huawei-vlan12]protocol-vlan 1 at //关联协议和VLAN,并指定协议模板
[Huawei-GigabitEthernet0/0/4]protocol-vlan vlan 12 all //关联接口和协议VLAN
[Huawei]display protocol-vlan vlan all //查看VLAN上所配置的协议及协议索引
[Huawei]display protocol-vlan interface all //查看接口关联基于协议划分VLAN的配置信息
[Huawei-vlan14]policy-vlan mac-address 1-2-3 ip 10.1.1.1 //配置Policy VLAN
[Huawei]display policy-vlan all //查看策略VLAN的配置信息
[Huawei]int Vlanif 10
[Huawei-Vlanif10]ip add 10.1.1.1 24 //配置VLANIF接口的IP地址,实现三层互通
[Huawei-Vlanif10]damping time 0 //配置VLAN Damping功能的抑制时间,取值范围是0~20秒,缺省是0秒
[Huawei-Vlanif10]mtu 1500 //配置VLANIF接口的MTU,缺省为1500字节
[Huawei]display interface Vlanif 10 //查看VLANIF接口的状态、配置以及流量统计信息
[Huawei-vlan20]management-vlan //配置管理VLAN
[Huawei-vlan15]protocol-transparent //配置VLAN内协议报文透传功能,缺省未使能
[Huawei-vlan10]statistic enable //打开VLAN的流量统计功能
[Huawei]display vlan 10 statistics //查看指定VLAN的流量统计信息
[Huawei-Vlanif10]statistic enable both //打开VLANIF的流量统计功能
[Huawei]display interface Vlanif 10 //查看VLANIF的统计信息
[Huawei]ping mac enable //全局使能通用GMAC Ping功能,缺省未使能
[Huawei]ping mac 1-2-3 vlan 10 //检测和对端设备之间的连通性
[Huawei]trace mac enable //全局使能通用GMAC Trace功能
[Huawei]trace mac 1-2-3 vlan 10 //定位和对端设备之间的连通性故障

你可能感兴趣的:(网络设计与配置,华为,网络)