Trutun creates secret tunnel by IP address using Teonet TRU transport. TRU create reliable, low latency and encrypted channel between connected peers.
Create regular tunnel between two hosts
Server:
# Start tunnel server
TRU=tru1 && sudo go run ./cmd/trutun -name=$TRU -p=9000 -loglevel=Debug -stat -hotkey
# Post connect commands, run it in other terminal
TRU=tru1 && sudo ip addr add 10.1.1.10/24 dev $TRU && sudo ip link set up dev $TRU
Client:
# Start tunnel client
TRU=tru2 && sudo go run ./cmd/trutun -name=$TRU -a=host.name:9000 -loglevel=Debug -stat -hotkey
# Post connect commands, run it in other terminal
TRU=tru2 && sudo ip addr add 10.1.1.11/24 dev $TRU && sudo ip link set up dev $TRU
You can simplify this commands by using post connection
parameter and predefined shell script if_up.sh
Server:
# Start tunnel server
TRU=tru1 && sudo go run ./cmd/trutun -name=$TRU -p=9000 -loglevel=Debug -stat -hotkey -pc="./if_up.sh $TRU 10.1.1.10/24"
Client:
# Start tunnel client
TRU=tru2 && sudo go run ./cmd/trutun -name=$TRU -a=host.name:9000 -loglevel=Debug -stat -hotkey -pc="./if_up.sh $TRU 10.1.1.11/24"
Parameters -loglevel=Debug
, -stat
, -hotkey
are unnessesary and you can remove it from Start tunnel parameters. They are used to show statistic and log information.