free conexion










Applied Models:

All NAS Series
Answer:

If you need to connect to an OpenVPN server using an .ovpn file, you can establish a connection through the following steps in QTS 4.2:

Create a text file “openvpn_client_login.txt” with your username and password in it:
Admin Connection username
Password123 Connection password Connect to the NAS via SSH (default port is 22) using the admin account and import these files to “/etc/openvpn”:
The .ovpn configuration file (hereinafter referred to as “openvpn.ovpn”.)
Certificate (hereinafter referred to as “ca.crt”, if it is not provided, then it is unnecessary.)
Text file: “openvpn_client_login.txt”.

Change mode openvpn_client_login.txt:
chmod 600 /etc/openvpn/openvpn_client_login.txt

Rename openvpn.ovpn:
mv /etc/openvpn/openvpn.ovpn /etc/openvpn/client.conf

Edit /etc/openvpn/client.conf:
ca /etc/openvpn/ca.crt (Specify the certification location)
auth-user-pass /etc/openvpn/openvpn_client_login.txt (Specify the username and password)
up /etc/openvpn/openvpn_up
down /etc/openvpn/openvpn_down
Note: use the c. and d. entries if you want to set this VPN connection as the default gateway.
Using the QNAP NAS' built-in OpenVPN Server configuration file as an example (modified parts are marked in yellow):
client
dev tun
script-security 3
proto tcp
remote 172.17.20.134 1194
resolv-retry infinite
nobind
ca /etc/openvpn/ca.crt
auth-user-pass /etc/openvpn/openvpn_client_login.txt
reneg-sec 0
cipher AES-128-CBC
writepid /var/run/openvpn.client.pid
up /etc/openvpn/openvpn_up
down /etc/openvpn/openvpn_down
daemon openvpn-client

Add the command lines in /etc/config/vpn.conf
[OPENVPN_CLIENT4]
Enable = TRUE
Status = 1
Index = 4
Gateway = 1
Allow Connect = 0
Reconnect = 1
Server Address = OpenVPN.myQNAPcloud.com
Profile File = OpenVPN4
VPN Proto Type = TCP
VPN Port = 1194
Compress = 1
Re-direct gateway = 1
Encryption = 1
Name = admin
AccessCode = AAA
Time Stamp = 0 Please follow these instructions and enter the bold red part:
[OPENVPN_CLIENT4]: According to your established OpenVPN Client connection number +1. As in the following illustration: three OpenVPN connection is established, so enter: 4.

Enable = TRUE: Enable this connection (it will be “False” when the connection is disconnected.)
Status = 1: Enable this connection (it will be “0” when the connection is disconnected.)
Index = 4: Same as item A.
Gateway = 1: If you want to set this VPN connection to be the default gateway then set to 1, and vice versa, set to 0.
Server Address = OpenVPN.myQNAPcloud.com: The VPN server’s IP address or domain.
Profile File = OpenVPN4: The name shown on the VPN client page.
VPN Proto Type = TCP: The VPN connection protocol.
VPN Port = 1194: The VPN connection port number.
Compress = 1: Enable compression, or set as 0 to disable it.
Name = admin: The connection username.

Start VPN connection:
Enter the command: /etc/init.d/vpn_openvpn_client.sh start 4 &
(Note: the number “4” is the index of this connection)

Set DNS:
Edit /etc/resolv.conf, adding the DNS IP address (e.g. 8.8.8.8)
nameserver 8.8.8.8
nameserver 10.8.2.11
nameserver 172.16.2.11

Check the connection:
Enter ps | grep openvpn, If the reply contains the red part, it means that the connection has been established:
    6714 admin     536 R     grep openvpn
    31906 admin     2152 S     /usr/sbin/openvpnclient /etc/openvpn/client.conf
Or you can go to VPN client page, the connection is already receiving and transmitting packets.

Disconnect:
Click “disconnect” in the VPN client page.

Re-connect:
Please note, if you want to reconnect to the VPN, do not click the “connect” button in the VPN client page. Please repeat these settings:
Edit /etc/config/vpn.conf:
Enable = TRUE
Status = 1
Enter the command line: # /etc/init.d/vpn_openvpn_client.sh start 4 &

ليست هناك تعليقات:

إرسال تعليق

5 نصائح بسيطة من شأنها تحسين مهاراتك في الألعاب في عام 2020 يعد لعب ألعاب الكمبيوتر أمرًا ممتعًا للغاية ، وبالنسبة للبعض...