OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • General Discussion »
  • Create peer for wireguard via API
« previous next »
  • Print
Pages: [1]

Author Topic: Create peer for wireguard via API  (Read 827 times)

c0nnected

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
    • View Profile
Create peer for wireguard via API
« on: March 09, 2024, 08:43:16 pm »
Hi,
I'm struggling with creating peers via API for my wireguard. I've managed to build this curl:

Code: [Select]
curl -X POST \
  -d '{ "clients": [ { "enabled": true, "name": "apitest", "pubkey": "pub_key_value", "tunneladdress": "10.1.1.100/32", "serveraddress": "192.168.62.105", "serverport":51280, "keepalive": 25} ]}' \
  -H "Content-Type: application/json" \
  -k \
  -u "key:secret" \
  https://IP:443/api/wireguard/client/set

as a result of this curl im getting response:
Code: [Select]
{"result":"saved"}
The problem is in gui I don't see this user, any idea why it doesn't work?
Logged

c0nnected

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
    • View Profile
Re: Create peer for wireguard via API
« Reply #1 on: March 11, 2024, 08:06:58 pm »
No one knows?
Logged

mimugmail

  • Hero Member
  • *****
  • Posts: 6767
  • Karma: 494
    • View Profile
Re: Create peer for wireguard via API
« Reply #2 on: March 11, 2024, 10:35:07 pm »
https://forum.opnsense.org/index.php?topic=33177.0
Logged
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

mimugmail

  • Hero Member
  • *****
  • Posts: 6767
  • Karma: 494
    • View Profile
Re: Create peer for wireguard via API
« Reply #3 on: March 11, 2024, 10:36:49 pm »
https://forum.opnsense.org/index.php?topic=30367.0
Logged
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

c0nnected

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
    • View Profile
Re: Create peer for wireguard via API
« Reply #4 on: March 12, 2024, 06:29:04 pm »
Quote from: mimugmail on March 11, 2024, 10:35:07 pm
https://forum.opnsense.org/index.php?topic=33177.0
that worked, thank you!
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • General Discussion »
  • Create peer for wireguard via API
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2