Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to set up a VPN with a similar topology to a Hamachi network: each computer connects to the other, as a "mesh," but traffic between them is still secure. Can OpenVPN do that?

Or, if that's not possible, is it possible to configure the VPN so that it is not necessary that the clients trust the server (I call this "paranoid")?

share|improve this question

An OpenVPN connection requires that one end is a client and that the other is a server.

So you will need to build your mesh manually, ensuring each node has a server configuration and a client configuration. Each node will need to run two OpenVPN instances, one for the client and one for the server.

OpenVPN supports advertising of routes available behind the virtual interface it creates. So you can make the OpenVPN nodes forward traffic not destined for that node to another node. Again, you need to set this up manually with iroute statements in your config files.

In each config file, you can specify multiple servers for a client to try connecting to. So you can specify multiple entry nodes for each configuration file.

To do it right, you'd need to make a CA for each client and server pair. You can compromise and have a single CA for whole mesh. You can compromise further and just do passwords, but you still need certificates for server identification.

I guess to be really secure you'd need another interior virtual network that isn't directly accessible by external clients, but accessible to anything once they are on the virtual network.

A lot of work to keep track of everything but certainly possible.

If the clients are not to trust the server, they need to communicate over the server using encryption. You could go so far as to run Tor internally on this mesh network on each server, then direct correlation between a node and a service would be difficult to make.

share|improve this answer
Hey, thanks for the answer. My scenario is as follows. Basically I have a few computers behind a very strict inbound firewall that I can't control (but anything outbound is allowed). I would be using a free Amazon EC2 instance to act as the server. Bandwidth is limited, hence my desire for a peer-to-peer connection. Also, I don't entirely trust Amazon to see everything that happens on the VPN. I could have two layers, one for NAT busting and one for secure communication, but then Android, which only does one layer, can't join the party. If you have other insights, I'd appreciate them! – thirtythreeforty Oct 10 '13 at 17:53
Do you know what would be the performance implications of a large mesh network? – CMCDragonkai Jun 18 '14 at 23:41
  1. It's possible to use client-to-client option of OpenVPN, but all client tunnels are terminated at the server.

  2. Define trust ? You can make a common conf file with the "duplicate-cn" option. This way client having the file is TRUSTED/allowed to connect by the server.

share|improve this answer
See my comment in ultrasawblade's answer... I go into a little more detail there. – thirtythreeforty Oct 10 '13 at 20:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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