User Tools

Site Tools


technical:vpn:tinc

This is an old revision of the document!


Tinc VPN

## Install Tinc

### Arch Linux

``` sudo pacman -S tinc ```

### Slackware Linux

``` wget https://slackbuilds.org/slackbuilds/15.0/network/tinc.tar.gz tar xzvf tinc.tar.gz cd tinc source tinc.info wget $DOWNLOAD sudo ./tinc.SlackBuild sudo installpkg tinc-1.0.36-x86_64-1_SBo.tgz ```

### MacOS

## Generate Keys

``` tincd -n <netname> -K ```

## Config

Copy keys to /etc/tinc/<netname>/

``` sudo mkdir -p /etc/tinc/<netname>hosts cp rsa_key.* /etc/tinc/<netname> ```

Create tinc-up and tinc-down scripts.

/etc/tinc/<netname>/tinc-up

``` #!/bin/bash TUN=“<interface>” SUB=“<network_address/subnet_mask>” IP=“<ip_address/subnet_mask>”

ip link set $TUN up ip addr add $IP dev tinc0 ip route add $SUB dev tinc0 ```

/etc/tinc/<netname>/tinc-down

``` #!/bin/bash TUN=“<interface>” SUB=“<network_address/subnet_mask>” IP=“<ip_address/subnet_mask>”

ip link set $TUN down ip route del $SUB dev $TUN ip addr del $IP dev $TUN ```

Create tinc configuration

/etc/tinc/<netname>/tinc.conf

``` Name = <hostname> Device = /dev/net/tun AddressFamily = ipv4 ConnectTo = <peer> Interface = <interface> Mode = router Port = <port> ```

Add tinc peers

``` Subnet = <tinc_ip_address> Address = <wan_ip_address>

<Peer's RSA Public Key> ```

## Startup

## Shell Script

technical/vpn/tinc.1684014677.txt.gz · Last modified: 2023/05/13 17:51 by jc