Assign a Floating IP in Ubuntu 20

  1. In the Networking section of the client portal, ensure this IP is assigned to an instance. You can use the three dots at the top right of this IP to assign it if needed:
    cherryservers client portal floating IP
    1. a) Once assigned if there is no important data on the server, rebuilding it should automatically configure any assigned IPs in the selected OS:

    https://docs.cherryservers.com/knowledge/how-to-reinstall-os

     

    1. b) If there is important data on the server, or your OS is self install this will need to be manually configured. The following guide will show how this can be configured on Ubuntu 20 using netplan.

     

  2. Check your existing Netplan configurations by going to /etc/netplan/ and viewing the files there. Any configuration files should end in “.yaml”:

    $cd /etc/netplan/

    $ls

     

    As seen here our Ubuntu 20 install comes with a single “50-cloud-init.yaml” file by default:
    50-cloud-init.yaml 
  3. There will be an “addresses” section in this file, and you will want to add the new floating IP including the “/32” (185.150.116.221/32 in this example) directly under your management IP which should already be listed:

    $sudo nano 50-cloud-init.yaml

    adding additional IP on Ubuntu
  4. Once this has been added to your configuration you can apply the changes using the following command:

    $sudo netplan apply

     

    This new IP should now be configured on your server, and available for use.

     

    Extra information

    Please note that as stated in the configuration file in order to have any changes to this file persist during a reboot you will need to ensure the following file exists:

    /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg

     

    And has the following as its content:

    network: {config: disabled}

     

    An easy way to do this is with the following two commands:

     

    $sudo touch /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg

    $sudo echo network: {config: disabled} > /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg