This guide will walk you through the process of configuring an additional IP address on your Erkmenhost dedicated server running Debian 12 or Ubuntu 20.04 (and newer). These systems use Netplan to manage network interfaces.
Following this guide is the recommended best practice, as we will create a separate configuration file. This isolates your changes, making it simple to revert them without affecting your server's primary connection.
First, you need to know the name of your server's main network interface. Connect to your server via SSH and run the following command:
ip a
Look through the output for your server's main IP address. The name listed next to the number (e.g., eth0
, ens3
, or similar) is your interface name. Note this down, as you'll need it in the next step.
Next, you'll create a new .yaml
configuration file inside the /etc/netplan/
directory. We'll name our example 51-cloud-init.yaml
, but you can choose a different name.
Use a text editor like nano
to create and open the file:
sudo nano /etc/netplan/51-cloud-init.yaml
Now, add the following configuration to the file.
Important:
INTERFACE_NAME
with the interface name you found in Step 1.ADDITIONAL_IP
with the new IP address you want to add.Copy and paste this code, then edit the values. The /32
at the end of the IP is the subnet mask and is required.
network:
version: 2
ethernets:
INTERFACE_NAME:
dhcp4: true
addresses:
- ADDITIONAL_IP/32
If you need to add more than one IP, simply list them under addresses
:
network:
version: 2
ethernets:
INTERFACE_NAME:
dhcp4: true
addresses:
- ADDITIONAL_IP_1/32
- ADDITIONAL_IP_2/32
- ADDITIONAL_IP_3/32
Once you are done, save the file and exit the editor (in nano
, press CTRL + X
, then Y
, then Enter
).
Before making the change permanent, Netplan allows you to test your new configuration. This test will apply the settings for 120 seconds and automatically revert if you lose connectivity.
Run the test command:
sudo netplan try
A Note on Permissions: You may see a warning like: Permissions for /etc/netplan/51-cloud-init.yaml are too open.
This is just a security notice and will not prevent your IP from working correctly. You can safely proceed.
After the test is successful, apply the configuration permanently:
sudo netplan apply
That's it! Your new IP address is now configured and active on your server.