You are here: Home > How-to > Failover

Configuring the failover IP

You may need to configure a failover IP address on your instances, for one of the following reasons:
  • * you have a large number of websites on your instance
  • * you host international projects
In order to do this you can either buy or import a failover IP address for your Public Cloud instances.

However failover IPs will not be automatically configured on your instance.

This guide explains how to configure your instance's network interface so that a failover IP can be allocated to it.


Configuring the interface

  • Edit the configuration file with the following command:
  • vi /etc/network/interfaces

  • Add the following lines to the end of the file:
  • # The loopback network interface
    auto lo
    iface lo inet loopback

    auto eth0
    iface eth0 inet static
    address should-be-your-main-ip
    post-up /sbin/ip route add dev eth0
    post-up /sbin/ip route add default via
    pre-down /sbin/ip route del default via
    pre-down /sbin/ip route del dev eth0

    auto eth0:0
    iface eth0:0 inet static
    address your-failover-ip

    post-up /sbin/ifconfig eth0:0 your-failover-ip netmask broadcast your-failover-ip
    pre-down /sbin/ifconfig eth0:0 down

    If you have many IPs to allocate, they must be added on the same line:
    by increasing the value of Y (the alias number)


    - Restart the network services with the command:

    • Restart the network services with the command:
    • service networking restart