Difference between revisions of "Tinc"

From Tmplab
(Keygeneration)
(Keygeneration)
Line 39: Line 39:
  
 
* to be run for each client
 
* to be run for each client
* tincd -n networkname -K4096
+
tincd -n networkname -K4096
 
* private key goes to /etc/tinc/networkname
 
* private key goes to /etc/tinc/networkname
 
* public key goes to /etc/tinc/networkname/hosts
 
* public key goes to /etc/tinc/networkname/hosts

Revision as of 10:14, 25 May 2016

Linux style Basic tinc-vpn setup

All Nodes Configuration Directory Structure

/etc/tinc/
          nets.boot
          networkname/
                      tinc.conf
                      tinc-up
                      tinc-down
                      hosts/
                            client1
                            client2
                            ...
                            tincserver

nets.boot

networkname

tinc.conf for client1

Name=client1
Device=/dev/net/tun
ConnectTo=tincserver
AddressFamily = ipv4

tinc-up for client1

#!/bin/bash
ifconfig $INTERFACE 192.168.22.1 netmask 255.255.255.0

tinc-down for client1

#!/bin/bash
ifconfig $INTERFACE down

Keygeneration

  • to be run for each client
tincd -n networkname -K4096
  • private key goes to /etc/tinc/networkname
  • public key goes to /etc/tinc/networkname/hosts
  • add the first two lines as shown below according to client or server function

hosts/client1

Name=client1
Subnet=192.168.22.1
-----BEGIN RSA PUBLIC KEY-----
....
-----END RSA PUBLIC KEY-----

hosts/client2

Name=client2
Subnet=192.168.22.2
-----BEGIN RSA PUBLIC KEY-----
....
-----END RSA PUBLIC KEY-----

hosts/tincserver

Subnet=192.168.22.254
Address=SERVERPUBLICIP