Proxmox VE (Virtual Environment) is a Debian-based open-source server that allows system administrators to deploy and manage VMs (virtual machines) and containers. In this article, we will cover connecting a Proxmox VM to the Internet.
- Creating a Virtual MAC for a Failover IP via the OVH US Manager
- Adding a Virtual MAC to the NIC of a VM
- Configuring Network Settings in the VM
Creating a Virtual MAC for a Failover IP via the OVH US Manager
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. To begin, log in to the OVH US Manager. On the left-hand sidebar click the IP option.
Choose the Failover IP you wish to configure to your VM and click the ellipses (...) button to the right of it. Then, select the Add a virtual MAC option from the drop-down menu.
In the popup menu, set the "Type" to "ovh" and enter the name of your virtual machine.
Lastly, click the Confirm button 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.
Warning: The following instructions apply to a previously created VM with an OS already installed. If you have not created a VM, please review the options on the Qemu/KVM Virtual Machine page by Proxmox, create a VM, and install an OS.
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:
Next, click the Edit button. In the "MAC address:" field, enter the vMAC address that was created in the previous section:
Configuring Network Settings in the Operating System
The VM in this article is running Ubuntu 18.04, so the following steps cover configuring a network interface in Linux. Please adjust the steps according to the operating system that your VM is running.
Canonical, the developer of Ubuntu, implemented the use of Netplan for easy-to-use network configuration as of version 17.x.
Begin by using the
ip add command to locate the interface name. There will most likely be two interfaces: lo (local loopback) and Ethernet. We are looking for the Ethernet interface, which will have the custom vMAC address configured. In our example, the interface name is
To configure the network interface, open the
01-netcfg.yaml file using the following command:
$ sudo vim /etc/netplan/01-netcfg.yaml
Edit the file to make it appear as follows:
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network: version: 2 renderer: networkd ethernets: ens18: dhcp4: no dhcp6: no addresses: [x.x.x.x/32] gateway4: y.y.y.254 nameservers: addresses: [18.104.22.168,22.214.171.124] routes: - to: y.y.y.254/32 via: 0.0.0.0 scope: link
In this file, replace the following pieces of information as instructed:
- 1. Next to "addresses", replace "x.x.x.x/32" with the Failover IP to which you have added the vMAC in the OVH US Manager plus the subnet you wish to use in CIDR notation.
- 2. Next to "gateway4", replace the "y.y.y." 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 203.0.113.6, you would use 203.0.113.254 as your gateway.
- 3. The DNS name server addresses listed are from OpenDNS. Feel free to use other name servers here, if you choose.
- 4. In the "routes" section, the y's correspond with your gateway IP address. Fill in these octets accordingly.
Now apply the Netplan settings with the following command:
$ sudo netplan apply
To test the connectivity of the VM, ping your default gateway (e.g., 203.0.113.254). If you receive a response, you can test the connectivity to the Internet by pinging a domain (e.g., example.com). If you do not receive a response with either test, double check the configuration, restart the VM, and attempt the ping again.
Having read this article, you should be familiar with creating a vMAC address for an OVH US Failover IP, adding the address to a VM via Proxmox, and configure the network settings in Ubuntu 18.04.