> ## Documentation Index
> Fetch the complete documentation index at: https://docs.edisglobal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure additional IP on a Linux VPS

> Configure an additional IPv4 address on a Linux VPS, with examples for Debian and Ubuntu using netplan and ifupdown for persistent network settings.

## Configure a secondary IP in Linux

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/Ubuntu:

Debian and Ubuntu use the same network configuration method.

### 1. Edit the network configuration file:

* Open the terminal.
* Edit the network interfaces file using the nano editor (or any other editor you prefer):

```shell theme={"system"}
sudo nano /etc/network/interfaces
```

* 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:

```shell theme={"system"}
up ip addr add [YOUR-SECOND-IP]/24 dev eth0

# NOTE: Replace [YOUR-SECOND-IP] with your additional IP address.
```

* Save the file and exit (for nano, it's `CTRL + X`, press `Y` and then `Enter`).

### 2. Restart the networking service:

```shell theme={"system"}
sudo systemctl restart networking
```

##

##

## CentOS:

### 1. Navigate to network scripts directory:

```shell theme={"system"}
cd /etc/sysconfig/network-scripts/
```

### 2. Create a clone file for your interface:

If your main interface is `eth0`, the clone would be named `eth0:0`.

```shell theme={"system"}
sudo cp ifcfg-eth0 ifcfg-eth0:0
```

### 3. Edit the clone configuration:

* Open the new configuration file in an editor:

```shell theme={"system"}
sudo nano ifcfg-eth0:0
```

* Change the `DEVICE` line to:

```shell theme={"system"}
DEVICE=eth0:0
```

* Update the `IPADDR` line with your new IP address.
* Make sure you remove or comment out the `UUID` line.
* Save and exit.

### 4. Restart the network service:

```shell theme={"system"}
sudo systemctl restart network
```

***

**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.
