First commit

This commit is contained in:
Xavier Logerais 2017-05-23 13:18:24 +02:00
parent d717531f6c
commit 459df6e30b
7 changed files with 63 additions and 2 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
Makefile.conf
tmp/
keys/
configs/

27
Makefile.conf.sample Normal file
View File

@ -0,0 +1,27 @@
##### PARAMS
nets = myfirstnet
net_myfirstnet_domain = net.private
net_myfirstnet_hosts = privatehost1 privatehost2
net_myfirstnet_privatehost1_public_address = privatehost1.private.lan
net_myfirstnet_privatehost1_local_address = 192.168.100.1/24
net_myfirstnet_privatehost1_local_subnets = 192.168.100.0/24 192.168.10.0/24 192.168.20.0/24
net_myfirstnet_privatehost2_local_address = 192.168.101.1/24
net_myfirstnet_privatehost2_local_subnets = 192.168.101.0/24
nets += mysecondnet
net_mysecondnet_domain = mysecondnet.public
net_mysecondnet_hosts = host1 host2
net_mysecondnet_host1_public_address = host1.somedomain.com
net_mysecondnet_host1_public_port = 656
net_mysecondnet_host1_local_address = 192.168.200.2/24
net_mysecondnet_host1_local_subnets = 192.168.200.0/24
net_mysecondnet_host2_public_address = host2.otherdomain.com
net_mysecondnet_host2_local_address = 192.168.201.1/24
net_mysecondnet_host2_local_subnets = 192.168.201.0/24 192.168.111.0/24 192.168.112.0/24

View File

@ -1,3 +1,11 @@
# tinc # Script de génération de configuration pour le VPN tinc
Ce dépot contient un Makefile permettant de simplifier la génération des confs pour le VPN [tinc](https://tinc-vpn.org)
## Génération des confs
1. Faites une copie du fichier Makefile.conf.sample nomée Makefile.conf.
2. Editez ce dernier avec vos préférences.
3. Lancez la génération des confs avec la commande ```make```
4. Copiez les configurations générées vers les hôtes respectifs.
Scripts pour générer des confs pour [tinc](https://tinc-vpn.org)

6
scripts/subnet-down Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
if [ "$NODE" != "$HOSTNAME" ]
then
ip route delete $SUBNET dev $INTERFACE
fi

6
scripts/subnet-up Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
if [ "$NODE" != "$NAME" ]
then
ip route add $SUBNET dev $INTERFACE
fi

3
scripts/tinc-down Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
ip link set $INTERFACE down

7
scripts/tinc-up Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
ADDRESS=
ip address add $ADDRESS dev $INTERFACE
ip link set $INTERFACE up