Skip to main content

Additional IPs

Additional IPs are attached directly to your virtual machine and represent a great way to extend your virtual machine capabilities such as providing Web Hosting or even creating inner Virtual Machines using para-virtualization.

Public IPs#

Navigate to the "Networking" submenu of the virtual machine and identify the "Public IPs" section.
Here you will see the main IP address that's been allocated to your VM upon creation. Besides this, you have the ability to add and manage additional IP addresses.

additional IPs

Add a new Public IP#

To add a new public IP, simply click the "Add" button. A new random IP will be allocated from our public subnet.

additional IP add

You can also associate another MAC address from the "Edit" button, if you need to assign this IP from an inner VM.

Configure the new IP#

If you already use an web hosting control panel (such as cPanel), you just need to add the IP into your control panel web interface and it will do the job for you.
However, if you just want the IP to work from the VM without any control panel involved, you will need to manually add the IP address to the network interface.

In Linux, you can use the ip addr add command to add the IP to the network interface. Note: you must first identify the name of your network interface (i.e by using ip addr), it may be different from case to case.

ipaddr add

Verify the connectivity#

Now let's check if our IP is accessible from outside.

ip ping

Persist the configuration#

The ip addr add command won't persist across restarts. To make it persistent, you must write the new IP address to the network configuration file.

Netplan#

First, identify the name of your network interface. In the above example, it's called enp3s0.
Create a new file /etc/netplan/90-additional-ips.yaml just to store the additional IPs. This file will work in addition to the default netplan configuration.

touch /etc/netplan/90-additional-ips.yaml

Edit the file using your favorite editor and place your IP in there:

network:  version: 2  ethernets:    enp3s0:      addresses:      - 185.104.181.44/24      # More IP's can be added below      # - x.y.a.b/24

Finally netplan apply.