Configure a Failover IP
This guide explains how to configure a Failover IP on your Linux VPS.
Prerequisites
- SSH root or sudo access
- A Failover IP assigned to your VPS
- Debian/Ubuntu system
Configuration
-
Disable automatic network configuration:
sudo nano /etc/cloud/cloud.cfg.d/99-disable-network-config.cfgAdd this line:
network: {config: disabled} -
Configure the virtual interface:
sudo nano /etc/network/interfaces.d/50-cloud-initAdd these lines:
# Failover IP interface
auto eth0:1
iface eth0:1 inet static
address YOUR_FAILOVER_IP
netmask 255.255.255.255 -
Restart the network service:
sudo systemctl restart networking
Verification
-
Verify that the IP is properly configured:
ip addr show eth0:1 -
Test connectivity:
ping -I YOUR_FAILOVER_IP 8.8.8.8
Best practices
- Document your network configurations
- Test the configuration before any production deployment
- Keep a backup of configuration files
- Configure alerts in case of connectivity loss
Troubleshooting
- Check system logs:
sudo journalctl -xe - Check network configuration:
sudo networkctl status - Make sure the IP is properly assigned to your VPS
- Verify there is no IP conflict
Important notes
- The Failover IP must be configured with a network mask 255.255.255.255
- Some services may require reconfiguration to use the new IP
- Configuration may vary depending on your Linux distribution