VMware
 

Knowledge Base

Search the Knowledge Base:

Products:
Search In:
 

Configuring a VLAN on a portgroup

Symptoms

  • Loss of network connectivity to and from the ESX Server host
  • Loss of connectivity to associated portgroups

Purpose

This article explains adding and removing VLAN IDs to and from a portgroup.

Note: Making changes to the service console portgroup from either the Virtual Infrastructure Client or an SSH session may cause you to become disconnected. When working on the service console portgroup, it is best to use a remote console (such as ILO, DRAC or equivalent), or work at the physical console of the server.

Resolution

Changing the VLAN ID from within the Virtual Infrastructure Client

To change the VLAN ID from within the Virtual Infrastructure Client:

  1. Highlight the ESX Server host and c lick the Configuration tab.
  2. Click the Networking link.
  3. Click Properties next to the virtual switch that serves the portgroup to be modified.
  4. Highlight the portgroup in the list and click Edit.
  5. Enter the appropriate value in the VLAN ID field (enter 0 for no VLAN).
  6. Click OK.

Changing the VLAN ID at the ESX Server service console

To change the VLAN ID at the ESX Server service console:

  1. Log in to the service console as root via SSH, remote console, or at the physical console.
  2. Type the following command and press Enter to see the current configuration of the virtual switches:

    [root@server root]# esxcfg-vswitch -l

    The output appears similar to:

    Switch Name    Num Ports   Used Ports  Configured Ports  Uplinks
    vSwitch0       32          4           32                vmnic0

     
    PortGroup Name      Internal ID    VLAN ID  Used Ports  Uplinks
      VM Network 0        portgroup1     0        0           vmnic0
      Service Console     portgroup0     0        1           vmnic0

    Switch Name    Num Ports   Used Ports  Configured Ports  Uplinks
    vSwitch1       64          2           64                vmnic1

      PortGroup Name      Internal ID    VLAN ID  Used Ports  Uplinks
      VM Network 1        portgroup19    0        0           vmnic1

    Note: Your virtual switch and portgroup names may be different.

  3. Record the name of the virtual switch and portgroup that you want to change. The command to change the VLAN ID on a portgroup is:

    [root@server root]# esxcfg-vswitch -p "<portgroup name>" -v <VLAN_ID> <virtual switch name>

    where <portgroup name> is the name of your portgroup and <virtual switch name> is the name of your virtual switch.

    For example, using the configuration above, to add a VLAN ID of 10 to VM Network 1 (which resides on vSwitch1), you must enter the command:

    [root@server root]# esxcfg-vswitch -p "VM Network 1" -v 10 vSwitch1

  4. To verify the new configuration, type the following command and press Enter:

    [root@server root]# esxcfg-vswitch -l

    The output appears similar to:

    Switch Name    Num Ports   Used Ports  Configured Ports  Uplinks
    vSwitch1       64          2           64                vmnic1

      PortGroup Name      Internal ID    VLAN ID  Used Ports  Uplinks
      VM Network 1        portgroup19    10       0           vmnic1

  5. To resolve connectivity and configuration issues:

    Linking and unlinking  to proper vmnic

    For regular vSwitches:

    esxcfg-vswitch -U <vmnic> <vSwitch>                  #unlink an uplink.
    esxcfg-vswitch -L <vmnic> <vSwitch>                  # add an uplink.

For additional Information, see Sample configuration of virtual switch VLAN tagging (VST Mode) and ESX Server (1004074).

Feedback

Rating: 1 - Lowest 2 3 4 5 - Highest (3 Ratings)   

Did this article help you?
This article resolved my issue.
This article did not resolve my issue.
This article helped but additional information was required to resolve my issue.
What can we do to improve this information? (2000 or fewer characters)
Submit
Rating: 1 - Lowest 2 3 4 5 - Highest (3 Ratings)   
Actions