Redhat 7.2 & Fedora

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

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 to your network interface. Here are the explanations for the addition via SSH. You can also do it directly via your webmin, ‘others’ section, then files management

In SSH /Putty


1. 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

2. We can now edit the file eth0:0 to replace the IP. You can either use pico or vi:
pico /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:

DEVICE="eth0:0"
ONBOOT="yes"
BOOTPROTO="none"
IPADDR="IP.FAIL.OVER"
NETMASK="255.255.255.255"
BROADCAST="IP.FAIL.OVER"

3. Now you just have to assemble the new interface that we have just added:
ifup eth0:0

At the time of reboot, the interface will automatically be assembled.

4. IP test

If operations 1 to 3 have been correctly carried out, the IP shown in eth0:0 file must be pingable from another machine and answer to the requests.
If you have several additional IPs; you can renew the operation by using eth0:1, eth0:2 and so on.

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

Centos

The setup on Centos is quite similar to the Redhat one.

In SSH /Putty

1. We copy the file of eth0 interface and we rename it: eth0:0. This will enable us to edit the file:
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:0

2. We can now edit the eth0:0 file to replace the IP. You can either use nano or vi:
nano /etc/sysconfig/network-scripts/ifcfg-eth0:0

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

DEVICE="eth0:0"
BOOTPROTO="static"
IPADDR="IP.FAIL.OVER"
NETMASK="255.255.255.255"
ONBOOT="yes"
BROADCAST="IP.FAIL.OVER" 
3. Now you just have to assemble the new interface that we have just added:
ifup eth0:0

At the time of reboot, the interface will automatically be assembled.

4. IP test

If operations 1 to 3 have been correctly carried out, the IP shown in eth0:0 file must be pingable from another machine and answer to the requests.
If you have several additional IPs; you can renew the operation by using eth0:1, eth0:2 and so on.

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

Gentoo OVH

The aim is to create a virtual interface above eth0, which will be named eth0:0 and will attach the additional IP or Failover to your network interface.

In SSH /Putty


1. First of all, we copy the root file to be able to go backward at any time
cp /etc/conf.d/net /etc/conf.d/net.save

2. We can now edit the file to add the ip

You can either use nano or vi. Under Gentoo, an alias is directly added in eth0. We don’t create any eth0:0 interface (as under Redhat for example)

Important: default IP of the server must remain config_eth= on the same line. In order to make sure that some specific handlings in OVH work correctly

After netmask 255.255.255.0, Press Enter and add your IP (XXXXXXXX have of course to be replaced by your Ips)

nano /etc/conf.d/net

You must add:

config_eth0=( " xxx.xxx.xxx.xxx netmask 255.255.255.0" "ip.fail.over.here netmask 255.255.255.255 brd ip.fail.over.here" )

Your /etc/conf.d/net file must contain the following:

#This blank configuration will automatically use DHCP for any net.
# scripts in /etc/init.d. To create a more complete configuration,
# please review /etc/conf.d/net.example and save your configuration
# in /etc/conf.d/net (this file :]!).
config_eth0=( "xxx.xxx.xxx.xxx netmask 255.255.255.0"
"xxx.xxx.xxx.xxx netmask 255.255.255.255 brd ip.fail.ov.er" )
routes_eth0=( "default gw xxx.xxx.xxx.254" )

3. Start the network interface again

In order to ping your IP-failover, you just have to start the network interface again

/etc/init.d/net.eth0 restart

4. IP test

If operations 1 to 3 have been correctly carried out, the IP shown in eth0:0 file must be pingable from another machine and answer to the requests.
You can therefore insert an additional IP line by line. However, it is important that the default IP remains on the same line as config_eth0

Debian

The aim is to create a virtual interface above eth0, which will be named eth0:0 and will attach the additional IP or Failover to your network interface.

In SSH /Putty


1. First of all, we copy the root file to be able to go backward at any time
cp /etc/network/interfaces /etc/network/interfaces.save

2. We can now edit the file to add the ip

You can either use nano or vi. Under Gentoo, an alias is directly added in eth0. We don’t create any eth0:0 interface (as under Redhat for example)

pico /etc/network/interfaces

You must add:

auto eth0:0
iface eth0:0 inet static
address IP.FAIL.OV.ER
netmask 255.255.255.255

