Search the VMware Knowledge Base (KB)
View by Article ID

Configuring a VLAN on a portgroup (1003825)

  • 29 Ratings

Symptoms

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

Purpose

This article provides information on adding and removing VLAN IDs to and from a portgroup.

Note: Making changes to the service console portgroup (or management VMkernel in ESXi) from either the vSphere Client or an SSH session may cause the host to lose management network connectivity. When working on the service console or management VMkernel portgroups, it is best to use a remote console (such as ILO, DRAC, or an equivalent), or to work at the physical console of the server.

Resolution

Changing the VLAN ID using the vSphere Client or VMware Infrastructure Client


To change the VLAN ID using the vSphere Client or VMware Infrastructure Client:
  1. Click the ESXi/ESX host and click the Configuration tab.
  2. Click the Networking link.
  3. Click Properties next to the virtual switch that serves the portgroup to be modified.
  4. Click 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.
To change the VLAN ID using the vSphere Web Client:

  1. In the vSphere Web Client, navigate to the host.
  2. On the Manage tab, click Networking, and select Virtual switches.
  3. Select a standard switch from the list.
  4. In the topology diagram of the switch, click the name of the port group.
  5. Click Edit under the topology diagram title.
  6. In the Properties section, Configure VLAN tagging in the VLAN ID drop-down menu.

Changing the VLAN ID at the ESXi/ESX host using the console


To change the VLAN ID at the ESXi/ESX host using the console:

  1. Log into the service console as root via SSH, remote console, or at the physical console.

    For more information, see:


  2. To view the current configuration of the virtual switches, run the command:

    [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.
  4. To change the VLAN ID on a portgroup, run the command:

    [root@server root]# esxcfg-vswitch -p "portgroup_name" -v VLAN_IDvirtual_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 run the command:

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

  5. To verify the new configuration, run the command:

    [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


  6. To resolve connectivity and configuration issues, use these commands to link or unlink the vmnic on standard vSwitches:

    • To unlink an uplink:

      esxcfg-vswitch -U vmnic vSwitch

    • To add an uplink:

      esxcfg-vswitch -L vmnic vSwitch

Additional Information

Tags

configuration-change configuration-error connection-failure esx improper-configuration no-connectivity no-network port-group service-console virtual-network

See Also

Update History

11/09/2012 - Added ESXi 5.x to Products

Request a Product Feature

To request a new product feature or to provide feedback on a VMware product, please visit the Request a Product Feature page.

Feedback

  • 29 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? (4000 or fewer characters)




Please enter the Captcha code before clicking Submit.
  • 29 Ratings
Actions
KB: