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 panel, network 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
ifconfig_nfe0_alias0="inet 87.98.129.74 netmask 255.255.255.255 broadcast 87.98.129.74"