home will be the name of the network
Main folder:
/etc/tinc/home/
tincd -n home -K
Name = nas
ConnectTo = frenz
Device = /dev/net/tun
| #!/bin/sh | |
| _FOLDER="/etc/tinc/home" | |
| _NAME="$(grep -Po '(?<=Name = ).*' ${_FOLDER}/tinc.conf)" | |
| _IP_ADDR="$(grep Subnet ${_FOLDER}/hosts/${_NAME} | grep -oE '((1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])')" | |
| ip addr del ${_IP_ADDR}/24 dev $INTERFACE | |
| ip link set $INTERFACE down |
| #!/bin/sh | |
| _FOLDER="/etc/tinc/home" | |
| _NAME="$(grep -Po '(?<=Name = ).*' ${_FOLDER}/tinc.conf)" | |
| _IP_ADDR="$(grep Subnet ${_FOLDER}/hosts/${_NAME} | grep -oE '((1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])')" | |
| ip link set $INTERFACE up | |
| ip addr add ${_IP_ADDR}/24 dev $INTERFACE |