Objective
IP aliasing is a special network configuration of your dedicated server, which allows you to associate multiple IP addresses with a single network interface.
This guide explains how to make this addition.
Requirements
- You must have a dedicated server (Dedicated server,VPS).
- You must have one or more Additional IPs.
- You must be connected via SSH to the server (root access).
Instructions
Here are the configurations for the main distributions/operating systems.
CentOS and Fedora (25 and earlier)
Step 1: Create the source file
First, make a copy of the source file so that you can use it as a template:
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:0
Step 2: Edit the source file
You can now modify the eth0:0 file in order to replace the IP:
editor /etc/sysconfig/network-scripts/ifcfg-eth0:0
First, replace the name of the device
, then replace the existing IP with the failover IP you have received:
DEVICE="eth0:0"
ONBOOT="yes"
BOOTPROTO="none" # For CentOS use "static"
IPADDR="IP_FAILOVER"
NETMASK="255.255.255.255"
BROADCAST="IP_FAILOVER"
Step 3: Restart the interface
You now need to restart your interface:
ifup eth0:0