How do I configure VLANs on cnMatrix Switches via CLI

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

  1. Log in to the cnMatrix Switch via a terminal application such as PuTTy

  2. Create your Layer 2 VLAN interface(s) if they haven’t been created already

    configure terminal
    vlan <vlan>

    CLI1

  3. Configure the Switchport

    configure terminal
    interface <interface>
    switchport acceptable-frame-type untaggedAndPrioritytagged
    switchport mode access
    switchport access vlan <vlan>
    exit

    CLI2

  4. Configure the VLAN for the Access Switchport

    configure terminal
    vlan <vlan>
    ports add <interface> untagged <interface>

    CLI3

Hybrid Port

  1. Log in to the cnMatrix Switch via a terminal application such as PuTTy

  2. Create your Layer 2 VLAN interfaces if they haven’t been created already

    configure terminal
    vlan <vlan>

    CLI1

  3. Configure the Switchport

    configure terminal
    interface <interface>
    switchport mode hybrid
    switchport pvid <nativevlan>
    end

    CLIHybrid1

  4. 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

    CLIHybrid2

Trunk Port

  1. Log in to the cnMatrix Switch via a terminal application such as PuTTy

  2. Create your Layer 2 VLAN interfaces if they haven’t been created already

    CLI1

  3. Configure the Switchport

    configure terminal
    interface <interface>
    switchport mode trunk
    end

    CLITrunk

  4. Configure the VLAN(s) for the Trunk Switchport adding all VLANs that will be tagged

    configure terminal
    vlan <vlan>
    ports add <interface>

    CLITrunk2

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>]

2 Likes