Summary: This article provides a basic configuration guide on VLANs for cnMatrix Switches via CLI (Command Line Interface).
Example Scenario: Create 5 VLANs and configure 3 Switchports, 1 Access Port, 1 Hybrid port and 1 Trunk port. To understand the difference between each Switchport mode, visit the article Switchport Modes explained.
GigabitEthernet 0/5 - Access Port VLAN 11
GigabitEthernet 0/6 - Hybrid Port Native VLAN 10 Tagged VLANs 11,12,13,14
GigabitEthernet 0/7 - Trunk Port (All VLANs are tagged)
Access Port
-
Log in to the cnMatrix Switch via a terminal application such as PuTTy
-
Create your Layer 2 VLAN interface(s) if they haven’t been created already
configure terminal
vlan <vlan>
-
Configure the Switchport
configure terminal
interface <interface>
switchport acceptable-frame-type untaggedAndPrioritytagged
switchport mode access
switchport access vlan <vlan>
exit
-
Configure the VLAN for the Access Switchport
configure terminal
vlan <vlan>
ports add <interface> untagged <interface>
Hybrid Port
-
Log in to the cnMatrix Switch via a terminal application such as PuTTy
-
Create your Layer 2 VLAN interfaces if they haven’t been created already
configure terminal
vlan <vlan>
-
Configure the Switchport
configure terminal
interface <interface>
switchport mode hybrid
switchport pvid <nativevlan>
end
-
Configure the VLAN(s) for the Hybrid Switchport, note that VLAN 10 is the Native VLAN for this example so is added as untagged in the VLAN 10 configuration
configure terminal
vlan <vlan>
ports add <interface> untagged <interface>
end
Trunk Port
-
Log in to the cnMatrix Switch via a terminal application such as PuTTy
-
Create your Layer 2 VLAN interfaces if they haven’t been created already
-
Configure the Switchport
configure terminal
interface <interface>
switchport mode trunk
end
-
Configure the VLAN(s) for the Trunk Switchport adding all VLANs that will be tagged
configure terminal
vlan <vlan>
ports add <interface>
Useful Troubleshooting Commands
To check the VLAN created in ports’ membership:
show vlan brief
To check the operation mode of each interface:
show vlan port Gigabitethernet 0/2
To check the interface status:
show interface status
To check the ingress/egress counters on each interface:
show interface counters
To check the global status for the specified VLAN range:
show vlan ascending
show mac-address-table [vlan <vlan-range>]