Мы используем cookie-файлы, чтобы улучшить эту веб-страницу. Ознакомьтесь с Политикой в отношении cookie-файлов .

NAS 323

Использование NAS в качестве VPN сервера

Узнайте об использовании ASUSTOR NAS в качестве VPN сервера и о подключении к нему из ОС Windows и Mac.

2024-03-25

ЦЕЛИ КУРСА
После прохождения этого курса вы получите следующие умения:
1. Узнаете об использовании ASUSTOR NAS в качестве VPN сервера и о подключении к нему из ОС Windows и Mac.

ПРЕДВАРИТЕЛЬНЫЕ УСЛОВИЯ
Предварительные условия курса:
Нет
Слушатели должны получить следующие практические знания:
Отсутствуют

ПЛАН КУРСА
1. Настройка VPN сервера
1.1 Включение и настройка подключений по протоколу PPTP
1.2 Включение и настройка подключений по протоколу OpenVPN
1.3 Включение и настройка подключений по протоколу L2TP

2. Подключение к VPN-серверу из ОС Windows и Mac
2.1 Подключение к VPN серверу по протоколу PPTP
2.1.1 Подключение в ОС Windows 11
2.1.2 Подключение из ОС Windows 10

2.2 Подключение к VPN серверу по протоколу OpenVPN
2.2.1 Подключение из ОС Windows 7
2.2.2 Подключение из ОС Mac

2.3 Настройка шлюза и маршрутизации для VPN-клиента
2.3.1 Настройки в ОС Windows 7
2.3.2 Настройки в ОС Windows 10

2.3.3 Настройки в ОС Mac

2.4 Connecting to your VPN server via L2TP/Ipsec

2.4.1 Connecting using Windows 7
2.4.2 Connecting using Windows 10
2.4.3 Connecting using a Mac
2.4.4 Connecting using an Android device
2.4.5 Connecting using an iOS device


1. Настройка VPN сервера

В следующем примере рассматривается настройка ASUSTOR NAS в качестве VPN-сервера.
Вначале войдите в систему ADM через веб-браузер, а затем найдите и установите [VPN-сервер] из [API Central].
1.1 Включение и настройка подключений по протоколу PPTP

Шаг 1
Включение службы PPTP: Для включения службы PPTP можно использовать переключатель в [PPTP].

Шаг 2
Добавление нового пользователя: Выберите [Привилегии] [Пользователь] [Добавить]. На следующем рисунке в качестве примера показано добавление учетной записи "vpn". Выберите пользователя для добавления и нажмите на кнопку [Сохранить].


Отметьте флажком [PPTP] и нажмите [Применить]. Теперь учетной записью пользователя "vpn" будут использоваться PPTP подключения.

Шаг 3
Настройка дополнительных параметров: Выберите [Настройки] [PPTP]. Здесь в сможете настроить параметры [Динамический IP-адрес], [Максимальное число клиентов], [Проверка подлинности], [        Макс. MTU], [Макс. MRU] и [DNS сервер]. После изменения нужных параметров нажмите на кнопку [Применить].


If you are using an ASUS router, please manually open port 1723 under port forwarding.
Some other routers might have to do a similar procedure.
From the router configuration interface, select [WAN] > [Virtual Server / Port Forwarding] tab > [Port Forwarding List]. Add a new item to the Port Forwarding list by entering the following information:


Service Name: A name of your choice
Port Range: 1723 ,(You can also add port 47 and select other protocol)
Local IP: Your NAS’s IP address.
Local Port: 1723
Protocol: TCP

Click on the [Add] button after you have entered all the information. Port 1723 should now be opened.

(1) port 1723, protocol TCP (2) port 47, protocol other

1.2 Включение и настройка подключений по протоколу OpenVPN

Шаг 1
Включение службы OpenVPN: Для включения службы OpenVPN можно использовать переключатель в [OpenVPN].


Шаг 2
Добавление нового пользователя: Выберите [Привилегии] → [Пользователь] → [Добавить]. На следующем рисунке в качестве примера показано добавление учетной записи "vpn". Выберите пользователя для добавления и нажмите на кнопку [Сохранить].

