#!/bin/bash trap "exit 1" ERR switch=br0 set -x #ip tuntap show "$1" #ip tuntap add "$1" mode tap user "$(whoami)" # Already created. ip link set "$1" up sleep 0.5s ip link set "$1" master "$switch" #ip tuntap show "$1"