How to create VLANs within a Virtual Switch in VMware ESXi

download How to create VLANs within a Virtual Switch in VMware ESXi

of 10

Transcript of How to create VLANs within a Virtual Switch in VMware ESXi

  • 8/10/2019 How to create VLANs within a Virtual Switch in VMware ESXi

    1/10

    Author: Rusty Hann

    URL: www.rustyhann.com

    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.

    How to Create VLANs Within 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

    VLANs in ESXi allow you to create disparate networks on the same virtual switch in VMware.

    They also allow you to connect a virtual switch, with the proper VLAN ID, to a physical switch that has

    the same VLAN ID assigned to it. Proper VLAN configuration on the physical switch is absolutely

    necessary to have physical hosts on a VLAN communicate with virtual hosts within the ESXi virtualization

    environment.

    This tutorial will cover two topics. The first portion of this tutorial will cover how to properly

    setup a Cisco switch to pass VLAN traffic to the ESXi hypervisor. The second portion of this tutorial will

    cover how to create a VLAN within an ESXi virtual switch and properly set switch characteristics to

    successfully receive and transmit VLAN traffic within the virtual and physical networking environments.

    For further information, refer to VMware Knowledge Base article located (at the time of this writing) at

    http://kb.vmware.com/selfservice/microsites/search.do?language=en US&cmd=displayKC&externalId=

    1004074

  • 8/10/2019 How to create VLANs within a Virtual Switch in VMware ESXi

    2/10

  • 8/10/2019 How to create VLANs within a Virtual Switch in VMware ESXi

    3/10

    Author: Rusty Hann

    URL: www.rustyhann.com

    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.

    Steps

    1. Start at the Inventory screen of the vSphere client.

    NOTES:

  • 8/10/2019 How to create VLANs within a Virtual Switch in VMware ESXi

    4/10

  • 8/10/2019 How to create VLANs within a Virtual Switch in VMware ESXi

    5/10

    Author: Rusty Hann

    URL: www.rustyhann.com

    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.

    3. Click the Add button.

    NOTES: The NIC teaming policy is set to its default value of, "Route based on originating virtual port ID",and will not be addressed in this tutorial.

  • 8/10/2019 How to create VLANs within a Virtual Switch in VMware ESXi

    6/10

    Author: Rusty Hann

    URL: www.rustyhann.com

    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.

    4. Ensure the Connection Type Virtual Machine is selected and click the Next button.

    NOTES:

  • 8/10/2019 How to create VLANs within a Virtual Switch in VMware ESXi

    7/10

    Author: Rusty Hann

    URL: www.rustyhann.com

    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.

    5. Give the VLAN a Network Label and VLAN ID, then click the Next button.

    NOTES:

  • 8/10/2019 How to create VLANs within a Virtual Switch in VMware ESXi

    8/10

    Author: Rusty Hann

    URL: www.rustyhann.com

    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.

    6. Click the Finish button.

    NOTES: You should see the VLAN you created under the Virtual Machine Port Group of the vSwitch you

    are working with.

  • 8/10/2019 How to create VLANs within a Virtual Switch in VMware ESXi

    9/10

    Author: Rusty Hann

    URL: www.rustyhann.com

    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.

    Wrap Up

    Take note of the new Network Label included with, in this example, vSwitch0. Traffic originating

    on VLAN ID 100, from a physical host, will be passed through switch and physical NIC, tagged with the

    appropriate VLAN ID (100), and then passed to the appropriate virtual machine located on Virtual

    Machine Port Group "Test" with VLAN ID 100. This will hold true for any traffic originating on any VLAN,

    as long as the physical switch and virtual switch are properly setup.

    NOTES: The, "Main", Virtual Machine Port Group is still present. This can be deleted if desired.

    Deleting the Virtual Machine Port Group, "Main", will not affect VLAN traffic nor improve performance.

    I usually do not delete the, "Main", port group.

  • 8/10/2019 How to create VLANs within a Virtual Switch in VMware ESXi

    10/10

    Author: Rusty Hann

    URL: www.rustyhann.com

    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.

    Troubleshooting

    Ensure the physical switch is properly configured

    Ensure the uplink to the server hosting the ESXi hypervisor is set to trunk mode

    Ensure traffic is not being mistakenly passed on the native VLAN of the physical switch

    Ensure your VLAN IDs match

    Ensure physical connectivity is correct

    Ensure the physical NIC is assigned to the correct virtual switch

    Ensure the network settings of the virtual machine(s) are correct (IP Address, default gateway,

    subnet mask, etc.)

    Ensure Inter-VLAN routing is correctly setup if present

    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.