Отметьте флажком [OpenVPN] и нажмите [Применить]. Теперь учетной записью пользователя "vpn" будут использоваться PPTP подключения.

 

Шаг 3
Настройка дополнительных параметров: Выберите [Настройки] → [OpenVPN]. Здесь в сможете настроить параметры [Динамический IP-адрес], [Протокол передачи], [Порт], [Максимальное число клиентов], [Контрольная сумма (Сводка)], [Шифрование (Шифр)], [DNS сервер], [Шлюз переадресации] и [Сжатие VPN link]. После изменения нужных параметров нажмите на кнопку [Применить].

Примечание. Нажмите на кнопку [Загрузить файл конфигурации], чтобы загрузить файл конфигурации для клиентов OpenVPN. Для успешного создания OpenVPN подключений потребуется импортировать этот файл в VPN-клиент.
If you are using an ASUS router, please manually open port 1194 under port forwarding.
Some other routers might have to do a similar procedure.
From the router configuration interface, select [WAN] > [Virtual Server / Port Forwarding] tab > [Port Forwarding List]. Add a new item to the Port Forwarding list by entering the following information:


Service Name: A name of your choice
Port Range: 1194 
Local IP: Your NAS’s IP address.
Local Port: 1194
Protocol: UDP

Click on the [Add] button after you have entered all the information. Port 1194 should now be opened.

 


1.3 Enabling and configuring L2TP connections


STEP 1

Enabling L2TP service: Enable L2TP service by using the provided toggle button.

 






STEP 2

Add new users: Select [Privilege] > [User] > [Add]. In this example we add the user “vpn” by selecting its checkbox and then clicking on [Save].

 


 





For the added user, select the [L2TP] checkbox and then click on [Apply]. This will allow the user to use L2TP connections.







STEP 3

Modifying advanced settings: Click on [Settings] >[L2TP]. Here you will be able to configure settings such as the dynamic IP address, max client number, max MTU, DNS server and key. Make sure to click on [Apply] once you are done modifying the settings.

 


If you are using an ASUS router, please manually open port 500,4500,1701 under port forwarding.
Some other routers might have to do a similar procedure.
From the router configuration interface, select [WAN] > [Virtual Server / Port Forwarding] tab > [Port Forwarding List]. Add a new item to the Port Forwarding list by entering the following information:


Service Name: A name of your choice
Port Range:  500,4500,1701
Local IP: Your NAS’s IP address
Local Port: 500,4500,1701
Protocol: UDP

Click on the [Add] button after you have entered all the information. Port 500 should now be opened.



 

2. Подключение к VPN-серверу из ОС Windows и Mac

2.1 Подключение к VPN серверу по протоколу PPTP

2.1.1 Подключение в ОС Windows 11

Шаг 1

Нажмите на значок «Сеть» в правой части панели задач и выберите «Настройки сети и Интернета».

Шаг 2
Выберите VPN.


Шаг 3
Выберите «Добавить VPN»

 

Шаг 4
В разделе «Поставщик VPN» выберите «Windows» (встроенная). Введите имя для этого VPN-соединения и введите либо текущее имя хоста, либо IP-адрес WAN вашего ASUSTOR NAS в поле «Имя или адрес сервера». Выберите PPTP в качестве типа VPN, введите имя пользователя и пароль в соответствующие поля и нажмите «Сохранить».


Шаг 5

Выберите «Дополнительные параметры».


 

Шаг 6

Выберите «Изменить» в дополнительных свойствах VPN.

Шаг 7

Выберите вкладку «Безопасность», включите «Разрешить эти протоколы» и выберите PAP и/или MS-CHAP v2 в качестве протоколов для вашего VPN-сервера. Нажмите ОК, чтобы применить настройки.



Шаг 8
Чтобы подключиться, перейдите в раздел «Сеть и Интернет» и нажмите «VPN». Выберите профиль VPN и нажмите «Подключиться».



2.1.2 Подключение из ОС Windows 10

STEP 1

Click the [Network] icon on the bottom right-hand side of the system tray and select [Network Settings].

 



STEP 2

Select [VPN] from the left panel, and click [Add a VPN connection].

 



STEP 3

Select Windows (built-in) in [VPN Provider] field. Type in the name for this VPN connection and enter the WANl IP address of your ASUSTOR NAS into the [Server name or address] field. Choose PPTP as the [VPN Type], enter the username/password in the appropriate fields, and click [Save].

 

STEP 4

Now you can see that the newly created VPN connection has appeared. To specify the authentication protocol, please click [Change adapter options].

 



Right click on the VPN connection and select [Properties].

 



STEP 5

Select the [Security] tab, check the [Allow these protocols] option, then choose the same protocol (PAP or MS-CHAP v2) as the VPN server on your ASUSTOR NAS. Click [OK] to save the settings.

 



STEP 6

To establish the VPN connection, go to the Windows [NETWORK & INTERNET] > [VPN] page, select an existing VPN profile and click [Connect].

 


 

2.2 Подключение к VPN серверу по протоколу OpenVPN

2.2.1 Подключение в ОС Windows 7

Шаг 1
Загрузите и установите программу OpenVPN с веб-сайта OpenVPN.

Шаг 2
Извлеките файл конфигурации OpenVPN, загруженный с VPN сервера ASUSTOR NAS (см. раздел 3.2).  Откройте файл [asustor.ovpn] , смените WAN IP-адрес VPN сервера и сохраните изменения. На следующем рисунке был изменен WAN IP-адрес VPN сервера на 172.16.2.102.


 

Шаг 3
Скопируйте файлы [asustor.ovpn] и [ca.crt] в папку (C:Program FilesOpenVPNconfig) .

Шаг 4
Откройте [OpenVPN GUI].
В вашей панели задач отображается значок [OpenVPN GUI].  Дважды щелкните его.

Шаг 5
Введите имя пользователя и пароль для VPN сервера ASUSTOR NAS и нажмите на кнопку [OK].

Шаг 6
В случае успешного подключения значок OpenVPN GUI  в вашей панели задач становится зеленым. Вы получаете доступ к ASUSTOR NAS из ОС Windows.

2.2.2 Подключение из ОС Mac

Шаг 1
Загрузите tunnelblick.

Шаг 2
Установите [Tunnelblick].

 

Завершив установку, нажмите на кнопку [Запуск].

 

Шаг 3
Нажмите на кнопку [У меня есть файлы конфигурации].

 

Если вы ранее загрузили файл конфигурации с VPN сервера ASUSTOR NAS, щелкните [Конфигурация OpenVPN].

 

На рабочем столе отображается новая папка [Пустой файл конфигурации Tunnelblick VPN].  Скопируйте файл конфигурации с VPN сервера ASUSTOR NAS в эту папку.

 

Откройте файл [asustor.ovpn] и смените WAN IP-адрес VPN сервера ASUSTOR NAS.

 

После сохранения изменений в файле смените имя папки на "ASUSTORVPN.tblk".

 

Конфигурации Tunnelblick VPN установлены.

 

Шаг 4
В строке меню Mac щелкните значок [Tunnelblick] и выберите [Подключить ASUSTORVPN].

 

Шаг 5
После установления подключения состояние и время подключения отображаются в строке меню, как показано на следующем рисунке.

 

2.3 Настройка шлюза и маршрутизации для VPN-клиента
При использовании VPN-клиента система автоматически выполняет переадресацию основного шлюза вашего VPN сервера. При этом вы не сможете подключиться к Интернету. Поэтому необходимо изменить шлюз VPN и маршрутизацию для подключения к Интернету.
2.3.1 Настройки в ОС Windows 7

Шаг 1
Щелкните правой кнопкой мыши VPN подключение и выберите[Свойства]. Выберите [Internet Protocol Version 4 (TCP/IPv4) (Интернет-протокол TCP/IPv4)] и нажмите на кнопку [Свойства].

 

Шаг 2
Нажмите на кнопку [Дополнительно…].

