DigitalOcean provides a platform to easily deploy virtual machines called Droplets. You can spin up any number of machines with a variety of operating systems, and get going much more quickly than on other platforms like AWS or Azure. They also have a Marketplace of 1-click apps which make setup even easier.
Droplets and Apps are deployed into Regions, each of which has its own private network. This is great, because it allows Droplets to communicate over a secure network when you have an application that spans multiple machines.
However, sometimes your applications may span regions. In this case, your Droplets need to communicate across these different networks. This article shows how you can bridge DigitalOcean regions with an overlay private network using Netmaker.
The result is a virtual network that spans your droplets worldwide and acts as a sort of “super VPC.” Every machine can access every other machine securely, regardless of region, and it stays secure thanks to Netmaker’s virtual mesh network.
Netmaker requires the “netclient” to run on machines in order to set up the private networks. On each machine in DigitalOcean which you wish to make a part of the mesh, do the following:
Use the steps for installing Netclient. For instance, on Debian distros:
curl -sL 'https://apt.netmaker.org/gpg.key' | sudo tee /etc/apt/trusted.gpg.d/netclient.asc
curl -sL 'https://apt.netmaker.org/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/netclient.list
sudo apt update
sudo apt -y install netclient
Next, join the network. In Netmaker, go to the “Access Keys” section, click on the access key, and copy the “Join” command. It should look like this:
netclient join -t anvkr48twsigahkguashleawjieg
After completing these steps on all your machine you will see a mesh network, somewhat like this in the Graphs section on the left-hand menu:
Netmaker provides Private DNS for machines in Netmaker networks.
Have each droplet ping each other droplet by private IP address. If you need the IP address for a droplet, you can visit the Graph or Node section of the UI and view its private IP address. You can also get this from a Netclient by running the following:
sudo netclient list | jq
Try pinging by using the private DNS 3. Assuming everything is reachable, your private network is now complete.
You’ve successfully set up a multi-region network with Netmaker! This network can now act as a foundation for cross-region traffic. There are many more advanced features of Netmaker that can enhance this network, which we’ll go over in future articles.
Check out the following related articles: