For AI agents: the complete documentation index is available at https://docs.us.ovhcloud.com/en/llms.txt, the full documentation bundle is available at https://docs.us.ovhcloud.com/en/llms-full.txt, and this page is available as Markdown at https://docs.us.ovhcloud.com/en/bare-metal-cloud/dedicated-servers/deploy-vlans-vmware-esxi.md.
  • English

How to deploy VLANs with VMware ESXi

View as Markdown

Requirements

 

Instructions

Setting up VLANs in VMware ESXi

VMware ESXi 6.5 will handle all traffic routing for any VMs on its host. Therefore, we first need to configure networking in ESXi to route traffic over the VLAN(s) we choose.

From the ESXi Host Client, add a port group by clicking Networking > Add a port group.

Enter a Name, a VLAN ID between 2 and 4000, and click Add.

Add port group

Warning

NOTE: This example assumes you're changing settings on an existing VM. However, these settings can also be configured during VM creation in ESXi.

In the left-hand menu, click Virtual Machines and select your VM.

Make sure your VM is powered off, then click the Edit button.

VM details - Deploy VLANs VMware ESXi

To route our VLAN-tagged traffic, we need to add another network adapter to the VM.

In the pop-up window, click Add network adapter, select the port group you just created (vRack Network in this example), and click SAVE.

VM settings add vRack network

 

Configuring the network

For examples of how to set up networking on VMs running Ubuntu or Windows Server, see the tabs below. If you are running a different operating system, the setup required will vary.

Ubuntu 20.04+
Windows Server

The final step in configuring networking for VLAN-tagged traffic is to assign the NIC a private IP address to use for routing traffic. To do so, first access your server via SSH or the built-in ESXi console. Then, enter the following command to find the name of your second interface.

$ ip add
Warning

NOTE: By default, ESXi will assign the name ens192 to the second NIC if you are using the VMXNET3 adapter. If you are not using the default adapter, it will be the second interface in the list.

We will configure the NIC that is not already configured for public networking (the one without an IP address assigned to it). To do so, open the Netplan configuration file in a text editor of your choice using the following command:

$ sudo vi /etc/netplan/01-netcfg.yaml

Once in the file, edit it to appear as follows. If you have already configured the public NIC, create the entry for the private NIC, directly below the public one. Do not delete the public NIC from the file.

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    ens192:
      dhcp4: no
      addresses: [192.168.0.1/24]
Warning

NOTE: You can use any private IP address you choose. The CIDR notation will determine the subnet on which the different IP addresses can communicate with one another. All IPs on a VLAN must exist on the same subnet.

Save and exit the file and then apply the changes using the following command:

$ sudo netplan apply

 

Go further

Browse all the Dedicated Servers guides.

Browse the rest of the OVHcloud US documentation for guides on our other products and services.

Learn more about Dedicated Servers on the OVHcloud US website.