Question

I cannot seem to connect via private ip address between 2 droplets

I have 2 droplets, same data center behind the same fire wall. I have enabled private networking. My end goal is to have a web application on droplet 1 and mysql database on droplet 2 and connect the two via private network IP over port 3306. However, I cannot ping from droplet 1 to droplet 2 using the private ip address. I’m not sure what i’m doing wrong. Ports 22,80,443 are open on the firewall. Ubuntu 16.

Thank you!

Show comments

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

jarland
DigitalOcean Employee
DigitalOcean Employee badge
August 29, 2018
Accepted Answer

Hey friend!

Most often when receiving reports of this, the case is that at least one droplet has had private networking enabled after it’s creation, but it has not been set up yet in the operating system. If that might be the case for you, try these instructions:

https://www.digitalocean.com/docs/networking/private-networking/how-to/enable/#manual

You will also want to make sure that the droplets are both on the same account, as private networking will be limited in communication to droplets on that same account.

Jarland

This comment has been deleted

    In case this helps, additionally to correctly enabling VPC on your droplets (if unable, you can always destroy them and recreate them with the VPC option), I had trouble signing in from one droplet to another over ssh. I got a public key error. To solve that, I did the following:

    Assuming you want to ssh with user myuser, make sure your .ssh folder is owned by myuser and belongs to group myuser:

    sudo chown myuser ~/.ssh sudo chgrp myuser ~/.ssh

    and the same for authorized_keys and other files in .ssh.

    In droplet1, create a config file in .ssh with:

    Host droplet2 (or whatever you want) Hostname <ip_droplet_2> User myuser IdentityFile <path_private_key>

    And you can do the same on droplet2, setting the connection data for droplet1.

    The IdentityFile finally made it work.

    Try DigitalOcean for free

    Click below to sign up and get $200 of credit to try our products over 60 days!

    Sign up

    Become a contributor for community

    Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

    DigitalOcean Documentation

    Full documentation for every DigitalOcean product.

    Resources for startups and SMBs

    The Wave has everything you need to know about building a business, from raising funding to marketing your product.

    Get our newsletter

    Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

    New accounts only. By submitting your email you agree to our Privacy Policy

    The developer cloud

    Scale up as you grow — whether you're running one virtual machine or ten thousand.

    Get started for free

    Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

    *This promotional offer applies to new accounts only.