Шаг 3
Снимите флажок с параметра [Использовать основной шлюз в удаленной сети].

 

2.3.2 Конфигурации из ОС Windows 10

STEP 1

Click the Windows icon on the bottom left-hand side of the taskbar, select [All apps] from the list, and scroll down to find [Windows Powershell]. Click on it to execute the program.

 



STEP 2
Issue the ”Get-VpnConnection” command to list the information of your existing VPN connections.

By default, the value of the SplitTunneling parameter is False, which means all network traffic of this VPN client will be forwarded to the VPN server’s gateway.

 



STEP 3
Issue the Set-VpnConnection -Name “ASUSTOR VPN" -SplitTunneling $True” command to change the value of the SplitTunneling parameter to True.

Note: The “ASUSTOR NAS” string in the example above must be replaced to your own VPN connection name.

 



STEP 4

Issue the Get-VpnConnection command again to verify that the change has been made successfully.

 



2.3.3 Конфигурации из ОС Mac


Шаг 1
Откройте [Терминал] и введите команду "ifconfig-a". Отображается IP-адрес вашего VPN сервера. Следует заметить, что в операционной системе Mac этот шлюз используется только для подключения к VPN серверу, а подключение к Интернету через него не выполняется. Поэтому для ASUSTOR NAS потребуется ввести IP-адрес вручную.

 

Шаг 2
Укажите вместо 10.0.1.6 или 10.0.1.5 WAN IP-адрес ASUSTOR NAS. Выполняя следующие команды, вы сможете подключиться к Интернету.

sudo route add –net 123.51.123.123/16 10.0.1.6

ИЛИ

sudo route add –net 123.51.123.123/16 10.0.1.5

 




2.4 Connecting to your VPN server via L2TP/IPsec

2.4.1 Connecting using Windows 7

If you are using an ASUS router, please manually open port 500,4500,1701 under port forwarding.
Some other routers might have to do a similar procedure.
From the router configuration interface, select [WAN] > [Virtual Server / Port Forwarding] tab > [Port Forwarding List]. Add a new item to the Port Forwarding list by entering the following information:


Service Name: A name of your choice
Port Range:  500,4500,1701
Local IP: Your NAS’s IP address
Local Port: 500,4500,1701
Protocol: UDP

Click on the [Add] button after you have entered all the information. Port 500 should now be opened.








STEP 1
In Windows, go to [Control Panel] > [All Control Panel Items] > [Network and Sharing Center] and then click on [Set up a new connection or network].




STEP 2
Select [Connect to a workplace] then click [Next].





STEP 3
Select [No, create a new connection] and then click [Next].





STEP 4
Select [Use my Internet connection (VPN)]









STEP 5
In the [Internet address:] field enter your ASUSTOR NAS’s WAN IP address or domain address.




STEP 6
Enter your [User name] and [Password] and then click on [Connect]. You will now be able to access the local network resources on your ASUSTOR NAS via Windows.





Note: If you are unable to connect to the VPN Server, please ensure that the [VPN Settings] and [VPN Server] settings are identical.
Using the graphic below as an example, we check that the [Type of VPN] is L2TP/IPSec, that the data encryption method is either PAP or MS-CHAP v2 and that [Allow these protocols] radio button has been selected.


STEP 7
Click on [Start] and run “regedit”.




STEP 8
Navigate to HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesPolicyAgent and then right click and select [New] > [DWORD (32 bit) Value].






STEP 9
For the Value name enter “AssumeUDPEncapsulationContextOnSendRule”and set the Value data to “2” and then click [OK]. Restart your computer.






STEP 10
After restarting your computer, go to [Control Panel] > [Network and Internet] > [Network Connections] to see that your new connection is successful.





2.4.2 Connecting using Windows 10


If you are using an ASUS router, please manually open port 500,4500,1701 under port forwarding.
Some other routers might have to do a similar procedure.
From the router configuration interface, select [WAN] > [Virtual Server / Port Forwarding] tab> [Port Forwarding List]. Add a new item to the Port Forwarding list by entering the following information:


