For the complete documentation index, see llms.txt. This page is also available as Markdown.

Import a network from a WireGuard configuration file

Devices found in the configuration are returned unmapped; use POST /api/v1/network/{network_id}/devices to assign them to users.

post
Authorizations
defguard_sessionstringRequired
Body
allow_all_groupsbooleanRequired
allowed_groupsstring[]Required
configstringRequired
endpointstringRequired
namestringRequired
Responses
201

Network imported.

application/json
post/api/v1/network/import
POST /api/v1/network/import HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 99

{
  "allow_all_groups": true,
  "allowed_groups": [
    "text"
  ],
  "config": "text",
  "endpoint": "text",
  "name": "text"
}
{
  "devices": [
    {
      "name": "text",
      "user_id": null,
      "wireguard_ips": [
        "text"
      ],
      "wireguard_pubkey": "text"
    }
  ],
  "network": {
    "acl_default_allow": true,
    "acl_enabled": true,
    "address": [
      "text"
    ],
    "allow_all_groups": true,
    "allowed_ips": [
      "text"
    ],
    "connected_at": null,
    "dns": null,
    "endpoint": "text",
    "fwmark": 1,
    "id": 1,
    "keepalive_interval": 1,
    "location_mfa_mode": "disabled",
    "mtu": 1,
    "name": "text",
    "peer_disconnect_threshold": 1,
    "port": 1,
    "pubkey": "text",
    "service_location_mode": "disabled"
  }
}

Last updated

Was this helpful?