449289929bcbb93dca6c495bece544fb795d6d7c
[project/unetd.git] / examples / test-net0.sh
1 #!/bin/sh
2 ifname="${1:-wg0}"
3 host="${2:-ap1}"
4
5 ip link add dev $ifname type wireguard > /dev/null 2>&1
6
7 # [ "$ifname" != "net0" ] && ln -sf net0.bin "${ifname}.bin"
8
9 ../unetd -D $PWD -d -h $PWD/hosts -N '{
10 "name": "'"$ifname"'",
11 "type": "dynamic",
12 "auth_key": "'"$(cat ./net0.pub)"'",
13 "key": "'"$(cat ./net0-${host}.key)"'",
14 "file": "'"$PWD/net0.json"'",
15 "tunnels": {
16 "vx0": "l2-tunnel"
17 },
18 "update-cmd": "'"$PWD/../scripts/update-cmd.pl"'"
19 }'