Update VPN settings
POST/api/settings
Updates the OpenVPN and WireGuard IPv4 networks, the DNS server, allowICC and the tunnel routing. Only the fields sent are changed; omitted fields keep their current values, and other fields (such as those returned by the GET) are ignored, so the whole settings object can be sent back. tunnelRouting, when sent, replaces the current one as a whole. The IPv6 networks cannot be changed here. In custom routing mode customCidrs must hold at least one valid IPv4 or IPv6 CIDR (duplicates are removed); in full mode it is cleared. The settings are then applied: the OpenVPN config is rewritten and OpenVPN restarted, and the WireGuard interface is brought down and up again, so connected clients drop briefly. While Cloudron manages routing, the saved tunnelRouting is kept but Cloudron's routing is what clients get. Only admins may call it.
Returns 400 if settings is not an object, or if the merged settings are invalid: a network that is not an IPv4 address, a changed network that does not end in .0, the same network for OpenVPN and WireGuard, a dnsServer that is neither empty nor an IPv4 address, a non-boolean allowICC, or a tunnelRouting that is not an object, has an unknown mode, or has missing or invalid CIDRs in custom mode.
Request
Responses
- 201
- 400
- 401
- 403
- 500
Settings saved. Empty object.
Request failed.
Request failed.
Requires admin privileges.
Request failed.