Configuring IP aliasing

Find out how to add Additional IP addresses to your VPS configuration

Last updated 6th October 2022

Since October 6th, 2022 our service "Failover IP" is named Additional IP. This renaming has no effect on its technical features.

Objective

IP aliasing refers to a special network configuration for certain OVHcloud services. Additional IPs allow you to associate multiple IP addresses with a single network interface.

This guide explains how to add Additional IP addresses to your network configuration.

OVHcloud is providing you with services for which you are responsible, with regard to their configuration and management. You are therefore responsible for ensuring they function correctly.

This guide is designed to assist you in common tasks as much as possible. Nevertheless, we recommend that you contact a specialist service provider and/or discuss the issue with our community on https://community.ovh.com/en/ if you have difficulties or doubts concerning the administration, usage or implementation of services on a server.

Requirements

Instructions

The following sections contain the configurations for the most commonly used distributions/operating systems. The first step is always to log in to your server via SSH or a GUI login session (RDP for a Windows VPS). The examples below presume you are logged in as a user with elevated permissions (Administrator/sudo).

Concerning different distribution releases, please note that the proper procedure to configure your network interface as well as the file names may have been subject to change. We recommend to consult the manuals and knowledge resources of the respective OS versions if you experience any issues.

Please take note of the following terminology that will be used in code examples and instructions of the guide sections below:

Term Description Examples
ADDITIONAL_IP An Additional IP IP address assigned to your service 169.254.10.254
NETWORK_INTERFACE The name of the network interface eth0, ens3
ID ID of the IP alias, starting with 0 (depending on the number of additional IPs there are to configure) 0, 1

Debian 10/11

Step 1: Disable automatic network configuration

Open the following file path with a text editor:

sudo nano /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg

Enter the following line, then save and exit the editor.

network: {config: disabled}

Creating this configuration file will prevent changes to your network configuration from being made automatically.

Step 2: Edit the network configuration file

You can verify your network interface name with this command:

ip a

Open the network configuration file for editing with the following command:

sudo nano /etc/network/interfaces.d/50-cloud-init

Then add the following lines:

auto NETWORK_INTERFACE:ID
iface NETWORK_INTERFACE:ID inet static
address ADDITIONAL_IP
netmask 255.255.255.255

Step 3: Restart the interface

Apply the changes with the following command:

sudo systemctl restart networking

Ubuntu 20.04

The configuration file for your Additional IP addresses is located in /etc/netplan/. In this example it is called "50-cloud-init.yaml". Before making changes, verify the actual file name in this folder. Each Additional IP address will need its own line within the file.

Step 1: Disable automatic network configuration

Open the following file path with a text editor:

sudo nano /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg

Enter the following line, then save and exit the editor.

network: {config: disabled}

Creating this configuration file will prevent changes to your network configuration from being made automatically.

Step 2: Edit the configuration file

You can verify your network interface name with this command:

ip a

Open the network configuration file for editing with the following command:

sudo nano /etc/netplan/50-cloud-init.yaml

Do not modify the existing lines in the configuration file. Add your Additional IP address by adding a second configuration block for the public interface according to the example below:

network:
    version: 2
    ethernets:
        NETWORK_INTERFACE:
            dhcp4: true
            match:
                macaddress: fa:xx:xx:xx:xx:63
            set-name: NETWORK_INTERFACE            
        NETWORK_INTERFACE:
            dhcp4: true
            match:
                macaddress: fa:xx:xx:xx:xx:63
            set-name: NETWORK_INTERFACE
            addresses:
            - ADDITIONAL_IP/32

It is important to respect the alignment of each element in this file as represented in the example above. Do not use the tab key to create your spacing.

Save and close the file.

Step 3: Apply the new network configuration

You can test your configuration using this command:

sudo netplan try

If it is correct, apply it using the following command:

sudo netplan apply

Repeat this procedure for each Additional IP address.

Windows Server 2016

Step 1: Verify the network configuration

Right-click on the Start Menu button and open Run.

Type cmd and click OK to open the command line application.

cmdprompt

In order to retrieve the current IP configuration, enter ipconfig at the command prompt.

check main IP configuration

Step 2: Change the IPv4 Properties

Now you need to change the IP properties to a static configuration.

Open the adapter settings in the Windows control panel and then open the Properties of Internet Protocol Version 4 (TCP/IPv4).

change the ip configuration

In the IPv4 Properties window, select Use the following IP address. Enter the IP address which you have retrieved in the first step, then click on Advanced.

Step 3: Add the Additional IP in the "Advanced TCP/IP Settings"

In the new window, click on Add... under "IP addresses". Enter your Additional IP address and the subnet mask (255.255.255.255).

advance configuration section

Confirm by clicking on Add.

Additional IP configuration

Step 4: Restart the network interface

Back in the control panel (Network Connections), right-click on your network interface and then select Disable.

disabling network

To restart it, right-click on it again and then select Enable.

enabling network

Step 5: Check the new network configuration

Open the command prompt (cmd) and enter ipconfig. The configuration should now include the new Additional IP address.

check current network configuration

cPanel (CentOS 7) / Red Hat derivatives

Step 1: Edit the network configuration file

You can verify your network interface name with this command:

ip a

Open the network configuration file for editing:

sudo nano /etc/sysconfig/network-scripts/ifcfg-NETWORK_INTERFACE:ID

Then add these lines:

DEVICE=NETWORK_INTERFACE:ID
BOOTPROTO=static
IPADDR=ADDITIONAL_IP
NETMASK=255.255.255.255
BROADCAST=ADDITIONAL_IP
ONBOOT=yes

Step 2: Restart the interface

Apply the changes with the following command:

sudo systemctl restart networking

Plesk

Step 1: Access the Plesk IP management section

In the Plesk control panel, choose Tools & Settings from the left-hand sidebar.

acces to the ip addresses management

Click on IP Addresses under Tools & Resources.

Step 2: Add the additional IP information

In this section, click on the button Add IP Address.

add ip information

Enter your Additional IP in the form xxx.xxx.xxx.xxx/32 into the field "IP address and subnet mask", then click on OK.

add ip information

Step 3: Check the current IP configuration

Back in the section "IP Addresses", verify that the Additional IP address was added correctly.

current IP configuration

Troubleshooting

First, restart your server from the command line or its GUI. If you are still unable to establish a connection from the public network to your alias IP and suspect a network problem, you need to reboot the server in rescue mode. Then you can set up the Additional IP address directly on the server.

Once you are connected to your server via SSH, enter the following command:

ifconfig ens3:0 ADDITIONAL_IP netmask 255.255.255.255 broadcast ADDITIONAL_IP up

To test the connection, simply ping your Additional IP from the outside. If it responds in rescue mode, that probably means that there is a configuration error. If, however, the IP is still not working, please inform our support teams by creating a support request in your OVHcloud Control Panel for further investigations.

Go further

Activating Rescue Mode on VPS

Join our community of users on https://community.ovh.com/en/.


Did you find this guide useful?

Please feel free to give any suggestions in order to improve this documentation.

Whether your feedback is about images, content, or structure, please share it, so that we can improve it together.

Your support requests will not be processed via this form. To do this, please use the "Create a ticket" form.

Thank you. Your feedback has been received.


These guides might also interest you...

OVHcloud Community

Access your community space. Ask questions, search for information, post content, and interact with other OVHcloud Community members.

Discuss with the OVHcloud community

In accordance with the 2006/112/CE Directive, modified on 01/01/2015, prices incl. VAT may vary according to the customer's country of residence
(by default, the prices displayed are inclusive of the UK VAT in force).