Cisco Nexus 1000V Layer 2 Switching Configuration Guide, Release 4.2(1)SV2(2.1)
Configuring VLANs
Downloads: This chapterpdf (PDF - 1.19MB) The complete bookPDF (PDF - 2.52MB) | The complete bookePub (ePub - 310.0KB) | Feedback

Configuring VLANs

Configuring VLANs

This chapter contains the following sections:

Information About VLANs

Physical NICs are always assigned as trunk ports that transmit either VLAN tagged or untagged packets. A vswitch can have the following VLAN configurations:

Configuration Description

External Switch Tagging (EST)

Physical NICs are untagged and all vNICs are access ports. EST is enabled by default and is used when the VLAN for the vNIC is set to 0 or left blank.

Virtual Switch Tagging (VST)

All physical NIC ports are tagged and vNICs are access ports. VST is enabled whenever the vNIC’s VLAN is set to any value between 1 and 4094, inclusive.

Virtual Machine Guest Tagging (VGT)

All physical NIC ports are tagged. vNICs are trunk ports. To configure VGT, the VLAN is set to 4095 on the vNIC that is connected to the Virtual Machine (VM).

Physical ports are always trunk ports by default. The VM interfaces can be either access ports or trunk ports.

vEthernet interfaces that are assigned to specific VLANs are tagged with the VLAN when transmitted. A vEthernet interface that is not assigned to a specific VLAN, or assigned to VLAN 0, is transmitted as untagged on the physical NIC interfaces. When the VLAN is not specified, it is assumed to be 0.

The following table summarizes the actions taken on packets that are received by the Virtual Ethernet Module (VEM) based on VLAN tagging.

Table 1 VEM Action on VLAN Tagging
Port Type Packet received Action

Access

Tagged

The packet is dropped.

Access

Untagged

The VEM adds access VLAN to the packet.

Trunk

Tagged

No action is taken on the packet.

Trunk

Untagged

The VEM adds native VLAN tag to packet.

Guidelines and Limitations

In accordance with the IEEE 802.1Q standard, up to 4094 VLANs (from 1 to 4094) are supported in the Cisco Nexus 1000V, and are listed in the following table.


Note


For VLAN configuration limits, see Layer 2 Switching Configuration Limits.
Table 2 Cisco Nexus 1000V VLAN Numbering
VLAN Numbers Range Usage

1

Normal

Cisco Nexus 1000V default. You can use this VLAN, but you cannot modify or delete it.

2 to1005

Normal

You can create, use, modify, or delete these VLANs.

1006 to 4094

Extended

You can create, name, or use these VLANs. You cannot change the following parameters:

  • The state is always active.
  • These VLANs are always enabled. You cannot shut down these VLANs.

The extended system ID is always automatically enabled.

3968 to 4047 and 4094

Internally allocated

You cannot use, create, delete, or modify these VLANs. You can display these VLANs.

The Cisco Nexus 1000V allocates these 80 VLANs, plus VLAN 4094, for features, like diagnostics, that use internal VLANs for their operation.

Default Settings

Table 3 Default VLAN Settings
Parameters Default

VLAN assignment for all interfaces and all ports configured as switchports

VLAN 1

VLAN name

VLANxxxx where xxxx represent four numeric digits (including leading zeroes) equal to the VLAN ID number

Shut state

No shutdown

Operational state

Active

External Switch Tagging (EST)

Enabled

Physical ports

Trunk ports

IGMP snooping

Enabled

Configuring a VLAN

Creating a VLAN

You can do one of the following:

  • Create a single VLAN that does not already exist.
  • Create a range of VLANs that does not already exist.
  • Delete an existing VLAN.

Note


All interfaces and all ports configured as switchports are in VLAN 1 by default.


Before You Begin
  • Log in to the CLI in EXEC mode.
  • Know that VLAN characteristics are configured in the VLAN configuration mode. To configure a VLAN that is already created, see Configuring VLAN Characteristics.
  • Be familiar with the VLAN numbering in the Guidelines and Limitations.
  • Know that newly created VLANs remain unused until Layer 2 ports are assigned to them.
  • Know that when you delete a specified VLAN, the ports associated to that VLAN are shut down and no traffic flows. When you delete a specified VLAN from a trunk port, only that VLAN is shut down and traffic continues to flow on all the other VLANs through the trunk port. However, the system retains all the VLAN-to-port mapping for that VLAN, and when you reenable, or re-create, that specified VLAN, the system automatically reinstates all the original ports to that VLAN. Note that the static MAC addresses and aging time for that VLAN are not restored when the VLAN is reenabled.

Note


Be aware that the Cisco NX-OS commands may differ from those commands used in Cisco IOS.


