Hello everyone! :)
So I have created a droplet with Ubuntu 20, I have installed apache, mysql, php and everything I need.. I made it work perfectly as I need it.

Then I decided to create a image by following this tutorial:
https://www.digitalocean.com/community/tutorials/how-to-create-an-image-of-your-linux-environment-and-launch-it-on-digitalocean

And everything worked fine, I uploaded the image to spaces I used the image to create a new droplet.

New droplet is created, however I cannot reach it via IP (winSCP or browser or ping)… however I can SSH to it via DigitalOcean console..

So I guess the problem is somehow in IP not assigned properly in server configuration?

I tried searching for a solution for over 20 hours and I tried many things.. with no success… :(

If anyone could help me out I would be grateful! :)

Thank you in advance!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
2 answers

Hi,
Check if you can see your droplet’s public IP address assigned to any network interface

sudo ip address

and what is a gateway (via) and network interface (dev) for default routing

sudo ip route

Check if you can ping the gateway from outside and inside your droplet.

Hi,

Late last night (attempt #84593484) :D I managed to setup the static IP and it’s working so far.

I have this in netplan

network:
    version: 2
    renderer: networkd
    ethernets:
        ens3:
            dhcp4: no
            addresses:
              - 142.93.150.177/20
            gateway4: 142.93.144.1
            nameservers:
                addresses:
                - 8.8.8.8
                - 1.1.1.1

However my other DigitalOcean generated droplets have network such as:

network:
    version: 2
    ethernets:
        eth0:
            addresses:
            - 167.99.91.233/20
            - 10.16.0.5/16
            gateway4: 167.99.80.1
            match:
                macaddress: 2a:e6:19:8a:a1:1f
            nameservers:
                addresses:
                - 67.207.67.2
                - 67.207.67.3
                search: []
            set-name: eth0
        eth1:
            addresses:
            - 10.106.0.2/20
            match:
                macaddress: 9a:98:f8:9a:8d:da
            nameservers:
                addresses:
                - 67.207.67.2
                - 67.207.67.3
                search: []
            set-name: eth1

So in network I have manually generated I’m missing eth1 and the nameservers are public ones, is that bad or that configuration is ok? The missing ethernet port is also ok or?

  • In regular droplet configuration, eth1 is intended to communicate within VPC (Virtual Private Cloud), a cloud equivalent of LAN (Local Area Network). It enables you to set up particular configurations too, e.g. separating back-end environment from direct access from the Internet, setting up VPN gateway to get secured access to all your droplets, etc. It may happen that you will never need it in the future, especially when you have just one droplet.

    You do not have to change DNS servers in your configuration but it is very likely that the domain names will be resolved quicker using DO DNS servers rather than Google. Droplet gets quicker response from DO DNS servers. Try to ping both Google and DO DNS servers from your droplet to make sure yourself.

    • Thank you for clear explanation! Last question.. Maybe :D Is there any better way of setting this up? Because I create a droplet, then I need to SSH to it.. then I need to manually create the YAML file with addresses…

      Is there any way to have it configured automatically upon boot? or with some easier config way?

      @Yannek are you available for hire per hour?

      • @hrvojeZap wrote:
        Is there any better way of setting this up? (...) Is there any way to have it configured automatically upon boot? or with some easier config way?

        I do not know the better way but for sure it is any. E.g. people deploying MikroTik CHR image into droplet found very efficient way to do that.

        @hrvojeZap wrote:
        are you available for hire per hour

        :) We will be in touch. I have just read email from LI.

        • OK, I found the way how to get the network environment fully configured in the Ubuntu 20.04 droplet just created from a custom image. You followed the tutorial for Ubuntu 18.04 but your version is 20.04, and there are some differences in cloud-init configuration for that version. So, you can still use that tutorial except the paragraph Reconfiguring cloud-init. Here is the substitution for that paragraph:

          Caution!
          I performed all the tests for Ubuntu Server 20.04 LTS
          

          Reconfiguring cloud-init in Ubuntu 20.04

          1. Remove some cloud-init configuration files.
          Here are the files I removed:

          /etc/netplan/00-installer-config.yaml
          /etc/cloud/cloud.cfg.d/subiquity-disable-cloudinit-networking.cfg
          /etc/cloud/cloud.cfg.d/99-installer.cfg
          

          After the files removal, I did not have any file in /etc/netplan/ directory, and the content of my directory /etc/cloud/cloud.cfg.d/ looked like

          /etc/cloud/cloud.cfg.d/README
          /etc/cloud/cloud.cfg.d/90_dpkg.cfg
          /etc/cloud/cloud.cfg.d/curtin-preserve-sources.cfg
          /etc/cloud/cloud.cfg.d/05_logging.cfg
          

          2. Edit the file /etc/cloud/cloud.cfg.d/90_dpkg.cfg to get its datasource_list like

          datasource_list: [ DigitalOcean, ConfigDrive, OpenNebula, Azure, AltCloud, OVF, MAAS, GCE, OpenStack, CloudSigma, SmartOS, Bigstep, Scaleway, AliYun, Ec2, CloudStack, Hetzner, IBMCloud, Oracle, Exoscale, RbxCloud, None ]
          

          It is crucial to put DigitalOcean as the first item on datasource_list.

          3. Clean cloud-init logs and artifacts.

          sudo cloud-init clean
          
Submit an Answer