Advertisement

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
    netmask 255.255.255.255
    post-up /sbin/ip route add 158.69.192.1 dev eth0
    post-up /sbin/ip route add default via 158.69.192.1
    pre-down /sbin/ip route del default via 158.69.192.1
    pre-down /sbin/ip route del 158.69.192.1 dev eth0
    dns-nameserver 213.186.33.99
    dns-search vps.ovh.ca

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


    post-up /sbin/ifconfig eth0:0 your-failover-ip netmask 255.255.255.255 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