Skip to main content

Private Networks

Virtual machines can be interconnected through a high-speed VXLAN private network.
These kind of networks can be used to ensure private and secure traffic between your application components.

For example, if you run the web application and the database in 2 separate virtual machines, they can communicate with each other through the private network.

1. Create virtual machines within a private network#

Choose or create a private network#

You can create a new private network straight from the server creation page.
Naviate to the server creation page and you will see the "Private Network" section where you can either choose an existing network, or create a new network right away.
Once created, the instance will receive a network interface within that network.

create server

To create a new network, just give it a name, the other settings will be prefilled by default.

create network

Create the virtual machines#

create webapp vm

In this example we are going to create 2 virtual machines to demonstrate how they can communicate using the private network.

  • VM1: webapp-server
  • VM2: mysql-server

server list

In the above image, you can see that each machine received a private IP besides the public IPv4 & IPv6.

2. Verify the IP addresses#

Let's SSH into the VM using the public IP and check the network interfaces.

ipaddr config

As you might notice, the cloud-init script that runs when the instance boots, automatically configured the network interface which now has the private IP assigned to it.
That's because cloud-init automatically configures the netplan configuration file.
Since we're using Ubuntu, the netplan file is located at /etc/netplan/50-cloud-init.yaml.
Other linux distros may have this file at a different location.

netplan

3. Verify the private IP communication#

For checking the communication through the private network, we're going to use ping and iperf3 commands.

Verify ping#

As you may notice, each ping response comes in under 1 ms thanks to the VXLAN that's deployed in the datacenter.

ping

Verify iperf3#

Here we demonstrate the high throughput that's offered by the private network.
You can easily reach 10 Gb/s with a single threaded iperf3 command.
Multi-threaded applications can go way beyond that.

iperf3