From bfe27d3eada2e9ab96cd390109871f6f585d3ed7 Mon Sep 17 00:00:00 2001 From: Thomas Kolb Date: Thu, 7 Apr 2022 20:34:21 +0200 Subject: [PATCH] Added script for setting up the tun device --- impl/setup_tundev.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 impl/setup_tundev.sh diff --git a/impl/setup_tundev.sh b/impl/setup_tundev.sh new file mode 100755 index 0000000..eef4411 --- /dev/null +++ b/impl/setup_tundev.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +if [ -z "$1" ]; then + echo "usage: $0 " + echo + echo "device-id: Unique number of this device. Will go into the last byte of the IP address." + exit 1 +fi + +set -euo pipefail + +DEV=hamnet70 + +sudo ip tuntap add dev $DEV mode tun user $(whoami) +sudo ip link set dev $DEV up +sudo ip address add dev $DEV 10.99.99.1/24