Can't access other servers over private network

July 6, 2014 9.5k views

I've turned on private networking on two droplets, but I can't even get them to ping each other over the private network. Any help?

5 Answers

Do you have a firewall installed that might be blocking ICMP packets? I believe UFW does that by default. If you're using UFW, try disabling it and trying to run ping again.

Also, what's the output of the following command?

sudo sysctl net.ipv4.icmp_echo_ignore_all
  • Also, what's the output of the following command?


    Yes, there is a firewall in place. I'm trying to set up a second droplet to host databases for Wordpress installs on the first droplet. I've opened port 3306 on the second droplet, but can't access it from the first. I thought that pinging it would be easy enough...

  • Try running nc -zv database-droplet-ip 3306. If that doesn't work, check if MySQL is listening port 3306 on the database droplet:

    sudo netstat -plutn | grep 3306

nc -zv database-droplet-ip 3306 timed out (I replaced database-droplet-ip with the private network ip of the database droplet).

sudo netstat -plutn | grep 3306 on the database droplet returned:

tcp        0      0  *               LISTEN      8312/mysqld
  • Looks like a firewall is blocking connections to MySQL. Please pastebin the output of:

    • sudo ufw status if you're using UFW
    • sudo iptables -L -n -v if you're using iptables

    on both droplets.

It turns out that one of my droplets wasn't properly configured for private networking. I have it all sorted out now. Thanks.

Hi @kamaln7, I have the same problem. I did all the steps you mentioned and still no luck connecting to mysql. But running nc -zv database-droplet-ip 3306 succeeded w/ my ufw on, the database ip I used is the private network address. When I try to turn off my ufw I have no trouble connecting to mysql, also when I allow my public ip on ufw it connects perfectly.

Have another answer? Share your knowledge.