2024-05-31 20:09:53 +02:00
|
|
|
#!/bin/bash
|
2022-04-07 20:34:21 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2022-04-07 20:44:07 +02:00
|
|
|
HOSTID="$1"
|
|
|
|
|
2022-04-07 20:34:21 +02:00
|
|
|
DEV=hamnet70
|
|
|
|
|
|
|
|
sudo ip tuntap add dev $DEV mode tun user $(whoami)
|
2024-07-19 21:59:38 +02:00
|
|
|
sudo ip link set dev $DEV txqueuelen 16 # default is 500
|
2022-04-07 20:34:21 +02:00
|
|
|
sudo ip link set dev $DEV up
|
2022-04-07 20:44:07 +02:00
|
|
|
sudo ip address add dev $DEV fd73::$HOSTID/64
|