This is a simple step-by-step guide to adding / assigning a vLAN to a vSwitch virtual machine network on VMware ESXi and vSphere 5, 5.5, and 6. Another way of putting it is adding a port group to a vSwitch. It is a pretty straight forward process, but if you’ve never done it before it can be a little confusing. We are going to create a Virtual Machine Port Group (network) that is assigned exclusively to a vLAN ID. This guide assumes you have already created the vLAN on your switch and configured a trunk port to your virtualized infrastructure.
First, go ahead and log into the vSphere Client. Once you have done so, navigate to Home > Inventory > Hosts and Clusters (if using vSphere). If you are logging directly into an ESXi server, you should already be where you need to be immediately upon logging in. Select your ESXi host in the left column, and then select the Configuration tab. Once you are on the Configuration page, select Networking. Select the Properties of the vSwitch you would like your vLAN to be assigned to. In my case, I’m selecting the properties of vSwitch0.
Now, we need to add a port group exclusive to the vLAN. Click on Add.