How to Create a Virtual Switch in VMware ESXi

Author: Rusty Hann
URL: www.rustyhann.com
How to Create a Virtual Switch in VMware ESXi
I am not responsible for your actions or their outcomes, in any way, while
reading and/or implementing this tutorial. I will not provide support for the
information herein. If you do not understand something, figure it out on your
own. If you need help figuring it out, use Google to solve your problems.
Introduction
Virtual Switches are used to create a connection between physical network hosts and virtual
network hosts. This connection is created by using a physical network interface card (NIC) to connect to
a physical switch, router, or other network device. This process is very similar to stacking switches to
create more port density in a networked environment. The virtual machines, servers or clients, are then
connected to the virtual switch, which is connected to the physical network by way of the NIC assigned
to the switch.
A virtual switch is also capable of some of the advanced features of a physical switch such as
port trunking (802.3ad Link aggregation) and VLAN tagging (802.1q). Multiple NICs can be assigned to a
virtual switch to provide load balancing, increased bandwidth, and connection redundancy (failover).
With the use of virtual appliances, or a routing capable network operating system, traffic can be
routed within the virtual environment between virtual switches on disparate networks.
This tutorial will cover how to create a virtual switch and assign it a single NIC to provide
connectivity to physical network hosts outside the virtual environment. See the tutorial, “How to Create
VLANs within a Virtual Switch in VMware ESXi”, for information regarding the creation and
implementation of VLANs within a virtual switch.
As a final note, all industry standard networking concepts apply to virtual switches in VMware
ESXi. IP addressing must be set correctly on the virtual machines in order for the switch to work
properly. A physical connection with the NIC assigned to the switch must be present and functional.
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported
License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send
a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
Author: Rusty Hann
URL: www.rustyhann.com
Steps
1. Log in to the VMware ESXi server using the vSphere client. Ensure you are viewing the inventory.
The following screenshot should serve as a starting point.
NOTES: Most VMware specific tutorials will start from this screen.
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported
License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send
a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
Author: Rusty Hann
URL: www.rustyhann.com
2. Switch to the configuration tab and select the Networking section under the Hardware heading.
NOTES: A default virtual switch is created upon installing VMware ESXi. This is the initial virtual switch
you will see when looking at the network configuration of an ESXi host. This switch will be labeled
vSwitch0 unless the switch name has been changed.
This switch hosts the Main port group, and the Management Network port. A best practice is to not put
virtual machines on this virtual switch and leave the virtual switch and the physical NIC attached to the
virtual switch dedicated to the management of the ESXi server.
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported
License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send
a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
Author: Rusty Hann
URL: www.rustyhann.com
3. Click Add Networking.
NOTES:
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported
License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send
a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
Author: Rusty Hann
URL: www.rustyhann.com
4. Ensure the radio button next to, "Virtual Machine", is selected and click the Next button.
NOTES: Unless you are using services such as VMware vMotion, iSCSI, NFS, or a managing another host,
you will select the, "Virtual Machine", radio button.
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported
License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send
a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
Author: Rusty Hann
URL: www.rustyhann.com
5. Select the physical NIC you will use to connect the virtual switch to other physical resources on the
network and click Next.
NOTES: Listed under, “Create a virtual switch”, are the unassigned network cards currently installed in
your physical ESXi server. In this example vmnic3 is already assigned to vSwitch0, the virtual switch used
for the Main port group and the management network port. It is possible to assign this physical NIC to
the virtual switch you are creating. This action is HIGHLY DISCOURAGED. Doing this would remove the
connection to vSwitch0 provided by vmnic3 and place it on the virtual switch you are creating. Your
connection to the ESXi server would be broken and you could no longer manage the ESXi host. You
would need to reassign vmnic3 to the management network using the physical console of the server
running ESXi. If a NIC that is connected to other virtual machines is selected, instead of the NIC assigned
to the management network, those connections would be lost also.
Removing and reassigning a physical NIC to a new virtual switch should only be done if all virtual
machines are determined to no longer require connectivity. The physical NIC connected to the
management network should not be reassigned unless you are absolutely sure you are performing the
right procedure.
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported
License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send
a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
Author: Rusty Hann
URL: www.rustyhann.com
6. Assign a Network Label to the virtual switch and a VLAN ID if necessary. Click the Next button. See
the tutorial, “How to Create VLANs within a Virtual Switch in VMware ESXi”, for further information
regarding VLANs within ESXi.
NOTES: The Network Label assigned to the virtual switch will be for the default port group. If a VLAN is
created, those ports will be located under the Network Label assigned to the VLAN.
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported
License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send
a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
Author: Rusty Hann
URL: www.rustyhann.com
7. Verify that your virtual switch settings are correct (physical NIC assigned, Network Label, and
switch type), and click the Finish button.
NOTES:
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported
License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send
a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
Author: Rusty Hann
URL: www.rustyhann.com
Wrap UP
If you return to the Networking Configuration tab of the ESXi host, you will see the Virtual
Switch added as vSwitch1 with the Network Label you entered as the name of the default port group.
You should also see the physical network adapter you attached to the switch, which in this tutorial is
vmnic3.
NOTES:
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported
License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send
a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
Author: Rusty Hann
URL: www.rustyhann.com
Troubleshooting
•
•
•
Ensure the physical NIC assigned to the virtual switch is correctly connected to the physical
network. If the adapter has a red 'X' over the icon, a problem with the physical connection is the
present.
Ensure virtual machine network settings are set correctly for the network the virtual machine is
connected to (IP address, subnet mask, default gateway, etc.) These settings will be
implemented within the virtual machine itself, not in the ESXi management interface provided
by the vSphere client.
You will most likely not have problems with the virtual switch itself, unless a VLAN is improperly
configured. See the tutorial, “How to Create VLANs Within a Virtual Switch in VMware ESXi”,
for further information.
I am not responsible for your actions or their outcomes, in any way, while
reading and/or implementing this tutorial. I will not provide support for the
information herein. If you do not understand something, figure it out on your
own. If you need help figuring it out, use Google to solve your problems.
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported
License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send
a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.