How to Install Tinc on FreeBSD

Tinc is a Virtual Private Network (VPN) daemon that allows multiple hosts to securely communicate with each other over the public internet. This tutorial will guide you through the process of installing Tinc on FreeBSD 12.2.

Prerequisites

This guide assumes you have administrative access to a FreeBSD 12.2 installation with an active internet connection.

Step 1: Update the system

Update the system by running the following command:

pkg update && pkg upgrade

Step 2: Install Tinc

Install Tinc by running the following command:

pkg install tinc

This will download and install Tinc and all its dependencies.

Step 3: Configure Tinc

Create a directory for your Tinc configuration files:

mkdir /usr/local/etc/tinc

Navigate to the newly created directory:

cd /usr/local/etc/tinc

Create a new Tinc network named myvpn:

tincd -n myvpn -K4096

This will create a new directory named myvpn and generate a new public/private key pair with 4096 bits of encryption.

Step 4: Create configurations

Navigate to the myvpn directory:

cd myvpn

Create a file named tinc.conf with the following content:

Name = hostname
AddressFamily = ipv4

Replace hostname with the hostname or IP address of your FreeBSD system.

Create a file named hosts with the following content:

hostname
    Address = ip_address

Replace hostname with the hostname or IP address of a remote host that will be connecting to your VPN. Replace ip_address with the IP address of the same remote host.

Step 5: Start Tinc

Start Tinc by running the following command:

tincd -n myvpn

This will start the Tinc daemon and listen for incoming connections.

Step 6: Configure firewall

If you have a firewall enabled on your FreeBSD system, you need to allow incoming connections on the UDP port that Tinc uses, which is 655.

Add the following rule to your firewall configuration:

pass in proto udp from any to any port 655

Conclusion

You have successfully installed and configured Tinc on FreeBSD. You can now connect to your VPN from a remote host by following the same steps on that host and exchanging public key information.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!