I have a DigitalOcean server, a paid VPN provider, and multiple personal machines I'd like to be able to communicate with securely over the internet.

In my ideal scenario, I'd have my DigitalOcean server act as a central point to establish internet connections to all my devices. When an authorized device contacted my server, the server would set up the device to send all WAN traffic to my VPN provider (without passing through the server) and create a virtual LAN so my devices can communicate with each other (preferably in a P2P manner without needing to send traffic through the server).

I don't really know where to start researching how this can be done, so I'm looking for suggestions. Any ideas?


I'm sure there's many ways to implement this. Here's one:

I am not aware of practical implementations of decentralised p2p networks that work like a LAN so my proposed solution has a 2nd VPN to do this job.

  • Client connects to server via ssh and pulls 2 configuration files and/or scripts;
  • Client runs script #1 which initiates the VPN and redirects all traffic (becomes the equivalent of a default gateway, normally a route);
  • Client runs script #2 which initiates the LAN VPN with the DigitalOcean acting as a server. This VPN would run within the first, but you could configure it otherwise
    • No traffic would normally be routed to this network except that towards other hosts on the same VPN;
|improve this answer|||||

Not the answer you're looking for? Browse other questions tagged or ask your own question.