Jump toUpdate content
How to configure a failover IP on CentOS
This page shows you how to configure a failover IP on Dedibox servers running on CentOS.
Connect to your server using SSH.
Use the Network Manager tool to configure the interface by running the command
On older CentOS/RHEL versions you might be used to configuring the interfaces by adding a new network-scripts file in
/etc/sysconfig/network-scripts/. This way of configuration has been deprecated starting from CentOS 7 and you should use the Network Manager to avoid configuration issues.
From the Netowrk Manager interface select Edit a connection and select the interface you want to add an alias to. Then Click Edit….
Browse through the Add … section to add an additional IP address.
Enter the details of your failover IP and save the settings to generate the configuration file.
Check the configuration file, to verify that the failover IP address has been added:
$ cat /etc/sysconfig/network-scripts/ifcfg-ens192
# Alias on the interface
ens192with the name of your network interface.
On recent versions of CentOS you should always prefer the configuration using the Network Manager tool. Manual configuration is not recommended for newer versions of CentOS (versions released after CentOS 6).
Connect to your Dedibox using SSH.
Copy the default network configuration of your primary interface to create an alias:
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scrits/ifcfg-eth0:0Note:
ifcfg-eth0might be named differently, depending on your network interfaces’ name. Use
ifconfigto determine the name of your network interface.
Open the file
/etc/sysconfig/network-scrits/ifcfg-eth0:0in a text editor, for example
nano, and edit it as follows:
Bring up the interface using the following command: