华为交换机
<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 terminal Switch(config)# vlan 2 Switch(config-vlan)# end Switch(config)# vlan 3 Switch(config-vlan)# end Switch(config)# interface gigabitethernet0/1 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 2 //把G0/1划分为vlan2 Switch(config-if)# end Switch(config)# interface gigabitethernet0/2 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 3 //把G0/3划分为vlan2 Switch(config-if)# end
锐捷交换机
Ruijie#configure terminal Ruijie(config)#vlan 2 Ruijie(config-vlan)#exit Ruijie(config)#vlan 3 Ruijie(config-vlan)#exit Ruijie>enable Ruijie#config terminal Ruijie(config)#interface gigabitEthernet 1/1 Ruijie(config-if-GigabitEthernet 1/10)#switchport mode access Ruijie(config-if-GigabitEthernet 1/10)#switchport access vlan 2 //把G1/1划分为vlan2 Ruijie(config-if-GigabitEthernet 1/10)#end Ruijie(config)#interface gigabitEthernet 1/2 Ruijie(config-if-GigabitEthernet 1/10)#switchport mode access Ruijie(config-if-GigabitEthernet 1/10)#switchport access vlan 3 //把G1/2划分为vlan2 Ruijie(config-if-GigabitEthernet 1/10)#end
Juniper交换机
user@host# set vlans along-v2 vlan-id 2 user@host# set ge-0/0/1 unit 0 family ethernet-switching interface-mode access user@host# set ge-0/0/1 unit 0 family ethernet-switching vlan members along-v2 user@host# set vlans along-v3 vlan-id 3 user@host# set ge-0/0/2 unit 0 family ethernet-switching interface-mode access user@host# set ge-0/0/2 unit 0 family ethernet-switching vlan members along-v3
华三交换机
[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-3 Maipu(config)#interface gigabitethernet 0/1 Maipu(config-if-gigabitethernet0/1)#switchport mode access Maipu(config-if-gigabitethernet0/1)#switchport access vlan 2 Maipu(config-if-gigabitethernet0/1)#exit Maipu(config)#interface gigabitethernet 0/2 Maipu(config-if-gigabitethernet0/2)#switchport mode access Maipu(config-if-gigabitethernet0/2)#switchport access vlan 3 Maipu(config-if-gigabitethernet0/2)#exit