Synology - Setting a personal VPN with the NAS

Prerequisite: If you do not have a static IP, enable and set the DDNS on the SYNOLOGY NAS.

SETTING THE SYNOLOGY

  • Install the package [VPN Server] in the Synology NAS.
  • In my opinion (and for my needs) it's better to create only one VPN user and give the permision to fruition the VPN enviroment only to him. It's better that the password is very complex.
  • Run it. In the left, from the group [Set up VPN Server], select [OpenVPN].
  • Put a tick in [Enable OpenVPN server].
  • Change the range of the Dinamic IP, if needed.
  • Take note of the port "1194" and the protocol "UPD": it will be needed for setting the port forwarding in the Firewall.
  • Click on [Export configuration] to have a zip archive content the certificate [ca.crt] and the configurations [VPNConfig.ovpn]

SETTING THE FIREWALL

Setting the firewall that's connected to the NAS, creating a rule with this parameter:
    name VPN
    protocol UPD
    local IP address
[the IP of the NAS, it's better to give him a static internal IP]
    local port 1194

        (or range 1194-1194)
    WAN IP address ANY
    WAN port 1194

        (or range 1194-1194)

SETTING OPENVPN IN WINDOWS

From here, download OpenVPN and install it on the PC.
Run OpenVPN GUI as administrator.
Get VPNConfig.ovpn from the zip archive, edit it:
    replace YOUR_SERVER_IP with the public IP of NAS or the hostname registered in the DDNS service of your NAS Synology
    add those lines:
        auth-user-pass auth.txt
        route 0.0.0.0 0.0.0.0 vpn_gateway 500
Put it in C:\Program Files\OpenVPN\config
Ever in C:\Program Files\OpenVPN\config create a file named auth.txt
Edit it adding two lines: in the first one the user name created in Synology and in the second one its password.


CREATE AN AUTOMATIC TASK IN WINDOWS

Create a task in Task Scheduler with these rules:
    At log on, 
    start C:\Program Files\OpenVPN\bin\openvpn-gui.exe
    with those parameters --connect VPNConfig.ovpn

No comments:

Post a Comment