Service Name: A name of your choice
Port Range:  500,4500,1701
Local IP: Your NAS’s IP address
Local Port: 500,4500,1701
Protocol: UDP

Click on the [Add] button after you have entered all the information. Port 500 should now be opened.





STEP 1
Click on the [Network] icon in the system tray and then click on [Open Network and Sharing Center].




STEP 2
Click on [Set up a new connection or network].




STEP 3
Select [Connect to a workplace] then click [Next].





STEP 4
Click on [Use my Internet connection (VPN)].





STEP 5
Enter the Internet address from WAN IP of NAS, Destination name and then select the [Allow other people to use this connection] checkbox. Click on [Create] once you are done.





STEP 6
Click on [Change adapter settings]. Right-click on the VPN connection that you have just created and select [Properties]. Click on the [Security] tab and change the [Type of VPN] to L2TP/IPsec. Click on [Advanced settings], make sure the [Use preshared key for authentication] radio button is selected and then enter your key (Your key can be found from the ADM interface by selecting [VPN Server] > [Settings] > [L2TP]). Click on [OK] once you are done.




STEP 7
Click on [Start] and run “regedit”.





STEP 8
Navigate to HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesPolicyAgent and then right click and select [New] > [DWORD (32 bit) Value].





STEP 9
For the Value name enter “AssumeUDPEncapsulationContextOnSendRule”and set the Value data to “2” and then click [OK]. Restart your computer.



2.4.3 Connecting using a Mac
If you are using an ASUS router, please manually open port 500,4500,1701 under port forwarding.
Some other routers might have to do a similar procedure.
From the router configuration interface, select [WAN] > [Virtual Server / Port Forwarding] tab > [Port Forwarding List]. Add a new item to the Port Forwarding list by entering the following information:


Service Name: A name of your choice
Port Range:  500,4500,1701
Local IP: Your NAS’s IP address
Local Port: 500,4500,1701
Protocol: UDP

Click on the [Add] button after you have entered all the information. Port 500 should now be opened.






STEP 1
Click on the [Apple] icon and then select [System Preferences…].




STEP 2
Click on [Network].




STEP 3
Click on the + button, select [VPN] for “Interface:”, [L2TP Over IpSec] for “VPN Type”, enter a Service Name and then click on [Create].








STEP 4
Enter your [Server Address (Your NAS WANIP like here:123.51.123.123)] and [Account Name]. Click on [Authentication Settings…] and enter the User Account Password and Shared Secret (The Shared Secret is the key that can be found from the ADM interface by selecting [VPN Server] > [Settings] >[L2TP]).


Click [OK] and then click on [Connect].





STEP 5
Enter the VPN Server account name and password and then click on [OK].





STEP 6
After successfully connecting, you will be able to access the resources on your ASUSTOR NAS local network. If you wish to disconnect the VPN connection, you can click on the [Disconnect] button.






2.4.4 Connecting using an Android device

STEP 1
Select [Settings]>[More] > [VPN].









STEP 2
Click on [Add VPN profile], enter a name of your choice, select [L2TP/IPSEC PSK] for “Type” and enter your NAS’s IP address or URL into the [Server Address] field. Choose an encryption method and then select [Save] to complete configurations.





STEP 3
Select the created VPN profile. After entering the username and password, select [Connect] to create the VPN connection.

After creating the connection, selecting the profile again will allow you to view the associated information for the connection.



2.4.5 Connecting using an iOS device

The configurations in the following example were done using an iPhone 6.

STEP 1
In iOS, select [Settings] >[General] > [VPN].


STEP 2
Select [Add a VPN configuration…] and then enter the following information:
Type: L2TP
Description: A description of your choice
Server: Your NAS’s WAN IP address or URL
Account: Your account name
Password: The password for the account
Secret: They key that can be found in ADM interface by selecting [VPN Server]> [Settings]>[L2TP]

Once you have finished entering the information select [Done].




STEP 3
After completing the VPN profile you can select the status toggle to activate the VPN connection.

 

Была ли эта статья полезной? Да / Нет