Configuring Additional IPs in bridge mode on your virtual machines

Info

This article is about Additional IPv4 configuration on a public interface. You can also configure IPv6 addresses on your virtual machines using this guide.

Please note that Additional IP addresses can also be configured in a vRack (private network), which allows interconnection over a wide range of OVHcloud services, offering more flexibility.

Learn how to configure Additional IP addresses in a vRack with our guides for IPv4 and IPv6.

Objective

Bridged networking can be used to configure your virtual machines. Some tweaking is necessary to make the network configuration work on our network.

Requirements

  • A dedicated server with a hypervisor installed (e.g. Citrix Xen Server, Proxmox, etc.)
  • At least one Additional IP address routed to the server.

OVHcloud Control Panel Access

  • Direct link: Public IP
  • Navigation path: Network > Public IP Addresses

Warning

This feature might be unavailable or limited on servers of the Eco product line.

Please visit our comparison page for more information.

As of May 2025, this guide can be used for servers of the Scale and High Grade ranges.

Alternatively, to configure Additional IPs using in routed mode or in a vRack, please refer to Configuring the network on Proxmox VE on the High Grade & Scale ranges or Configuring the network on Windows Server with Hyper-V on the High Grade & Scale ranges.

Instructions

The basic steps are always the same, independent of the underlying system:

  • creating a virtual MAC address for an Additional IP
  • creating a VM on a host
  • setting the MAC address of the VM to that new virtual MAC address
  • configuring the IP address, netmask, gateway and route to the gateway inside the VM

Code samples in the following instructions have to be replaced with your own values:

  • SERVER_IP = The main IP address of your server
  • ADDITIONAL_IP = The address of your Additional IP
  • GATEWAY_IP = The address of your default gateway

Assign a virtual MAC address

Warning

In the case of a block of IPs, virtual MAC addresses are created on each individual IP in the block.

You can use the drop-down menu underneath My public IP addresses and associated services and select All Additional IPs to filter your services accordingly, or directly type the desired IP address in the search bar.

manage IPs

Next, locate your Additional IP address in the table and click the button to open the menu. Select Add a virtual MAC.

Add a virtual MAC (1)

Choose ovh from the "Type" drop-down menu unless you are using VMware ESXi - in that case choose vmware. Type a name in the “Name of virtual machine” field, and click on Confirm.

Add a virtual MAC (2)

After a few seconds, a virtual MAC will appear in the "Virtual MAC" column of your Additional IP row. This virtual MAC will be required when configuring your VM on the host.

Determine the gateway address

To configure your virtual machines for Internet access, you need to know the gateway of your host machine, i.e. your dedicated server.

You can retrieve the gateway address via your customer area or the OVHcloud API.

Via the OVHcloud Control Panel
Via the OVHcloud API

The IPv4 gateway assigned to your server will appear in the Network section of the General Information tab. Once you have copied it, continue with applying the configuration.

gateway

Prepare the host

INFO

For all operating systems and distributions, you must configure your virtual machine with the virtual MAC address you have created in the OVHcloud Control Panel.

Proxmox
VMware ESXi
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.

After creating the VM and while it is still powered off, right-click the VM and click Edit settings.

  1. Select the VM.
  2. Open the Hardware section.
  3. Select Network Device.
  4. Click the Edit button.
navigate to Network Device

Then add the virtual MAC address created previously.

open Network Device

Now you can start the VM and proceed with the configuration steps, depending on the operating system installed.

Configure the virtual machines

Warning

Please note that the following examples assume that you are logged in as a user with limited privileges, hence the use of sudo in front of each command. If you are logged in as root, you will not need to do this.

Tip

Select the tab corresponding to your operating system.

Debian
Red Hat and Red Hat-based operating systems
FreeBSD
Ubuntu
Windows Servers / Hyper-V

By default, the virtual machine's network configuration file is located in /etc/network/interfaces.

Once you are connected to the shell of your virtual machine, run the following command to identify your interface name:

ls /sys/class/net

Next, make a copy of the configuration file, so that you can revert at any time:

sudo cp /etc/network/interfaces /etc/network/interfaces.bak

In case of a mistake, you will be able to revert the changes, using the commands below:

sudo rm -f /etc/network/interfaces
sudo cp /etc/network/interfaces.bak /etc/network/interfaces

Edit the file so that it reflects the configuration below, replace INTERFACE_NAME, ADDITIONAL_IP and GATEWAY_IP with your own values.

sudo nano /etc/network/interfaces
auto lo
iface lo inet loopback

# The primary network interface
auto INTERFACE_NAME
iface INTERFACE_NAME inet static
address ADDITIONAL_IP
netmask 255.255.255.255
gateway GATEWAY_IP
Configuration example
auto lo
iface lo inet loopback

# The primary network interface
auto ens192
iface ens192 inet static
address 192.0.2.1
netmask 255.255.255.255
gateway 203.0.113.254

Save and close the file.

Next, edit or create the file /etc/resolv.conf:

sudo nano /etc/resolv.conf

Add the following line:

nameserver 213.186.33.99

Save and close the file.

Now you will need to bring your network interface online. To do so, enter the following command (replace ens192 with your own values):

sudo ip link set ens192 up

Finally, restart your networking service using the following command:

sudo systemctl restart networking

To verify that the virtual machine is fully connected to the Internet, use the following command:

For Linux

ping -c 4 example.com
PING example.com (93.184.215.14) 56(84) bytes of data.
64 bytes from 93.184.215.14 (93.184.215.14): icmp_seq=1 ttl=55 time=29.3 ms
64 bytes from 93.184.215.14 (93.184.215.14): icmp_seq=2 ttl=55 time=24.9 ms
64 bytes from 93.184.215.14 (93.184.215.14): icmp_seq=3 ttl=55 time=30.8 ms
64 bytes from 93.184.215.14 (93.184.215.14): icmp_seq=4 ttl=55 time=27.0 ms

--- example.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 24,925/28,028/30,840/2,254 ms

For Windows

ping example.com

Pinging example.com [93.184.215.14] with 32 bytes of data:
Reply from 93.184.215.14: bytes=32 time=74ms TTL=50
Reply from 93.184.215.14: bytes=32 time=73ms TTL=50
Reply from 93.184.215.14: bytes=32 time=73ms TTL=50
Reply from 93.184.215.14: bytes=32 time=73ms TTL=50

Ping statistics for 93.184.215.14:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 73ms, Maximum = 74ms, Average = 73ms

If you receive a response, this means that the Additional IP has been correctly configured. If not, reboot your virtual machine and retry the ping command.

Troubleshooting

If you are unable to establish a connection from your VM to the public network and you suspect a networking problem, please reboot the server in rescue mode and set up the bridging network interface directly on the host.

Enter the following command in the rescue mode terminal, in which you replace MAC_ADDRESS with the vMAC address that you have generated in the Control Panel and ADDITIONAL_IP with your Additional IP address:

ip link add name test-bridge link eth0 type macvlan
ip link set dev test-bridge address MAC_ADDRESS
ip link set test-bridge up
ip addr add ADDITIONAL_IP/32 dev test-bridge

Next, ping your Additional IP address from an external device.

  • If it responds, that probably means that there is a configuration error either on the VM or the host that prevents the Additional IP from working in normal mode.

  • If the IP address is still not working, please open a support ticket via the help center to relay your test results to our support teams.

Go further

Join our community of users.

Was this page helpful?