Configuring IP aliasing Imprimir

  • 3

Objective

IP aliasing is a special network configuration for your OVHcloud dedicated servers, which allows you to associate multiple IP addresses with a single network interface.

This guide explains how to add failover IP addresses to your network configuration.

CaribeHost is providing you with services for which you are responsible, with regard to their configuration and management. You are therefore responsible for ensuring they function correctly. This guide is designed to assist you in common tasks as much as possible. Nevertheless, we recommend that you contact a specialist service provider if you have difficulties or doubts concerning the administration, usage or implementation of services on a server.

Requirements

  • a failover IP address or a failover IP block (RIPE)
  • administrative access (root) via SSH or GUI to your server
  • basic networking and administration knowledge

Instructions

The following sections contain the configurations for the most commonly used distributions/operating systems.

Concerning different distribution releases, please note that the proper procedure to configure your network interface as well as the file names may have been subject to change. We recommend to consult the manuals and knowledge resources of the respective OS versions if you experience any issues.

Debian 6/7/8 and derivative

Step 1: Create a backup
First, make a copy of the config file, so that you can revert at any time:

cp /etc/network/interfaces /etc/network/interfaces.bak

Step 2: Edit the config file

Note that the names of the network interfaces in our examples may differ from your own. Please adjust to your appropriate interface names.

You can now modify the config file:

editor /etc/network/interfaces

You then need to add a secondary interface:

auto eth0:0
iface eth0:0 inet static
address FAILOVER_IP
netmask 255.255.255.255

To ensure that the secondary interface is enabled or disabled whenever the eth0 interface is enabled or disabled, you need to add the following line to the eth0 configuration:

post-up /sbin/ifconfig eth0:0 FAILOVER_IP netmask 255.255.255.255 broadcast FAILOVER_IP
pre-down /sbin/ifconfig eth0:0 down

If you have two failover IPs to configure, the /etc/network/interfaces file should look like this:

auto eth0
iface eth0 inet static
address SERVER_IP
netmask 255.255.255.0
broadcast xxx.xxx.xxx.255
gateway xxx.xxx.xxx.254

auto eth0:0
iface eth0:0 inet static
address FAILOVER_IP1
netmask 255.255.255.255

auto eth0:1
iface eth0:1 inet static
address FAILOVER_IP2
netmask 255.255.255.255

Or like this:

auto eth0
iface eth0 inet static
address SERVER_IP
netmask 255.255.255.0
broadcast xxx.xxx.xxx.255
gateway xxx.xxx.xxx.254

# IPFO 1
post-up /sbin/ifconfig eth0:0 FAILOVER_IP1 netmask 255.255.255.255 broadcast FAILOVER_IP1
pre-down /sbin/ifconfig eth0:0 down

# IPFO 2
post-up /sbin/ifconfig eth0:1 FAILOVER_IP2 netmask 255.255.255.255 broadcast FAILOVER_IP2
pre-down /sbin/ifconfig eth0:1 down

Step 3: Restart the interface

You now need to restart your interface:

/etc/init.d/networking restart

¿Fue útil la respuesta?

« Atrás