Configure an IP as an alias
Configure an IP as an alias
CentOS y Fedora
- Create a backup of the configuration file
First, make a backup copy of the interfaces configuration file so that you can use it as a model.
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:0
- Edit the configuration file
You can now edit the eth0: 0 file to replace the IP.
editor /etc/sysconfig/network-scripts/ifcfg-eth0:0
Now change the device name and then the existing IP to your Failover IP.
DEVICE="eth0:0" ONBOOT="yes" BOOTPROTO="none" # For CentOS use "static" IPADDR="IP_FAILOVER" NETMASK="255.255.255.255" BROADCAST="IP_FAILOVER"
- Restart the interface
Finally, restart the interface with the following command:
ifup eth0:0