Added script for setting up the tun device

This commit is contained in:
Thomas Kolb 2022-04-07 20:34:21 +02:00
parent 47fc177e87
commit bfe27d3ead

16
impl/setup_tundev.sh Executable file
View file

@ -0,0 +1,16 @@
#!/bin/sh
if [ -z "$1" ]; then
echo "usage: $0 <device-id>"
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