hamnet70/impl/setup_tundev.sh

19 lines
352 B
Bash
Executable File

#!/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
HOSTID="$1"
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 fd73::$HOSTID/64