This time we are going to add a third node, Node C, to the mesh network. Tinc is going to automatically choose the best route.
You should already be familiar with basic tinc configuration, that I described in previous article - Configuring Tinc, an encrypted P2P VPN.
|Node A||Node B||Node C|
|VPN Network Name||PsychoVPN||PsychoVPN||PsychoVPN|
Create the working directory:
mkdir -p /etc/tinc/PsychoVPN/hosts && cd /etc/tinc/PsychoVPN
Start off with
Name = NodeC
Now edit the host file:
Address = 22.214.171.124
Create a pair of keys (make sure to save both files under
tincd -n PsychoVPN -K 4096
Append the public key to the
NodeC host file.
cat rsa_key.pub >> hosts/NodeC
Exchange the host file with Node A and Node B
scp /etc/tinc/PsychoVPN/hosts/NodeC <user>@<NodeA>:/etc/tinc/PsychoVPN/hosts/NodeC
It’s also required for Node C to have both Node A’s and Node B’s host files. To do this, reverse the
scp to download files from Node A and Node B directly from Node C:
scp <user>@<NodeA>:/etc/tinc/PsychoVPN/hosts/NodeA /etc/tinc/PsychoVPN/hosts/NodeA
You can also just copy the content of the
hosts folder from any Node, saving you the hassle of authenticating twice:
scp <user>@<NodeA>:/etc/tinc/PsychoVPN/hosts/* /etc/tinc/PsychoVPN/hosts/
From this point just follow the previous article’s instructions starting from #Control Scrips. Just remember to adjust the IP addresses correspondingly!