VLAN

VLAN

1. Function Overview

VLAN (Virtual LAN) is technology that allows a LAN to be constructed virtually, without regard to the physical structure of connections.
This product lets you use VLANs to divide the LAN into multiple broadcast domains.
The VLANs that are supported by this product are shown below.

VLAN types Summary

Port-based VLAN

Groups that can communicate are configured for each LAN port.

Tagged VLAN

Groups that can communicate are identified, based on the fixed-length tag information appended to the Ethernet frame.
Multiple and different VLANs can be made to communicate by means of one LAN port.

2. Definition of Terms Used

Broadcast domain

This is a range in which broadcast frames can be delivered in a network, such as an Ethernet.
Devices that are connected by relaying a data link layer (MAC layer), such as switching hubs, can belong to the same broadcast domain.
A broadcast domain generally refers to the network in an Ethernet.

3. Function Details

3.1. Defining a VLAN ID

On product, a maximum of 255 VLANs can be defined, with VLAN IDs ranging from 2–4094. (ID #1 is used as the default VLAN ID.)
VLAN IDs are defined using the vlan command, after the vlan database command is used to enter VLAN mode.
For details, refer to the Command Reference.

3.2. VLAN settings for the LAN ports

The following settings must be configured after defining the VLANs to use, in order to make use of VLAN on this product.

  • LAN port mode settings

  • VLAN associations for LAN ports

  1. The LAN ports on this product are set to one of the following modes.

    • Access port
      This is a port that handles untagged frames. It can be associated with one VLAN.

    • Trunk port
      This is a port that handles both tagged and untagged frames.
      It can be associated with multiple VLANs, and is mainly used to connect switches to one another.
      This product only supports IEEE 802.1Q. (Cisco ISL is not supported.)

  2. Use the switchport mode command to set the LAN port mode.
    When setting the trunk port, use the input filter (“ingress-filter”) to control whether frames not belonging to the specified VLAN ID will be handled.

    • Input filter enabled: Only frames set to the specified VLAN ID will be handled.

    • Input filter disabled: Frames with any VLAN ID will be handled.

  3. Use the show interface switchport command to check the LAN port setting mode.

  4. Use the switchport access vlan command to set which VLANs belong to the access port.

  5. Use the switchport trunk allowed vlan command to set which VLANs belong to the trunk port.
    As the trunk port can be associated with multiple VLANs, use the “all”, “none”, “except”, “add” and “remove” settings as shown below.

    • add
      Adds the specified VLAN ID.
      VLAN IDs that can be added are limited by the IDs that are defined by the VLAN mode.

    • remove
      Deletes the specified VLAN ID.

    • all
      Adds all VLAN IDs specified by the VLAN mode.
      The VLAN IDs added by the VLAN mode can also be added after this command is executed.

    • none
      The trunk port will not be associated with any VLAN.

    • except
      Adds all other VLAN IDs except for the ones specified.
      The VLAN IDs added by the VLAN mode can also be added after this command is executed.

  6. A VLAN that uses untagged frames (native VLAN) can be specified for the trunk port.

  7. Use the show vlan command to check which VLANs belong to a LAN port.

3.3. Default VLAN

The default VLAN is VLAN #1 (vlan1), which exists in this switch by default.
As the default VLAN is a special VLAN, it always exists and cannot be deleted.
The following operations can be used to automatically delete the relevant port from the default VLAN.

  • Setting any VLAN other than the default as the VLAN for the access port

  • Setting any VLAN other than the default as the native VLAN for the trunk port

  • Setting the native VLAN for the trunk port to “none”

3.4. Native VLAN

A native VLAN is a VLAN that associates untagged frames received by the LAN port that was set as a trunk port.
Defining a LAN port as a trunk port will set the default VLAN (VLAN #1) as the native VLAN.
Use the switchport trunk native vlan command when specifying a certain VLAN as the native VLAN.
If you do not want to handle untagged frames on the LAN port, you can set the native VLAN to none. (Specify “none” with the “switchport trunk native vlan” command.)

4. Related Commands

4.1. List of related commands

Related commands are indicated below.
For details, refer to the Command Reference.

Operations Operating commands

Enter VLAN mode

vlan database

Define VLAN interface, or change a predefined VLAN

vlan

Set access port (untagged port)

switchport mode access

Set associated VLAN of an access port (untagged port)

switchport access vlan

Set trunk port (tagged port)

switchport mode trunk

Set associated VLAN for trunk port (tagged port)

switchport trunk allowed vlan

Set native VLAN for trunk port (tagged port)

switchport trunk native vlan

Show VLAN information

show vlan

5. Examples of Command Execution

5.1. Port-based VLAN settings

In this example, a port-based VLAN is configured for this product in order to allow communication between hosts A–B and hosts C–D.

image

The LAN port settings for this product are as follows.

  • LAN ports #1 and #2: Set as access port, and associated with VLAN #1000

  • LAN ports #3 and #4: Set as access port, and associated with VLAN #2000

■ Setting Procedure

  1. Switch to VLAN mode using the vlan database command, and define two VLANs using the vlan command.

    Yamaha(config)# vlan database (1)
    Yamaha(config-vlan)# vlan 1000 (2)
    Yamaha(config-vlan)# vlan 2000 (3)
    Yamaha(config-if)# exit
    1 Switch to VLAN mode
    2 Create VLAN #1000
    3 Create VLAN #2000
  2. Set LAN ports #1–2 as access ports, and associate them with VLAN #1000.

    Yamaha(config)# interface port1.1 (1)
    Yamaha(config-if)# switchport mode access (2)
    Yamaha(config-if)# switchport access vlan 1000 (3)
    Yamaha(config-if)# interface port1.2 (4)
    Yamaha(config-if)# switchport mode access (5)
    Yamaha(config-if)# switchport access vlan 1000 (6)
    Yamaha(config-if)# exit
    1 Switch to interface mode
    2 Set the ports as access port
    3 Define a VLAN ID
    4 Switch to interface mode
    5 Set the ports as access port
    6 Define a VLAN ID
  3. Set LAN ports #3–4 as access ports, and associate them with VLAN #2000.

    Yamaha(config)# interface port1.3
    Yamaha(config-if)# switchport mode access
    Yamaha(config-if)# switchport access vlan 2000
    Yamaha(config-if)# interface port1.4
    Yamaha(config-if)# switchport mode access
    Yamaha(config-if)# switchport access vlan 2000
    Yamaha(config-if)# exit
  4. Confirm the VLAN settings.

    Yamaha#show vlan brief
    (u)-Untagged, (t)-Tagged
    VLAN ID  Name            State   Member ports
    ======= ================ ======= ===================================
    1       default          ACTIVE  port1.5(u) port1.6(u) port1.7(u)
                      port1.8(u) port1.9(u) port1.10(u)
    1000    VLAN1000         ACTIVE  port1.1(u) port1.2(u)
    2000    VLAN2000         ACTIVE  port1.3(u) port1.4(u)

5.2. Tagged VLAN settings

In this example, a tagged VLAN is configured between #A and #B of this product, in order to communicate between hosts A–B and hosts C–D.

image

The LAN port settings for #A and #B of this product are as follows.

  • LAN port #1: Set as access port, and associated with VLAN #1000

  • LAN port #2: Set as access port, and associated with VLAN #2000

  • LAN port #3: Set as trunk port, and associated with LAN #1000 and VLAN #2000

  1. [Switch #A/#B] Define VLAN.

    Yamaha(config)#vlan database (1)
    Yamaha(config-vlan)#vlan 1000 (2)
    Yamaha(config-vlan)#vlan 2000 (3)
    1 Switch to vlan mode
    2 Define VLAN #1000
    3 Define VLAN #2000
  2. [Switch #A/#B] Set LAN port #1 as the access port, and associate it with VLAN #1000.

    Yamaha(config)#interface port1.1 (1)
    Yamaha(config-if)#switchport mode access (2)
    Yamaha(config-if)#switchport access vlan 1000 (3)
    Yamaha(config-if)#exit
    1 Switch to interface mode
    2 Set the ports as access port
    3 Associate it with VLAN #1000
  3. [Switch #A/#B] Set LAN port #2 as an access port, and associate it with VLAN #2000.

    Yamaha(config)#interface port1.2 (1)
    Yamaha(config-if)#switchport mode access (2)
    Yamaha(config-if)#switchport access vlan 2000 (3)
    Yamaha(config-if)#exit
    1 Switch to interface mode
    2 Set the ports as access port
    3 Associate it with VLAN #2000
  4. [Switch #A/#B] Set LAN port #3 as a trunk port, and associate it with VLAN #1000/#2000.

    Yamaha(config)#interface port1.3 (1)
    Yamaha(config-if)#switchport mode trunk (2)
    Yamaha(config-if)#switchport trunk allowed vlan add 1000 (3)
    Yamaha(config-if)#switchport trunk allowed vlan add 2000 (4)
    Yamaha(config-if)#exit
    1 Switch to interface mode
    2 Set the port as trunk port
    3 Add VLAN #1000
    4 Add VLAN #2000
  5. Confirm the VLAN settings.

    Yamaha#show vlan brief
    (u)-Untagged, (t)-Tagged
    
    VLAN ID Name                             State   Member ports
    ======= ================================ ======= ===================================
    1       default                          ACTIVE  port1.3(u) port1.4(u) port1.5(u)
                                                     port1.6(u) port1.7(u) port1.8(u)
                                                     port1.9(u) port1.10(u)
    1000    VLAN1000                         ACTIVE  port1.1(u) port1.3(t)
    2000    VLAN2000                         ACTIVE  port1.2(u) port1.3(t)