Procedure
      Command or Action Purpose
    Step 1 switch# configure terminal 

    Enters global configuration mode.

     
    Step 2 switch(config)# show vlan 

    Displays the VLANs that already exist.

     
    Step 3 switch(config)# [no] vlan {vlan-id | vlan-range} 

    Creates or deletes, and saves in the running configuration, a VLAN or a range or VLANs.

    To configure the VLAN, see Configuring VLAN Characteristics.

    Note    If you enter a VLAN ID that is assigned to an internally allocated VLAN, the system returns an error message.

    From the VLAN configuration mode, you can also create and delete VLANs.

    For information about Assigning Layer 2 interfaces to VLANs (access or trunk ports), see the Cisco Nexus 1000V Interface Configuration Guide.

    For information about configuring ports as VLAN access or trunk ports and assigning ports to VLANs, see the Cisco Nexus 1000V Interface Configuration Guide.

     
    Step 4 switch(config-vlan)# show vlan id vlan-id  (Optional)

    Displays the VLAN configuration.

     
    Step 5 switch(config-vlan)# copy running-config startup-config  (Optional)

    Saves the running configuration persistently through reboots and restarts by copying it to the startup configuration.

     

    In this example, VLAN 5 is created and you are automatically placed into the VLAN configuration mode for VLAN 5:

    switch# configure terminal
    switch(config)# vlan 5
    switch(config-vlan)# 
    

    This example shows the range, VLAN 15 to 20, being created. The VLANs in the range are activated, and you are automatically placed into VLAN configuration mode for VLANs 15 to 20.


    Note


    If you create a range of VLANs that includes an unusable VLAN, all VLANs in the range are created except those that are unusable; and Cisco Nexus 1000V returns a message listing the failed VLANs.


    switch# configure terminal 
    switch(config)# vlan 15-20
    switch(config-vlan)#
    

    This example shows how to delete VLAN 3967:

    switch# configure terminal
    switch(config)# no vlan 3967
    switch(config)# 
    

    This example shows how to display the VLAN 5 configuration:

    switch# configure terminal 
    switch(config)# vlan 5
    switch(config-vlan)# show vlan id 5
    
    VLAN Name                             Status    Ports
    ---- -------------------------------- --------- -------------------------------
    5    VLAN0005                         active    
    
    VLAN Type
    ---- -----
    5    enet  
    
    Remote SPAN VLAN
    ----------------
    Disabled 
    
    Primary  Secondary  Type             Ports
    -------  ---------  ---------------  -------------------------------------------
    
    n1000v(config-vlan)# copy run start
    [########################################] 100%
    n1000v(config)# 
    

    Configuring VLAN Characteristics

    You can do the following for a VLAN that has already been created:


    Note


    Commands entered in the VLAN configuration mode are immediately saved to the running configuration.


    • Name the VLAN.
    • Configure the operational state (active or suspend) of the VLAN.
    • Configure the VLAN media type (Ethernet).
    • Shut down switching on the VLAN.
    Before You BeginLog in to the CLI in EXEC mode.

    Note


    Some characteristics cannot be modified on some VLANs. For more information, see the VLAN numbering described in the Guidelines and Limitations.


    Procedure
        Command or Action Purpose
      Step 1 switch# configure terminal 

      Enters global configuration mode.

       
      Step 2 switch(config)# vlan {vlan-id | vlan-range} 

      Enters VLAN configuration mode for the specified VLAN.

      Note   

      If the VLAN does not already exist, the system creates it and then enters the VLAN configuration mode for that VLAN.

       
      Step 3 switch(config-vlan)# name vlan-name 

      Adds a name to the VLAN of up to 32 alphanumeric characters.

      • You cannot change the name of VLAN1 or the VLANs that are reserved for internal use.
      • The default name is VLANxxxx where xxxx represent four numeric digits (including leading zeroes) equal to the VLAN ID number.
       
      Step 4 switch(config-vlan)# state {active | suspend} 

      Changes the operational state of the VLAN and saves it in the running configuration.

      Allowable entries are as follows:

      • active (default)
      • suspend

      While the VLAN state is suspended, the ports associated with this VLAN are shut down, and that VLAN does not pass any traffic.

      Note   

      You cannot suspend the state for the default VLAN or VLANs 1006 to 4094.

       
      Step 5 switch(config-vlan)# no shutdown 

      Enables VLAN switching in the running configuration.

      Allowable entries are as follows:

      • no shutdown (default)
      • shutdown
      Note   

      You cannot shut down the default VLAN, VLAN1, or VLANs 1006 to 4094.

       
      Step 6 switch(config-vlan)# show vlan [id vlan-id]  (Optional)

      Displays the VLAN configuration.

       
      Step 7 switch(config-vlan)# copy running-config startup-config  (Optional)

      Saves the running configuration persistently through reboots and restarts by copying it to the startup configuration.

       

      This example shows how to configure VLAN characteristics:

      n1000v# configure terminal 
      n1000v(config)# vlan 5
      n1000v(config-vlan)# name accounting
      n1000v(config-vlan)# state active
      n1000v(config-vlan)# no shutdown
      n1000v(config-vlan)# show vlan brief
      
      VLAN Name                             Status    Ports
      ---- -------------------------------- --------- -------------------------------
      1    default                          active    Eth2/1, Eth2/2, Eth2/3, Eth2/5
                                                      Eth2/7, Eth2/8, Eth2/9, Eth2/10
                                                      Eth2/15, Eth2/21, Eth2/22
                                                      Eth2/23, Eth2/24, Eth2/25
                                                      Eth2/46, Eth2/47, Eth2/48
      5    accounting                       active    
      6    VLAN0006                         active    
      7    VLAN0007                         active    
      8    test                             active    
      9    VLAN0009                         active    
      10   VLAN0010                         active    
      50   VLAN0050                         active    Eth2/6
      100  trunked                          active    
      200  VLAN0200                         active    
      201  VLAN0201                         active    
      202  VLAN0202                         active    
      3966 VLAN3966                         active    
      n1000v(config)# 
      

      Verifying the Configuration

      Use one of the following commands to verify the configuration:

      Command Purpose

      show running-config vlan vlan-id

      Displays VLAN information in the running configuration.

      show vlan [all-ports | brief | id vlan-id | name name | dot1q tag native]

      Displays the specified VLAN information.

      show vlan summary

      Displays a summary of VLAN information.

      Feature History for VLANs

      Feature Name

      Feature Name

      Releases

      VLANs

      4.0(4)SV1(1)

      This feature was introduced.