NavigationContentFooter
Jump toSuggest an edit

How to configure a Dedibox failover IP on Debian and Ubuntu

Reviewed on 22 July 2024Published on 29 July 2021

This page shows you how to configure a failover IP on Dedibox servers running on Debian or Ubuntu Linux.

Before you start

To complete the actions presented below, you must have:

  • A Dedibox account logged into the console
  • Created a Dedibox dedicated server

Failover IP configuration on Debian

Note

If you are using Ubuntu 18.04 or later, you should configure the interfaces using Netplan.

  1. Connect to your server using SSH.

  2. Open the network configuration file /etc/network/interfaces in a text editor, for example nano:

    nano /etc/network/interfaces
  3. Add the failover IP to the configuration as shown in the following example:

    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    # The loopback network interface
    auto lo
    iface lo inet loopback
    # The primary network interface
    auto eth0
    iface eth0 inet static
    address 195.154.123.123
    netmask 255.255.255.0
    gateway 195.154.123.1
    auto eth0:0
    iface eth0:0 inet static
    address ip_failover
    netmask 255.255.255.255
    Note

    The interface name eth0 may vary, depending on your OS version and system configuration. Use the ifconfig command to determine the name of your primary network interface.

  4. Save the file and exit the editor.

  5. Bring up the interface using the following command:

    ifup eth0:0

Failover IP configuration on Ubuntu

Since the release of version 18.04 (Bionic Beaver) Ubuntu has switched to Netplan for the configuration of network interfaces.

It is a YAML-based configuration system, which simplifies the configuration process.

  1. Connect to your Dedibox using SSH.
  2. Open the Netplan configuration file of the main interface in a text editor, for example nano:
    sudo nano /etc/netplan/01-netcfg.yaml
  3. Edit the network configuration. The IP addresses have to be written with their CIDR notation. The netmask is /24 for the principal IP of the server and /32 for each failover IP. Your configuration should look as in the following example:
    network:
    renderer: networkd
    ethernets:
    ensXX:
    addresses:
    - <FAILOVER_IP>/32
    routes:
    - to: 62.210.0.1
    - to: default
    via: 62.210.0.1
    nameservers:
    addresses:
    - 51.159.47.28
    - 51.159.47.26 # Replace the IP of the DNS cache server with the one located in the same physical location as your machine for optimal performance (https://www.scaleway.com/en/docs/console/account/reference-content/scaleway-network-information/#dns-cache-servers)
    search: []
    version: 2
    Tip
    • Make sure to respect the YAML standards when you edit the file, as it might not work if there is a syntax error in your configuration.
    • You can find an extended list of netplan configuration examples in the official Canonical Netplan repository.
  4. Activate the new configuration by running the following command:
    sudo netplan apply
See also
How to configure a failover IP on CentOSHow to configure a failover IP on FreeBSD
Was this page helpful?
API DocsScaleway consoleDedibox consoleScaleway LearningScaleway.comPricingBlogCareers
© 2023-2024 – Scaleway