Learn how to connect a Proxmox VM to the Internet. Proxmox VE (Virtual Environment) is a Debian-based open-source server that allows system administrators to deploy and manage VMs (virtual machines) and containers.
Requirements
- a Dedicated Server running Proxmox VE
- an Additional IP through OVHcloud
Instructions
Creating a Virtual MAC for an Additional IP via the OVHcloud Control Panel
In this section, we will be generating a vMAC (virtual MAC) address to be used by the NIC (Network Interface Card) that Proxmox creates for a VM.
From the OVHcloud Control Panel, select Bare Metal Cloud
in the top navigation bar. In the left-hand menu, under Network, click IP
.
Choose the Additional IP you wish to configure to your VM and click the more options ...
button to the right of it. Then, select the Add a virtual MAC
option from the drop-down menu.
In the pop-up menu, set the Type to ovh
and enter the name of your virtual machine.
Lastly, click Confirm
to initiate the creation of the vMAC address.
Adding a Virtual MAC to the NIC of a VM in Proxmox VE
In this step, we will be pairing the vMAC address, which we generated in the previous section, to the interface that Proxmox has assigned to a VM.
To complete this step, the VM must be powered off.
In Proxmox, navigate to the Hardware
section of the VM that you would like to connect to the Internet.
From here, click the Network Device
option and click the Edit
button.
In the MAC address: field, enter the vMAC address that was created in the previous section and click OK
.
Start your VM as you are now ready to configure the network interface.
In the next step, we will be configuring network settings within the OS of our VM. These steps can be different depending on the OS you are using.
Configuring Network Settings in a Debian 10/11 VM
In this step, we will be configuring our interface settings. To do this, you must first open your interface configuration file. Do so 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:
- If you don't know the name of your interface, you can find it using the following command:
- Next to address, replace "192.0.2.1" with the additional IP to which you have added the vMAC in the OVHcloud Control Panel.
- Next to gateway, replace the "203.0.113" with 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.
- 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:
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.
Configuring Network Settings in an Ubuntu 24.04 VM
In this step, we will be configuring our interface settings. To do this, you must first open your interface configuration file. Do so 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:
- If you don't know the name of your interface, you can find it using the following command:
- Next to addresses, replace "192.0.2.1/32" with the additional IP to which you have added the vMAC in the OVHcloud Control Panel.
- The DNS name servers listed are from OpenDNS. Feel free to use other name servers if you choose.
- Next to via, replace the "203.0.113" with 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 to macaddress, replace "00:00:00:0a:bc:00" with the virtual MAC address for your Additional IP. This information can be found in the OVHcloud Control Panel in the IP section.
Now you will need to bring your NIC online. To do so, enter the following command:
Apply the netplan:
Finally, restart your networking service using the following command:
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.
Configuring Network Settings in an Ubuntu 22.04 VM
In this step, we will be configuring our interface settings. To do this, you must first open your interface configuration file. Do so 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:
- If you don't know the name of your interface, you can find it using the following command:
- Next to addresses, replace "192.0.2.1/32" with the additional IP to which you have added the vMAC in the OVHcloud Control Panel.
- The DNS name servers listed are from OpenDNS. Feel free to use other name servers if you choose.
- Next to via, replace the "203.0.113" with 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 to macaddress, replace "00:00:00:0a:bc:00" with the virtual MAC address for your Additional IP. This information can be found in the OVHcloud Control Panel in the IP section.
Now you will need to bring your NIC online. To do so, enter the following command:
Apply the netplan:
Finally, restart your networking service using the following command:
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.
Configuring Network Settings in an Ubuntu 18.04 VM
Canonical, the developer of Ubuntu, implemented the use of Netplan for easy-to-use network configuration as of version 17.x.
To configure the network interface, open the 01-netcfg.yaml
file in a text editor of your choice using the following command:
Edit the file to make it appear as follows:
In this file, replace the following pieces of information as instructed:
- If you replace the VMXNET3 NIC with another one, your NIC may use a different naming convention. If it does, replace "ens160" in the file with the name of your interface. If you don't know the name of your interface, you can find it using the following command:
- Next to addresses, replace "192.0.2.1" with the additional IP to which you have added the vMAC in the OVHcloud Control Panel plus the subnet you wish to use in CIDR notation.
- The DNS name server addresses listed are from OpenDNS. Feel free to use other name servers if you choose.
- Next to via and in the "routes" section, replace the "203.0.113" with 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.
Now apply the Netplan settings with the following command:
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.
Configuring Network Settings in a CentOS 7 VM
In this step, we will be configuring our interface settings. To do this, first navigate to the network-scripts
directory using the following command:
Use the ls
command to view the content of the directory.
Locate your interface file (e.g. ifcfg-ensXXX) and then open it in a text editor of your choice using the following command:
ifcfg-ens192
.Edit the interfaces file to make it appear as follows, changing only what is in red:
In this file, check/replace/add the following pieces of information as instructed:
- For IPADDR, replace "192.0.2.1" with the additional IP that you added a vMAC to in the OVHcloud Control Panel.
- For GATEWAY, replace the "203.0.113" with the first three octets of your Dedicated server's IP address with a final octet of "254". For instance, if your Dedicated server's 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:
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.
Configuring Network Settings in a Windows Server 2019 VM
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.
We want to change the default Ethernet0 option. To do so, click IPv4 address assigned by DHCP, IPv6 enabled
.
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:
- Next to IP address, replace "203.0.113.32" with the additional IP to which you have added the vMAC in the OVHcloud Control Panel.
- Next to Subnet mask, replace "255.255.255.248" with the correct netmask depending on the size of the block of IPs you have purchased. For instance, if you are using a /28 block, put "240" in the last octet.
- Next to Default gateway, replace the "147.135.0.254" with the first three octets of your Dedicated Server's IP address with a final octet of "254".
- 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.