Compile & Install Tinc

  • sudo apt-get install -y build-essential libncurses5-dev libreadline6-dev libzlcore-dev zlib1g-dev liblzo2-dev libssl-dev
  • wget http://tinc-vpn.org/packages/tinc-1.1pre14.tar.gz
  • tar zxvf tinc-1.1pre14.tar.gz && cd tinc-1.1pre14 && ./configure && make
  • sudo make install

Open firewall

  • sudo ufw allow 655

setting tinc up (master)

  • sudo mkdir -p /usr/local/etc/tinc/vpn/
  • sudo tinc -n vpn init master
  • sudo tinc -n vpn add subnet 20.0.0.1
  • sudo tinc -n vpn add address=myrouter.domain.ninja-or-ip
  • sudo su
  • echo 'ip addr add 20.0.0.1/24 dev $INTERFACE' > usr/local/etc/tinc/vpn/tinc-up
  • echo 'ip link set $INTERFACE up' >> usr/local/etc/tinc/vpn/tinc-up
  • exit
  • sudo mkdir -p /usr/local/var/run/

setting tinc up (slave)

  • sudo mkdir -p /usr/local/etc/tinc/vpn/
  • sudo tinc -n vpn init slave
  • sudo tinc -n vpn add connectto master
  • sudo tinc -n vpn add subnet 20.0.0.2
  • sudo su
  • echo 'ip addr add 20.0.0.2/24 dev $INTERFACE' > usr/local/etc/tinc/vpn/tinc-up
  • echo 'ip link set $INTERFACE up' >> usr/local/etc/tinc/vpn/tinc-up
  • exit
  • sudo mkdir -p /usr/local/var/run/

Syncing the keys to the kingdom

sudo lftp user@master:22 -e "mirror --verbose /usr/local/etc/tinc/vpn/hosts /usr/local/etc/tinc/vpn/hosts"

sudo lftp user@slave:22 -e "mirror --verbose /usr/local/etc/tinc/vpn/hosts /usr/local/etc/tinc/vpn/hosts"

test the setup tincd -n vpn -D -d3 on both machines