Learn how to connect your VM to the Internet in VMware ESXi using OVHcloud Additional IPs.
NOTE: If you are using a Scale or HG server, please refer to the following guide instead: How to Configure the Network on VMware ESXi with SCALE and HG Servers.
Requirements
- A dedicated server with ESXi installed (hardware requirements are in the Broadcom documentation)
- A VM in your ESXi environment (How to Create a VM in VMware ESXi)
- An Additional IP through OVHcloud
OVHcloud Control Panel Access
- Direct link: Public IP addresses
-
Navigation path:
Bare Metal Cloud>Network>IP
Instructions
Adding a virtual MAC to an Additional IP
Find the Additional IP you wish to configure for your VM, click the more options ... button next to it, and choose the Add a virtual MAC option from the drop-down menu.
In the pop-up menu, change the Type to vmware and enter the name of your virtual machine.
NOTE: Please allow up to three minutes for the vMAC to populate in the OVHcloud Control Panel.
Adding the virtual MAC to the VM in ESXi
In the ESXi Host Client, locate your VM in the Virtual Machines menu, select it, and ⏻ Power off.
Right-click the VM and select the Edit settings option from the drop-down menu.
In the VM's settings, expand the Network Adapter 1 drop-down.
Change the MAC Address to Manual and enter the vMAC created in the previous step.
You can now ▶ Power on your VM!
Configuring network settings
The steps to configure the network on your virtual machine depend on the operating system you are using; select yours below.
If you don't know the name of your interface, you can find it using the following command:
First, open your interface configuration file in a text editor of your choice, using the following command:
Edit the interfaces file to make it appear as follows:
In this file, replace the following pieces of information as instructed:
-
address: Replace
192.0.2.1with the Additional IP from the first step of this guide. -
gateway: Replace
203.0.113.254with your Dedicated Server's gateway.You need the first three octets of your Dedicated Server's IP address with a final octet of "254". For example, if your Dedicated Server's IP was 1.2.3.4, you would use 1.2.3.254 as your gateway.
- dns-nameservers: The DNS name servers listed are from OpenDNS; feel free to use other name servers if you choose.
Now you will need to bring your NIC online. To do so, enter the following command:
Finally, restart your networking service using the following command:
Ubuntu (22.04 and later) and Debian (12 and later) both use Netplan for network configuration.
To configure the network interface, open the network configuration file /etc/netplan/ in a text editor of your choice. The exact file name may vary depending on your image — in this example, it's called 50-cloud-init.yaml.
Edit the file to make it appear as follows:
In this file, replace the following pieces of information as instructed:
-
ethernets: Replace
ens160with the name of your interface. If you don't know the name of your interface, you can find it using the following command: -
addresses: Replace
192.0.2.1/32with the Additional IP (in CIDR notation) from the first step of this guide. -
gateway4: Replace
203.0.113.254with your Dedicated Server's gateway.You need the first three octets of your Dedicated Server's IP address with a final octet of "254". For instance, if your Dedicated Server IP was 1.2.3.4, you would use 1.2.3.254 as your gateway.
- nameservers: The DNS name server addresses listed are from OpenDNS; feel free to use other name servers if you choose.
NOTE: The additional IP is configured with a host-only (/32) netmask, and the gateway sits outside that subnet — this is expected for OVHcloud Additional IPs. The routes: section above tells Netplan to treat the gateway as directly reachable. Omitting it — relying on gateway4 alone — can leave the interface unable to reach the gateway.
Now apply the Netplan settings with the following command:
First, navigate to the network-scripts directory using the following command:
Use the ls command to view the directory contents.
Locate your interface file (e.g., ifcfg-ensXXX) and then open it in a text editor of your choice using the following command:
NOTE: In our example the interface file is ifcfg-ens192.
Edit the interfaces file to make it appear as follows:
In this file, check or replace the following pieces of information as instructed:
-
ONBOOT= Verify that is says
yes. -
BOOTPROTO= Verify that is says
none. -
IPADDR= Replace
192.0.2.1with the Additional IP from the first step of this guide. -
GATEWAY= Replace
203.0.113.254with your Dedicated Server's gateway.You need the first three octets of your Dedicated Server's IP address with a final octet of "254". For instance, if your Dedicated Server IP was 1.2.3.4, you would use 1.2.3.254 as your gateway.
- DNS1= and DNS2= The DNS name servers listed are from OpenDNS; Feel free to use whichever name servers you prefer.
Next, since the Additional IP uses a host-only (/32) netmask and the gateway sits outside that subnet, create a companion route file, route-ens192, in the /etc/sysconfig/network-scripts/ directory to make the gateway reachable:
Replace 203.0.113.254 with your Dedicated Server's gateway.
You need the first three octets of your Dedicated Server's IP address with a final octet of "254". For instance, if your Dedicated Server IP was 1.2.3.4, you would use 1.2.3.254 as your gateway.
Next, enable the NIC by restarting the network service:
In this step, we will be configuring our interface settings. To do this, navigate to the Server Manager. From the left-hand column, click the Local Server option.
By default, the Ethernet0 field will read: IPv4 address assigned by DHCP, IPv6 enabled. This is exactly what we want to change, so click on this text.
Next, right-click on Ethernet0 and select the Properties option from the drop-down menu. From the ensuing menu, double-click the Internet Protocol Version 4 (TCP/IPv4) option.
This will allow you to configure your interface to use the IP address, gateway, and DNS name servers of your choice. Configure it as follows:
Enter the following information in the dialog box, as shown in the picture:
-
IP address: Replace
203.0.113.32with the Additional IP from the first step of this guide. -
Subnet mask: Replace
255.255.255.248with the correct netmask depending on the size of the block of IPs you have purchased. For example, if you are using a /28 block, put "240" in the last octet. -
Default gateway: Replace
147.135.0.254with the first three octets of your Dedicated Server's IP address with a final octet of "254". - DNS server addresses: The DNS nameservers listed are from OpenDNS; feel free to use other name servers here, if you choose.
Click OK after making these changes.
To test that the VM is fully connected to the Internet, ping example.com. If you get a response, you are good to go. If you do not, restart your VM and attempt the ping again.
Go further
For more information and tutorials, please see our other Dedicated Servers support guides or explore the guides for other OVHcloud products and services.