Your /etc/conf.d/net file must contain the following:

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

auto eth0:0
iface eth0:0 inet static
address IP.FAIL.OV.ER
netmask 255.255.255.255
broadcast IP.FAIL.OV.ER

3. Start the network interface again

In order to ping your IP-failover, you just have to start the network interface again

/etc/init.d/networking restart

4. IP test

If operations 1 to 3 have been correctly carried out, the IP shown in eth0:0 file must be pingable from another machine and answer to the requests.
You can therefore insert an additional IP line by line. However, it is important that the default IP remains on the same line as config_eth0

cPanel

1. We edit the file /etc/ips :

nano /etc/ips

2. We add the ip to the file:

IP.FAIL.OVER:255.255.255.255:IP.FAIL.OVER

3. We add the ip in /etc/ipaddrpool

IP.FAIL.OVER

4. We restart the service managing failover ips :

/etc/init.d/ipaliases restart

HG Server

For HG servers which are delivered with 2 Ip addresses and 2 network cards, it's necessary to add the fail-over Ip in the routing rules:

postup()
{
/sbin/ip route add default via IP.INITIAL.2eme.CARTE dev eth1 table 223
/sbin/ip rule add from INITIAL.IP.OF.SERVER/32 table 223
/sbin/ip rule add from IP.FAILOVER.OF.SERVER/32 table 223
}

A example file on a HG server with Gentoo distribution gives:

This blank configuration will automatically use DHCP for any net.*
scripts in /etc/init.d. To create a more complete configuration,
please review /etc/conf.d/net.example and save your configuration
in /etc/conf.d/net (this file :]!).

config_eth0=( "xxx.xxx.xxx.xxx netmask 255.255.255.0"
"xxx.xxx.xxx.xxx netmask 255.255.255.255 brd xxx.xxx.xxx.255"
)
routes_eth0=( "default gw xxx.xxx.xxx.254" )

config_eth1=( "xxx.xxx.xxx.xxx netmask 255.255.255.0"
"xxx.xxx.xxx.xxx netmask 255.255.255.255 brd xxx.xxx.xxx.255"
)

postup()
{
/sbin/ip route add default via xxx.xxx.xxx.xxx dev eth1 table 223
/sbin/ip rule add from xxx.xxx.xxx.xxx/32 table 223
/sbin/ip rule add from IP.FAIL.OVER.HERE/32 table 223
}

Windows 2003 Server

First of all, you must add a new device:

  • 'Start', 'configuration panel', 'new device'
  • Click on 'next', then tick "Yes, I have already connected the device" and 'validate'
  • Select the last element of the list: "Add a new device" and 'validate'

Choose the second edition:

  • "Install the device that I select manually in the list (experimented user)" then 'validate'
  • Select "Network card" then in the next window, search the Microsoft producer and select "Microsoft loopback card"


Finish the installation of this device.

By installing the loopback card, a new interface appeared:

  • "Connection to the local network 2" (except for HG servers which will have a third interface)

It's the time to add to it the Ip fail-over address:

  • In 'start' menu, select configuration panelnetwork connections then Connection to the local network 2
  • Click on 'properties'
  • Select Internet Protocol (TCP/IP)
  • Click on 'properties'
  • Enter the Ip address corresponding to your Ip fail-over and 255.255.255.0 as netmask. Let the others fields empty
  • Validate all the open windows

Finally, you must correct the netmask by 255.255.255.255 but it isn't allowed by the dialogue box of Ip configuration; It's necessary to modify the information in the registry database:

  • In 'start' menu, click on 'Execute', then type regedit
  • Type CTRL+F3 in order to open the search window, then indicate the Ip fail-over address and click on 'next'
  • Once you found the IP, double-click on "SubnetMask" parameter and change 255.255.255.0 by 255.255.255.255 and 'validate'
  • Continue the search by typing F3, do the modification again as previously
  • Close the register editor

Finally, to validate the modifications, reboot the interface:

  • 'Start', 'Configuration panel', 'network connections' and do a right click on "Connection to the local network 2" then click on desactivate

Wait for few seconds and activate the network connection again

 

Windows 2008 Server


By default on Windows 2008 servers are using DHCP in the network configuration. If you have already configured an IP failover or you have already placed your fixed IP configuration then go to step 2. 

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

