test-net0.sh 494 B

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