Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
This Tutorial explains how to build a simple MeshVPN network that consists of two Linux machines. It is assumed that you already have installed MeshVPN on these two machines, which will be called "Node A" and "Node B" from now on.
Configuration of node A
Create the meshvpn.conf of Node A with the following content:
port 7000 networkname ExampleNet psk mysecretpassword enabletunneling yes interface mvpn0 ifconfig4 192.168.0.1/24
This will open UDP port 7000 and create a virtual ethernet interface with the name mvpn0 and the IP address 192.168.0.1. Please note that Node A needs to be directly reachable from Node B and any further nodes that you will add to the network.
Configuration of node B
Create the meshvpn.conf of Node B with the following content:
port 7000 networkname ExampleNet psk mysecretpassword enabletunneling yes interface mvpn0 ifconfig4 192.168.0.2/24 initpeers node-a.example.org 7000
Replace node-a.example.org with the real address of Node A.
Testing the configuration
To test if everything works, start MeshVPN on both nodes. Each node should now have created its own mvpn0 interface. It may take some time until the VPN tunnel is built. Try to ping 192.168.0.2 from Node A or ping 192.168.0.1 from Node B. If you get a response, the VPN has been set up successfully!
Adding more nodes to the VPN
Copy the meshvpn.conf of Node B to the new node and change the IP address in the ifconfig command to 192.168.0.3, 192.168.0.4, and so on. If you start the node, there will be a tunnel to Node A first. After some time, tunnels to Node B and all other nodes should be automatically built.