Skip to main content

VPN

warning

This API is partially documented or under construction.

Overview​

API wrapper for Synology VPN Server.

Provides methods to retrieve VPN settings, active connections, logs, network interfaces, security autoblock settings, permissions, and VPN protocol-specific settings.

Methods​

settings_list​

Retrieve VPN server settings.

Internal API​

SYNO.VPNServer.Settings.Config

Returns​

dict[str, object] or str
VPN server settings as a dictionary, or an error message as a string.


active_connections_list​

Retrieve a list of active VPN connections.

Internal API​

SYNO.VPNServer.Management.Connection

Parameters​

sort str
Field to sort by. Default is 'login_time'.

sort_dir str
Sort direction ('ASC' or 'DESC'). Default is 'DESC'.

start int
Pagination start index. Default is 0.

limit int
Maximum number of results to return. Default is 100.

Returns​

dict[str, object] or str
Active connections as a dictionary, or an error message as a string.


log_list​

Retrieve VPN server logs.

Internal API​

SYNO.VPNServer.Management.Log

Parameters​

start int
Pagination start index. Default is 0.

limit int
Maximum number of logs to return. Default is 50.

prtltype int
Protocol type filter. Default is 0 (all).

Returns​

dict[str, object] or str
Logs as a dictionary, or an error message as a string.


network_interface_setting​

Retrieve VPN network interface settings.

Internal API​

SYNO.VPNServer.Management.Interface

Returns​

dict[str, object] or str
Network interface settings as a dictionary, or an error message as a string.


security_autoblock_setting​

Retrieve security autoblock settings.

Internal API​

SYNO.Core.Security.AutoBlock

Returns​

dict[str, object] or str
Autoblock settings as a dictionary, or an error message as a string.


permission_setting​

Retrieve VPN permission settings.

Internal API​

SYNO.VPNServer.Management.Account

Parameters​

start int
Pagination start index. Default is 0.

limit int
Maximum number of results to return. Default is 100.

Returns​

dict[str, object] or str
Permission settings as a dictionary, or an error message as a string.


pptp_settings_info​

Retrieve PPTP VPN settings.

Internal API​

SYNO.VPNServer.Settings.Config

Returns​

dict[str, object] or str
PPTP settings as a dictionary, or an error message as a string.


openvpn_settings_info​

Retrieve OpenVPN settings.

Internal API​

SYNO.VPNServer.Settings.Config

Returns​

dict[str, object] or str
OpenVPN settings as a dictionary, or an error message as a string.


l2tp_settings_info​

Retrieve L2TP VPN settings.

Internal API​

SYNO.VPNServer.Settings.Config

Returns​

dict[str, object] or str
L2TP settings as a dictionary, or an error message as a string.


openvpn_export_configuration​

Download the OpenVPN configuration as a zip file or bytes.

Internal API​

SYNO.VPNServer.Settings.Certificate

Parameters​

as_zip_file bool
If True, return a ZipFile object. If False, return bytes. Default is False.

Returns​

bytes or ZipFile
The OpenVPN configuration file as bytes, or a ZipFile object if as_zip_file is True.


core_network_vpn_get​

Get DSM network VPN settings.

Internal API​

SYNO.Core.Network.VPN

Returns​

dict[str, object] or str
General DSM network VPN configuration.


core_network_vpn_set​

Set DSM network VPN settings.

Internal API​

SYNO.Core.Network.VPN

Parameters​

reconnect bool
Enable automatic reconnection. Defaults to True.

interval int
Reconnection interval in seconds. Defaults to 30.

Returns​

dict[str, object] or str
API response.


core_network_openvpn_ca_get​

Get DSM network OpenVPN certificate authority information.

Internal API​

SYNO.Core.Network.VPN.OpenVPN.CA

Returns​

dict[str, object] or str
OpenVPN CA certificate details.


core_network_openvpn_ca_set​

Set DSM network OpenVPN CA certificate information.

Internal API​

SYNO.Core.Network.VPN.OpenVPN.CA

Parameters​

ca_path str
Path to the CA certificate file on the NAS.

Returns​

dict[str, object] or str
API response.


core_network_openvpn_with_conf_get​

Get DSM network OpenVPN profile configured through an ovpn file.

Internal API​

SYNO.Core.Network.VPN.OpenVPNWithConf

Returns​

dict[str, object] or str
OpenVPN config-file-based profile details.


core_network_openvpn_with_conf_set​

Set DSM network OpenVPN profile configured through an ovpn file.

Internal API​

SYNO.Core.Network.VPN.OpenVPNWithConf

Parameters​

conf_path str
Path to the ovpn config file on the NAS.

username str
Username for VPN authentication.

password str
Password for VPN authentication.

Returns​

dict[str, object] or str
API response.


core_network_openvpn_with_conf_certs_get​

Get certificates for DSM network OpenVPN config-file-based profiles.

Internal API​

SYNO.Core.Network.VPN.OpenVPNWithConf.Certs

Returns​

dict[str, object] or str
Certificate details for the OpenVPN config profile.


core_network_openvpn_with_conf_certs_set​

Set certificates for DSM network OpenVPN config-file-based profiles.

Internal API​

SYNO.Core.Network.VPN.OpenVPNWithConf.Certs

Parameters​

cert_path str
Path to the client certificate file on the NAS.

key_path str
Path to the private key file on the NAS.

ca_path str
Path to the CA certificate file on the NAS.

Returns​

dict[str, object] or str
API response.