example: create wireguard and tunnel device
authorFelix Fietkau <nbd@nbd.name>
Thu, 23 Jun 2022 08:46:19 +0000 (10:46 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 23 Jun 2022 08:46:19 +0000 (10:46 +0200)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
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"'"
 }'