Setting Up Virtual Switches and Associating a Switch with a Network Interface

A virtual switch models a physical Ethernet switch. You can manage virtual switches and port groups by using the vSphere Client or ESXCLI commands.

By default, each ESXi host has a single virtual switch called vSwitch0. Each virtual switch has logical ports. For information about maximum allowed virtual switches and ports, see the VMware Configuration Maximums tool. Ports connect to the virtual machines and the ESXi physical network adapters.

  • You can connect one virtual machine network adapter to each port by using the vSphere Client UI.
  • You can connect the uplink adapter to the virtual switches by using esxcli network vswitch standard uplink. See Linking and Unlinking Uplink Adapters with ESXCLI.

When two or more virtual machines are connected to the same virtual switch, network traffic between them is routed locally. If an uplink adapter is attached to the virtual switch, each virtual machine can access the external network that the adapter is connected to.

This section discusses working in a standard switch environment. See Networking Using vSphere Distributed Switches for information about distributed switch environments.

When working with virtual switches and port groups, perform the following tasks.

  1. Find out which virtual switches are available and, optionally, what the associated MTU and CDP (Cisco Discovery Protocol) settings are. See Retrieving Information About Virtual Switches with ESXCLI.
  2. Add a virtual switch. See Adding and Deleting Virtual Switches with ESXCLI.
  3. For a newly added switch, perform these tasks.
    1. Add a port group. See Managing Port Groups with ESXCLI.
    2. (Optional) Set the port group VLAN ID. See Setting the Port Group VLAN ID with ESXCLI.
    3. Add an uplink adapter. See Linking and Unlinking Uplink Adapters with ESXCLI.
    4. (Optional) Change the MTU or CDP settings. See Setting Switch Attributes with ESXCLI.