It is now possible to change the primary IPv4 address of your Onidel Cloud instance and the process is fully automated. 

## Price

The IP change has a [one time fee](https://kb.onidel.com/hc/kb/articles/1756033443-terms-of-service#ip-change) associated:

* **$3** - change to a different, random IPv4 address

* **$6** - change to an IPv4 address in a specific subnet

## Preparation

In order to minimize downtime caused by IP change, we will have the VM Console opened beforehand. This allows to quickly modify and apply the static IPv4 configuration once IP gets switched.

To open the console, find your VM instance in [the panel](https://cloud.onidel.com/cloud/compute/vm) and click **View Console** / **Console Access** button.

![](https://cw.hypercore-internal.com/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBZ3dDIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--9848c725ce1edf9dcc78789b57307647ec0f0c5a/001-open-console.png.webp)

There, log in as `root` and open relevant network configuration file in `nano` (or other text editor).

![](https://cw.hypercore-internal.com/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBZzRDIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--b68b4d44dd512674767614e396b19cf11da3502a/002-open-netplan-nano.png.webp)

In our default [templates](https://kb.onidel.com/hc/kb/articles/1770750591-os-templates), the network configuration is managed by `netplan` and generated automatically using cloud-init. The path is `/etc/netplan/50-cloud-init.yaml`.

## Changing IPv4 address

The IP can be changed by going to your instance's **Network** tab and clicking the **Change IP** button next to primary IPv4 listed.

![](https://cw.hypercore-internal.com/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBZ1lDIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--bf1a4d79034579d53185834572be230979f0fba0/010-click-change-ip.png.webp)

The modal should open and ask whether you wish to change the IP to a random one, or pick a subnet yourself.

![](https://cw.hypercore-internal.com/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBZ2NDIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--ec450565dcc5f504f8c2448a850167d56e27fee0/011-change-ip-dialog.png.webp?cw_image_width=459px)

In this guide, we will choose a specific subnet.

You can also see current availability of IP addresses in each of listed prefixes.

![](https://cw.hypercore-internal.com/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBZ3NDIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--7a40fd17b1a5fb3059e0272a1312f5bdc7fc383c/013-subnet-selection.png.webp?cw_image_width=450px)

![](https://cw.hypercore-internal.com/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBZ2dDIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--a6f9f48b0943cca6ee21901da0a10e89a4aedbbe/012-change-ip-pick-subnet-dialog.png.webp?cw_image_width=455px)

Once you click **Submit**, a new invoice will be generated.

After it is paid, the IP address should be changed within a few seconds.

![](https://cw.hypercore-internal.com/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBZzhDIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--51486f43d7981413e9ddb0ed56ce25bb82be227e/014-pay-invoice.png.webp)

## Applying the new network configuration

Now, going back to the [VM Console](#preparation) with network configuration opened, you should edit and apply the static IPv4 network configuration of your Operating System.

Change the **IPv4 address** and **gateway** to the new ones, visible in Onidel Panel under your VM's **Network** tab.

![](https://cw.hypercore-internal.com/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBaEFDIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--bef999d3fd6a807f032a6fc501a7f8433131df0b/015-edit-netplan-nano.png.webp)

After this, save the configuration file and exit `nano` (`Ctrl+S`, `Ctrl+X`).

Lastly, apply new network configuration using issuing the `netplan apply` command. Once this is done, your VM should have the new IPv4 address assigned and working.

![](https://cw.hypercore-internal.com/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBaEVDIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--7d917d8af4c892fa5068e883f03f3053e7f09a1c/016-netplan-applied.png.webp)

## Final / Troubleshooting steps

Usual steps to perform after the IP change:

* Ensure all the software is configured to use the new IP of your VM (applies to services running inside the VM as well as external CDNs like Cloudflare).

* Use the new IP address to SSH into the VM and trust SSH fingerprint (the fingerprint and host keys should remain unchanged).

* Modify DNS records if necessary.


