如何将批量的端口加入VLAN
实验:
文章来源:https://www.toymoban.com/news/detail-536717.html
代码如下:文章来源地址https://www.toymoban.com/news/detail-536717.html
[SW1]vlan 5
[SW1-vlan5]Q
[SW1]POR
[SW1]port-g
[SW1]port-group huawei
[SW1-port-group-huawei]gr
[SW1-port-group-huawei]group-member g0/0/2 to g0/0/20
# 2-20口,端口都是连续性
[SW1-port-group-huawei]por
[SW1-port-group-huawei]port
[SW1-port-group-huawei]port link-type acc
[SW1-port-group-huawei]port link-type access
# 端口类型为 Access
[SW1-GigabitEthernet0/0/2]port link-type access
[SW1-GigabitEthernet0/0/3]port link-type access
[SW1-GigabitEthernet0/0/4]port link-type access
[SW1-GigabitEthernet0/0/5]port link-type access
[SW1-GigabitEthernet0/0/6]port link-type access
[SW1-GigabitEthernet0/0/7]port link-type access
[SW1-GigabitEthernet0/0/8]port link-type access
[SW1-GigabitEthernet0/0/9]port link-type access
[SW1-GigabitEthernet0/0/10]port link-type access
[SW1-GigabitEthernet0/0/11]port link-type access
[SW1-GigabitEthernet0/0/12]port link-type access
[SW1-GigabitEthernet0/0/13]port link-type access
[SW1-GigabitEthernet0/0/14]port link-type access
[SW1-GigabitEthernet0/0/15]port link-type access
[SW1-GigabitEthernet0/0/16]port link-type access
[SW1-GigabitEthernet0/0/17]port link-type access
[SW1-GigabitEthernet0/0/18]port link-type access
[SW1-GigabitEthernet0/0/19]port link-type access
[SW1-GigabitEthernet0/0/20]port link-type access
[SW1-port-group-huawei]port default vlan 5
# 加入到上面创建的Vlan 5 中
[SW1-GigabitEthernet0/0/2]port default vlan 5
[SW1-GigabitEthernet0/0/3]port default vlan 5
[SW1-GigabitEthernet0/0/4]port default vlan 5
[SW1-GigabitEthernet0/0/5]port default vlan 5
[SW1-GigabitEthernet0/0/6]port default vlan 5
[SW1-GigabitEthernet0/0/7]port default vlan 5
[SW1-GigabitEthernet0/0/8]port default vlan 5
[SW1-GigabitEthernet0/0/9]port default vlan 5
[SW1-GigabitEthernet0/0/10]port default vlan 5
[SW1-GigabitEthernet0/0/11]port default vlan 5
[SW1-GigabitEthernet0/0/12]port default vlan 5
[SW1-GigabitEthernet0/0/13]port default vlan 5
[SW1-GigabitEthernet0/0/14]port default vlan 5
[SW1-GigabitEthernet0/0/15]port default vlan 5
[SW1-GigabitEthernet0/0/16]port default vlan 5
[SW1-GigabitEthernet0/0/17]port default vlan 5
[SW1-GigabitEthernet0/0/18]port default vlan 5
[SW1-GigabitEthernet0/0/19]port default vlan 5
[SW1-GigabitEthernet0/0/20]port default vlan 5
[SW1-port-group-huawei]
[SW1-port-group-huawei]q
[SW1]
检查配置:
[SW1]dis port vlan
Port Link Type PVID Trunk VLAN List
-------------------------------------------------------------------------------
GigabitEthernet0/0/1 hybrid 1 -
GigabitEthernet0/0/2 access 5 -
GigabitEthernet0/0/3 access 5 -
GigabitEthernet0/0/4 access 5 -
GigabitEthernet0/0/5 access 5 -
GigabitEthernet0/0/6 access 5 -
GigabitEthernet0/0/7 access 5 -
GigabitEthernet0/0/8 access 5 -
GigabitEthernet0/0/9 access 5 -
GigabitEthernet0/0/10 access 5 -
GigabitEthernet0/0/11 access 5 -
GigabitEthernet0/0/12 access 5 -
GigabitEthernet0/0/13 access 5 -
GigabitEthernet0/0/14 access 5 -
GigabitEthernet0/0/15 access 5 -
GigabitEthernet0/0/16 access 5 -
GigabitEthernet0/0/17 access 5 -
GigabitEthernet0/0/18 access 5 -
GigabitEthernet0/0/19 access 5 -
GigabitEthernet0/0/20 access 5 -
GigabitEthernet0/0/21 hybrid 1 -
GigabitEthernet0/0/22 hybrid 1 -
GigabitEthernet0/0/23 hybrid 1 -
GigabitEthernet0/0/24 hybrid 1 -
[SW1]
完成!
到了这里,关于华为交换机——批量将端口加入VLAN的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!