Jump toUpdate content
How to configure a failover IP on Debian and Ubuntu
This page shows you how to configure a failover IP on Dedibox servers running on Debian or Ubuntu Linux.
- You have an account and are logged into the Dedibox Console
- You have created a Dedibox dedicated server
Failover IP configuration on Debian
If you are using Ubuntu 18.04 or later, you should configure the interfaces using Netplan.
Connect to your server using SSH.
Open the network configuration file
/etc/network/interfacesin a text editor, for example
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 interfaceauto loiface lo inet loopback# The primary network interfaceauto eth0iface eth0 inet staticaddress 184.108.40.206netmask 255.255.255.0gateway 220.127.116.11auto eth0:0iface eth0:0 inet staticaddress ip_failovernetmask 255.255.255.255Note:
The interface name
eth0may vary, depending on your OS version and system configuration. Use the
ifconfigcommand to determine the name of your primary network interface.
Save the file and exit the editor.
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.
Connect to your Dedibox using SSH.
Open the Netplan configuration file of the main interface in a text editor, for example
nano:sudo nano /etc/netplan/01-netcfg.yaml
Edit the network configuration. The IP addresses have to be written with their CIDR notation. The netmask is
/24for the principal IP of the server and
/32for each failover IP. Your configuration should look as in the following example:network:version: 2renderer: networkdethernets:enp1s0f0:addresses: [18.104.22.168/24, 22.214.171.124/32]gateway4: 126.96.36.199nameservers:addresses: [ "188.8.131.52", "184.108.40.206" ]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.
Activate the new configuration by running the following command:sudo netplan apply