example: create wireguard and tunnel device
[project/unetd.git] / examples / test-net0.sh
index 5089ee1f7133a5aab02007dcb73ad05dd2d36778..06de301175a09105ad9ec3f3de5b1209b7dbae52 100755 (executable)
@@ -2,10 +2,15 @@
 ifname="${1:-wg0}"
 host="${2:-ap1}"
 
+ip link add dev $ifname type wireguard > /dev/null 2>&1
+
 ../unetd -d -h $PWD/hosts -N '{
        "name": "'"$ifname"'",
        "type": "file",
        "key": "'"$(cat ./net0-${host}.key)"'",
        "file": "'"$PWD/net0.json"'",
+       "tunnels": {
+               "vx0": "l2-tunnel"
+       },
        "update-cmd": "'"$PWD/../scripts/update-cmd.pl"'"
 }'