Additional IP Aliasing

Introduction

IP aliasing is a special configuration of your dedicated server network, which enables you to associate several IP addresses to only one network interface .

The aim is to create a virtual interface above eth0, which will be named eth0:0 and will attach the additional IP (or Fail over IP) to your network interface. Here are the explanations for the configuration via SSH.

DEFAULT_SERVER_IP:
  The primary IP of your dedicated server.
IP_FAIL_OVER: The Failover IP you want to configure

Requirements

  • A dedicated server
  • IP failover(s)
  • Knowledge about SSH

Applying the configuration

Redhat 7.2, CentOS & Fedora

First we copy the file of eth0 interface and we rename it eth0:0. This will enable you to edit the file in peace:

cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:0

We can now edit the file eth0:0 to replace the IP:

editor /etc/sysconfig/network-scripts/ifcfg-eth0:0

First of all, replace the device name, then the existing IP by the failover / additional one that you have received by email:

1
2
3
4
5
6
DEVICE="eth0:0"
ONBOOT="yes"
BOOTPROTO="none" # For CentOS use "static"
IPADDR="IP_FAIL_OVER"
NETMASK="255.255.255.255"
BROADCAST="IP_FAIL_OVER"

Now you just have to assemble the new interface that we have just added:

ifup eth0:0

During a reboot, the interface will automatically be assembled.

If operations 1 to 3 have been correctly carried out, the IP shown in eth0:0 file must be “pingable” from another machine.

If you have several additional IPs, you can do the operation again by using eth0:1eth0:2 and so on.

If after the configuration your IP doesn’t answer to ping, please contact our support.

 

Debian & derivatives

First, we backup the network configuration file to be able to revert at any time:

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

You must add a secondary interface:

1
2
3
4
auto eth0:0
iface eth0:0 inet static
    address IP_FAIL_OVER
    netmask 255.255.255.255

To make sure the secondary interface(s) is brought up when the eth0 is activated we must add the following line to the eth0 configuration:

1
2
post-up /sbin/ifconfig eth0:0 IP_FAIL_OVER netmask 255.255.255.255 broadcast IP_FAIL_OVER
pre-down /sbin/ifconfig eth0:0 down

So if you had two Failover IPs configured, the /etc/network/interfaces file would look like this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
auto eth0
iface eth0 inet static
    address DEFAULT_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 IP_FAIL_OVER1
    netmask 255.255.255.255

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

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

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

Restart your network interfaces to activate the new Failover IPs;

/etc/init.d/networking restart

If after the configuration your IP doesn’t answer to ping, please contact our support.

 

CPanel

First, we backup the network configuration file to be able to revert at any time:

cp /etc/ips /etc/ips.bak

Edit the file /etc/ips;

editor /etc/ips

Add the ip to the file;

IP_FAIL_OVER:255.255.255.255:IP_FAIL_OVER

Add the ip in /etc/ipaddrpool;

IP_FAIL_OVER

Restart the service managing Failover IPs;

/etc/init.d/ipaliases restart

 

Windows 2012 Server

By default on Windows 2008/2012 servers are using DHCP in the network configuration. If you have already configured a failover IP or you have already placed your fixed IP configuration then skip this step.

You must first change the DHCP configuration on the network for a fixed network configuration.

Open a cmd or powershell console and type the following command:

ipconfig /all

This will give you:

_images/guides-network-ipaliasing-windows-2008-1.png

Result of “ipconfig /all” command

Get your IPv4 address, subnet mask and default gateway from this screen.

In our example the IP is : 94.23.229.151

then:

  1. Go to Start >> Control Panel >> Network and Internet >> Network and Sharing Center >> Change adapter settings (on the left menu)
  2. Right-click on Local Area Connection
  3. Select Properties
  4. Select Internet Protocol Version 4 (TCP/IPv4) and then click Properties
  5. Check “Use the following IP address” and replace the main server IP, subnet mask, default gateway obtained through the ipconfig command above (in preferred DNS server, put 213.186.33.99)
_images/guides-network-ipaliasing-windows-2008-2.png

Internet Protocol Version 4 (TCP/IPv4) Properties

Warning

Do not make a mistake on this information, or the server will no longer be available and you’ll have to correct the network configuration using mode Win Rescue.

Then click on Advanced (in the TCP/IPv4 properties dialog)

_images/guides-network-ipaliasing-windows-2008-2.png

Internet Protocol Version 4 (TCP/IPv4) Properties

in the IP address section, click add:

_images/guides-network-ipaliasing-windows-2008-3.png

Advanced TCP/IPv4 Settings

Fill it in with your IP failover and netmask 255.255.255.255.

_images/guides-network-ipaliasing-windows-2008-4.png

TCP/IP Address

Click Add.

Your failover IP is now usable.

 

Ping the IP, if the configurations were done correctly it should reply.

If after the configuration your IP doesn’t answer to ping, please contact our support.

Was this answer helpful?

 Print this Article

Also Read

Adding IPv6 IP

Apply IPv6 to different distributions Non-persistent application   You will lose this...

Slow Speeds / Packet Loss

If your server is having bandwidth problems, or you’re experiencing packet loss, we will gladly...

Bounceback Email headers and it's meanings

Mostly , If you are running a webhosting business, you will surely heard the term "bounce back" ....

Setting up rDNS for KVM servers from the client area

How to set up reverse DNS entries for your KVM server IP addressesYou can easily add rDNS from...

Changing the primary IP of my server

It is not possible to change the primary IP of your server for any reason. If you require a new...

Powered by WHMCompleteSolution