Configure additional IP on a Linux VPS
When you order an additional IP address for your VPS, it will not be added to your server's network settings automatically. You have to manually configure the IP address in your operating system's network configuration or make a clean reinstall to get your IP address configured automatically (all data on your KVM will be erased during reinstall).
Below are instructions on how to add a secondary IPv4 address to your VPS. Let's break down how to add an additional IP to the major Linux distributions:
Debian and Ubuntu use the same network configuration method.
- Open the terminal.
- Edit the network interfaces file using the nano editor (or any other editor you prefer):
- Locate the entry for your network interface. It typically starts with iface, for instance: iface eth0 inet static.
- To add an additional IP, add the following line just below your existing configuration:
- Save the file and exit (for nano, it's CTRL + X, press Y and then Enter).
If your main interface is eth0, the clone would be named eth0:0.
- Open the new configuration file in an editor:
- Change the DEVICE line to:
- Update the IPADDR line with your new IP address.
- Make sure you remove or comment out the UUID line.
- Save and exit.
Note: Always ensure you have permission to make these changes, and make backups of configuration files before editing them. It's also advisable to notify any affected parties before making changes, as there might be a short downtime while you restart network services.