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
or by using vSphere CLI commands.
You can create a maximum of 127
virtual switches on a single
host. By
default, each
host has a
single virtual switch called
vSwitch0
. By default, a virtual switch has 56 logical
ports. See the
Configuration
Maximums
document on the vSphere documentation main page for details.
Ports connect to the virtual machines and the
physical
network adapters.
- You can connect one virtual machine network adapter to each port by using the UI.
- You can connect the uplink adapter to the virtual switches by usingvicfg-vswitchoresxcli network vswitch standard uplink. See Linking and Unlinking Uplink Adapters with vicfg-vswitch.
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.
- 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 and Retrieving Information About Virtual Switches with vicfg-vswitch.
- Add a virtual switch. See Adding and Deleting Virtual Switches with ESXCLI and Adding and Deleting Virtual Switches with vicfg-vswitch.
- For a newly added switch, perform these tasks.
- Add a port group. See Managing Port Groups with ESXCLI and Managing Port Groups with vicfg-vswitch.
- Set the port group VLAN ID. See Setting the Port Group VLAN ID with ESXCLI and Setting the Port Group VLAN ID with vicfg-vswitch.
- Add an uplink adapter. See Linking and Unlinking Uplink Adapters with ESXCLI and Linking and Unlinking Uplink Adapters with vicfg-vswitch.
- Change the MTU or CDP settings. See Setting Switch Attributes with ESXCLI and Setting Switch Attributes with vicfg-vswitch.