主流品牌的交换机都是如何给端口划分VLAN的?
到厂商的官方网查找相应的产品手册。 在命令行窗口界面上,学会使用"?”,即学会使用“帮助”。
好了,本期龙哥就梳理一些主流厂商的端口划分vlan的命令,供大家日常工作查阅,欢迎收藏!
华为交换机
<HUAWEI> system-view[HUAWEI] sysname SwitchA[SwitchA] vlan batch 2 3 //创建VLAN 2、3[SwitchA] interface gigabitethernet 0/0/1[SwitchA-GigabitEthernet0/0/1] port link-type access[SwitchA-GigabitEthernet0/0/1] port default vlan 2 //把G0/0/1划分为vlan2[SwitchA-GigabitEthernet0/0/1] quit[SwitchA] interface gigabitethernet 0/0/2[SwitchA-GigabitEthernet0/0/2] port link-type access[SwitchA-GigabitEthernet0/0/2] port default vlan 3 //把G0/0/2划分为vlan3[SwitchA-GigabitEthernet0/0/2] quit
思科交换机
Switch# configure terminalSwitch(config)# vlan 2Switch(config-vlan)# endSwitch(config)# vlan 3Switch(config-vlan)# endSwitch(config)# interface gigabitethernet0/1Switch(config-if)# switchport mode accessSwitch(config-if)# switchport access vlan 2 //把G0/1划分为vlan2Switch(config-if)# endSwitch(config)# interface gigabitethernet0/2Switch(config-if)# switchport mode accessSwitch(config-if)# switchport access vlan 3 //把G0/3划分为vlan2Switch(config-if)# end
锐捷交换机
Ruijie#configure terminalRuijie(config)#vlan 2Ruijie(config-vlan)#exitRuijie(config)#vlan 3Ruijie(config-vlan)#exitRuijie>enableRuijie#config terminalRuijie(config)#interface gigabitEthernet 1/1Ruijie(config-if-GigabitEthernet 1/10)#switchport mode accessRuijie(config-if-GigabitEthernet 1/10)#switchport access vlan 2 //把G1/1划分为vlan2Ruijie(config-if-GigabitEthernet 1/10)#endRuijie(config)#interface gigabitEthernet 1/2Ruijie(config-if-GigabitEthernet 1/10)#switchport mode accessRuijie(config-if-GigabitEthernet 1/10)#switchport access vlan 3 //把G1/2划分为vlan2Ruijie(config-if-GigabitEthernet 1/10)#end
Juniper交换机
user@host# set vlans along-v2 vlan-id 2user@host# set ge-0/0/1 unit 0 family ethernet-switching interface-mode accessuser@host# set ge-0/0/1 unit 0 family ethernet-switching vlan members along-v2 user@host# set vlans along-v3 vlan-id 3user@host# set ge-0/0/2 unit 0 family ethernet-switching interface-mode accessuser@host# set ge-0/0/2 unit 0 family ethernet-switching vlan members along-v3
华三交换机
[H3C] vlan 2[H3C-vlan10] quit[H3C] vlan 3[H3C-vlan10] quit[H3C] interface gigabitethernet 1/0/1[H3C-GigabitEthernet1/0/1] port link-type access[H3C-GigabitEthernet1/0/1] port access vlan 2
[H3C] interface gigabitethernet 1/0/2[H3C-GigabitEthernet1/0/1] port link-type access[H3C-GigabitEthernet1/0/1] port access vlan 3
迈普交换机
Maipu#configure terminal Maipu(config)#vlan 2-3Maipu(config)#interface gigabitethernet 0/1Maipu(config-if-gigabitethernet0/1)#switchport mode access Maipu(config-if-gigabitethernet0/1)#switchport access vlan 2Maipu(config-if-gigabitethernet0/1)#exitMaipu(config)#interface gigabitethernet 0/2Maipu(config-if-gigabitethernet0/2)#switchport mode access Maipu(config-if-gigabitethernet0/2)#switchport access vlan 3Maipu(config-if-gigabitethernet0/2)#exit
赞 (0)