Logo Peer-to-peer VPN

Experimenting with VpnCloud on AWS

This page provides some scripts to setup and run VpnCloud nodes in the Amazon cloud. There are several reasons to use this kind of setup:


To run the scripts you need python3 and the python modules boto3 and paramiko.

Also you need an AWS account with credentials configured as described in the boto3 documentation


The scripts deploy EC2 nodes on AWS. This incurs small costs per node per hour (on a per second granularity) depending on the instance type and the region. Please refer to AWS EC2 pricing for the current prices.

There are basically three instance types that are useful for running VpnCloud:

The scripts can (and by default will) use spot instances to save up to 70% of the costs.

Please note that you should not connect the nodes to other nodes outside of AWS as external traffic has to be paid per GB.


The scripts are contained in the scripts folder.


This is the file that provides most functionality and is shared by all scripts. Have a look at this file if you want to know what is actually happening.


This is a full solution to obtain performance measurements that can be compared. The measurements are run between 2 nodes that are connected with 10 Gbit/s. The experiment run takes about 8 minutes and costs about $ 0.02.


Create a few nodes on AWS for experiments and terminate them when done. The script takes some arguments which are all optional (see ./testnet.py --help for options). If you call

$> ./testnet.py --count 2 --keyfile key.pem

the script will setup 2 nodes, print their IPs and store the private key in a file named key.pem. You can connect to the nodes using the following command (replace the actual IP address):

$> ssh ec2-user@ -i key.pem

When done, just press enter and the script will remove all resources.


This is a minimal script that creates two nodes and runs a ping. Use this script as a starting point for your own experiments.


  1. In general the scripts are pretty cautious to remove resources after the script is done. This should also work in case of an exception. However when errors occur, you should double-check that no instances are left over and cause costs over time.

  2. If you want to run performance tests, you should use an instance type from the m5 family and activate the instance clustering (cluster_nodes = True).