📜 ⬆️ ⬇️

PeerVPN - Open Source Peering VPN

Translation of the announcement and small documentation of the PeerVPN project, which seemed interesting to me.

PeerVPN


This is a program that creates a virtual LAN from several remote computers. Such networks can be useful for direct communication between applications, such as file or game sharing. Often, it is impossible to establish such interaction using conventional methods due to firewalls or NAT.

Traditional VPNs work in a client-server fashion, with many nodes connecting to a single server. Such a star topology has drawbacks. The central server must have large bandwidth to handle all network traffic. If the server crashes, the network crashes.
')
PeerVPN works on distributed technology, when all nodes communicate with each other without the need for a central server. If one node goes down, it does not affect the network.

Setting up the network is simple. You need to specify the network name, password, and contact information (IP and port) of another node. Adding new nodes does not require reconfiguration of the network, their addresses are distributed over the network automatically.

Properties


- Ethernet support via TAP
- IPv6 support
- distributed technology
- automatic raising of tunnels through firewall and NAT without additional settings
- support of shared keys and authorization

Platforms


Linux and FreeBSD. OpenSSL is required

License


PeerVPN is licensed under the GPLv3.

Download


Version 0.042 (2015-01-21)

source code: peervpn-0-042.tar.gz
statically linked x86 binary for Linux: peervpn-0-042-linux-x86.tar.gz

Webpage


www.peervpn.net

Setup example


Suppose you installed PeerVPN on two Linux computers, which we will call “Node A” and “Node B”.

Configure Node A

Create a peervpn.conf file with the following contents:

port 7000 networkname ExampleNet psk mysecretpassword enabletunneling yes interface peervpn0 ifconfig4 10.8.0.1/24 


UDP port 7000 will be opened and a virtual Ethernet interface created under the name peervpn0 and with the address 10.8.0.1.

Node A must be accessible directly from Node B. If Node A is located behind NAT, you need to flip port 7000.

Node B setup

Create a peervpn.conf file with the following contents:

 port 7000 networkname ExampleNet psk mysecretpassword enabletunneling yes interface peervpn0 ifconfig4 10.8.0.2/24 initpeers node-a.example.com 7000 


Instead of node-a.example.com, you need to substitute the address of node A.

Testing

Run PeerVPN on both nodes. On each should appear peervpn0 interface. Setting up a VPN tunnel can take some time. Try pinganut 10.8.0.2 from host A or 10.8.0.1 from host B. If the answer is received, then the VPN works!

Adding nodes to the network

Copy peervpn.conf from node B to the new node and change the IP in the ifconfig command to 10.8.0.3, 10.8.0.4, etc. When the node is started, a tunnel will first be built to node A, and after a while - to node B and other nodes of the network.

Source: https://habr.com/ru/post/250277/


All Articles