Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Geitjie

#1
Having the same issue when trying to add client to wireguard.

Quote from: PJAU on January 04, 2023, 12:19:10 PM
Quote

When run the curl command
curl -X POST -d '{"enabled":"1","name":"test.user","pubkey":"$key","tunneladdress":"xxx.xxx.xxx.xxx/xx"}' -H "Content-Type: application/json" -k -u $key:$secret https://$IP/api/wireguard/client/addClient
I get the same message {"result":"failed"}.

There is nothing to find in any log files, so what am I doing wrong?

Thank you in advance.

I just hit this also; you need the following format:

curl -X POST -d '{"client":{"enabled":"1","name":"test.user","pubkey":"$key","tunneladdress":"xxx.xxx.xxx.xxx/xx"}}' -H "Content-Type: application/json" -k -u $key:$secret https://$IP/api/wireguard/client/addClient

i.e: Wrap your existing code in an outer {"client": ... }



Have tried adding {"client": ...} which also just returns , {"result":"failed"}