|
Search |
This guide does not apply to RPS.
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. 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. The setup on Centos is quite similar to the Redhat one. 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. 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. 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 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. 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. 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 For Debian 3, 4 and 5, we must add: auto eth0:0 iface eth0:0 inet static address IP.OF.FAIL.OVER netmask 255.255.255.255 broadcast IP.OF.FAIL.OVER The /etc/network/interfaces files should 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.DE.FAIL.OVER netmask 255.255.255.255 broadcast IP.DE.FAIL.OVER For Debian 6, we must add one line per ip (eth0 is incremented X: X): post-up /sbin/ifconfig eth0:X IP.OF.FAIL.OVER netmask 255.255.255.255 broadcast IP.OF.FAIL.OVER post-down /sbin/ifconfig eth0:X down The /etc/network/interfaces file should 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 post-up /sbin/ifconfig eth0:0 IP.OF.FAIL.OVER netmask 255.255.255.255 broadcast IP.OF.FAIL.OVER post-down /sbin/ifconfig eth0:0 down post-up /sbin/ifconfig eth0:1 IP.OF.FAIL.OVER1 netmask 255.255.255.255 broadcast IP.OF.FAIL.OVER1 post-down /sbin/ifconfig eth0:1 down 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 steps 1 through 3 were carried out correctly, the IP shown in the file must be pingable from the outside and answer the queries. 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 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 }
Choose the second edition:
Finish the installation of this device. By installing the loopback card, a new interface appeared:
It's the time to add to it the Ip fail-over address:
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:
Finally, to validate the modifications, reboot the interface:
Wait for few seconds and activate the network connection again 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 mode Win 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. 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 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 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
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. 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 inet 127.0.0.1 netmask ff000000 e1000g0: flags=1000843 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. |
|||