ericjarvies
1/21/2017 - 12:00 AM

Tinc OS X

Tinc OS X

Install Xcode

Install Xcode tools;

xcode-select --install

Install LZO;

curl -OL http://www.oberhumer.com/opensource/lzo/download/lzo-2.09.tar.gz
tar -xzf lzo-2.09.tar.gz
cd lzo-2.09
./configure --enable-shared && make && sudo make install

Install Zlib;

curl -OL http://zlib.net/zlib-1.2.11.tar.gz
tar -xzf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure && make && sudo make install

Install OpenSSL;

curl -OL https://www.openssl.org/source/openssl-1.0.2j.tar.gz
tar -xzf openssl-1.0.2j.tar.gz
cd openssl-1.0.2j
./Configure darwin64-x86_64-cc shared enable-ec_nistp_64_gcc_128 no-ssl2 no-ssl3 no-comp --openssldir=/usr/local/
make depend
sudo make install

Install Tinc;

curl -OL https://tinc-vpn.org/packages/tinc-1.1pre14.tar.gz
tar -xzf tinc-1.1pre14.tar.gz
cd tar -xzf tinc-1.1pre14
./configure --prefix=/ --exec-prefix=/usr --datadir=/etc --localstatedir=/var
make
sudo make install

Check links;

otool -L /usr/sbin/tinc
otool -L /usr/sbin/tincd

Configure options;

Fine tuning of the installation directories:
  --bindir=DIR            user executables [EPREFIX/bin]
  --sbindir=DIR           system admin executables [EPREFIX/sbin]
  --libexecdir=DIR        program executables [EPREFIX/libexec]
  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
  --libdir=DIR            object code libraries [EPREFIX/lib]
  --includedir=DIR        C header files [PREFIX/include]
  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
  --infodir=DIR           info documentation [DATAROOTDIR/info]
  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
  --mandir=DIR            man documentation [DATAROOTDIR/man]
  --docdir=DIR            documentation root [DATAROOTDIR/doc/tinc]
  --htmldir=DIR           html documentation [DOCDIR]
  --dvidir=DIR            dvi documentation [DOCDIR]
  --pdfdir=DIR            pdf documentation [DOCDIR]
  --psdir=DIR             ps documentation [DOCDIR]

By default, `make install' will install all the files in `$ac_default_prefix/bin', `$ac_default_prefix/lib' etc. You can specify an installation prefix other than `$ac_default_prefix' using `--prefix', for instance `--prefix=$HOME'.

Optional (if needed);

export LD_LIBRARY_PATH=/usr/local/lib
--without-liblzo2
--disable-lzo
--with-lzo-headers=/usr/local/include/lzo
--with-lzo-lib=/usr/local/lib
./configure --with-liblzo2=/usr/local/lib/liblzo2.a
export CFLAGS=-I/usr/local/include
export LDFLAGS=-L/usr/local/lib
export LIBCURL_CFLAGS=-I/usr/local/include
export LIBCURL_LIBS=-L/usr/local/lib

start tincd on OS X;

sudo tincd -c /usr/etc/tinc/ --pidfile=/usr/var/run/tincd.pid -D --debug=4
sudo tincd -c /usr/etc/tinc/propertydb --pidfile=/usr/var/run/tincd.pid -D --debug=5
sudo tinc -n propertydb

OS X tinc-up file;

#!/bin/sh
ifconfig $INTERFACE 10.0.0.100 10.0.0.1 mtu 1500 netmask 255.255.255.255

#route traffic on 10.0.0.0/24 over our vpn
route add -net 10.0.0.255 10.0.0.1 255.255.255.0