Open a command console: type the command: 
ipconfig /all

this will give you: 

 

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

In our example the IP is : 94.23.229.151 

then: 
- Go to Start >> Control Panel >> Network and Internet >> Network and Sharing Center >> Change adapter settings (on the left menu)
- Right-click on Local Area Connection
- Select Properties
- Select Internet Protocol Version 4 (TCP/IPv4) and then click Properties

-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)

 

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 modeWin Rescue 

2. Configure your IP failover 

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

 

in the IP address section, click add: 

 

fill it in with your IP failover and netmask 255.255.255.255 

 

click add.
Your IP Failover is now usable.

FreeBsd

In SSH/Putty

1. Determine the name of your primary network interface You can use the ifconfig command for this operation:
ifconfig

Gives the following output:

comsdvt# ifconfig
nfe0: flags=8843 metric 0 mtu 1500
options=10b
ether 00:24:8c:d7:ba:11
inet 94.23.196.18 netmask 0xffffff00 broadcast 94.23.196.255
inet 87.98.129.74 netmask 0xffffffff broadcast 87.98.129.74
media: Ethernet autoselect (100baseTX )
status: active
lo0: flags=8049 metric 0 mtu 16384
options=3
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 
inet6 ::1 prefixlen 128 
inet 127.0.0.1 netmask 0xff000000 v comsdvt#

The name of the interface is therefore: nfe0 2. We copy the file /etc/rc.conf so that we can go roll-back at any time: You can use the cp command:
cp /etc/rc.conf /etc/rc.conf.back

3. We edit the file /etc/rc.conf You can use nano or vi editor for this operation
ee /etc/rc.conf

Add the following line at end of the file: ifconfig_INTERFACE_alias0="inet IPFAILOVER netmask 255.255.255.255 broadcast IPFAILOVER"
Replace respectively INTERFACE with IPFAILOVER and the name of the interface discovered in step no 1, and then IPFAILOVER with your own ip failover.
Example:
ifconfig_nfe0_alias0="inet 87.98.129.74 netmask 255.255.255.255 broadcast 87.98.129.74"

4. Restart the network interface
/etc/rc.d/netif restart && /etc/rc.d/routing restart

Information!
Type this command in two separate steps in case of loss of access to your server

5. Test the IP
If the operations 1-4 were done correctly, the specified IP in the file must be pingable from the outside and respond to queries. If after the modifications your IP does not respond to pings, please contact support.

Solaris

In ssh/putty

1. Determine the name of your primary network interface You can use the ifconfig command for this operation:
ifconfig -a
Which will give a result like this:
lo0: flags=2001000849 mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 e1000g0: flags=1000843 mtu 1500 index 2 inet 94.23.41.167 netmask ffffff00 broadcast 94.23.41.255 ether 0:1c:c0:f2:be:42
The name of the interface is therefore: e1000g0 2. Create the file /etc/hostname.INTERFACE:ALIAS You can use the vi editor for this example:
vi /etc/hostname.e1000g0:1
in this file enter this: IPFAILOVER/32 broadcast + up Replace IPFAILOVER with your IP failover. example:
188.165.171.40/32 up
3. Restart the network interface
svcadm restart svc:/network/physical:default
4. Test the IP If the operations 1-3 were done correctly, the specified IP in the file must be pingable from outside and respond to queries. If your IP can't be pinged, please contact support.




==========================================

IP-Subnet-Mask numbers

IP mask numbers are used to divide internet addresses into blocks called subnets. The mask number represents the number of 1s in the binary of the address that is 'masked" against the address so that it ignores the last bits which are for the group of IP addresses in the masked address.

The first address of a subnet block (all 0s) is called the network address or network ID. The last address (all 1s) is the broadcast address of the network. Typically the network address +1 or the broadcast address -1 is the gateway to the internet. The 'slash' notation (ie /24) is known as CIDR format, while the more conventional 255.255.255.0 notation is considered a subnet mask.

Net bits

Subnet masktotal-addresses
/20255.255.240.04096
/21255.255.248.02048
/22255.255.252.01024
/23255.255.254.0512
/24255.255.255.0256
/25255.255.255.128128
/26255.255.255.19264
/27255.255.255.22432
/28255.255.255.24016
/29255.255.255.2488
/30255.255.255.2524