Skip to content

Instantly share code, notes, and snippets.

@jasonehines
Created February 10, 2017 20:43
Show Gist options
  • Save jasonehines/ec754ffff182d2ff8a709931b8525d20 to your computer and use it in GitHub Desktop.
Save jasonehines/ec754ffff182d2ff8a709931b8525d20 to your computer and use it in GitHub Desktop.
#how to install tinc
sudo eopkg install -c system.devel
sudo eopkg install lzo-devel git
mkdir Source
cd Source
git clone https://github.com/gsliepen/tinc.git
cd tinc
autoreconf --install
./configure
sudo make install
#switch to root
sudo su -
mkdir /usr/local/etc/
#add tinc folder to etc
#edit tinc-up and add
ip link set tun0 up
mkdir -p /usr/local/var/run/
modprobe tun
#reboot
reboot
#login in as root again
sudo su -
# start tinc in debug mode
tincd -n [yournetworkname] -D -d3
#test by pinging your server
ping [yourserverip]
#quit the debug (ctrl+\)
#setup the service
#change the working directory path
nano /usr/lib64/systemd/system/tinc.service
contents of modified tinc.service:
# This is a mostly empty service, but allows commands like stop, start, reload
# to propagate to all tinc@ service instances.
[Unit]
Description=Tinc VPN
After=network.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/true
ExecReload=/bin/true
WorkingDirectory=/usr/local/etc/tinc
[Install]
WantedBy=multi-user.target
#change the working directory, exec start and exec reload paths
nano /usr/lib64/systemd/system/tinc@.service
contents of modified tinc@.service:
[Unit]
Description=Tinc net %i
PartOf=tinc.service
ReloadPropagatedFrom=tinc.service
[Service]
Type=simple
WorkingDirectory=/usr/local/etc/tinc/%i
ExecStart=/usr/local/sbin/tincd -n %i -D
ExecReload=/usr/local/sbin/tincd -n %i -kHUP
TimeoutStopSec=5
Restart=always
RestartSec=60
[Install]
WantedBy=tinc.service
systemctl enable tinc
systemctl start tinc
systemctl enable tinc@[yournetworkname]
systemctl start tinc@[yournetworkname]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment