Nous utilisons des cookies pour améliorer notre page Web. Veuillez lire notre politique relative aux cookies .

NAS 323

Utiliser votre NAS comme serveur VPN

Apprenez à utiliser votre NAS ASUSTOR comme serveur VPN et à vous y connecter depuis Windows et Mac.

2021-10-27

OBJECTIFS DU COURS

À la fin de ce cours, vous pourrez :
1. Utiliser votre NAS ASUSTOR comme serveur VPN et vous y connecter avec Windows et Mac.

PRÉ-REQUIS

Prérequis du cours :
Aucun

Les étudiants doivent avoir une connaissance pratique de :
N/A

CONTENU
1. Configurer votre serveur VPN
1.1 Activer et configurer les connexions PPTP
1.2 Activer et configurer les connexions OpenVPN
1.3 Enabling and configuring L2TP connections

2. Se connecter > votre serveur VPN avec Windows et Mac
2.1 Connexion > votre serveur VPN via PPTP
2.1.1 Connexion en utilisant Windows 7
2.1.2 Connexion avec un Windows 10

2.2 Connexion > votre serveur VPN via OpenVPN
2.2.1 Connexion avec Windows 7
2.2.2 Connexion avec un Mac

2.3 Configurer la passerelle et l'acheminement pour le client VPN
2.3.1 Configurations en utilisant Windows 7
2.3.2 Configurations en utilisgant un Windows 10

2.3.3 Configurations en utilisgant un 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. Configurer votre serveur VPN

Dans l'exemple suivant, nous allons configurer le serveur VPN du NAS ASUSTOR.

Avant de commencer, connectez-vous > ADM depuis votre navigateur Web, puis recherchez et installez [VPN Server] sur l'[App Central].

1.1 Activer et configurer les connexions PPTP

ETAPE 1

Activer le service PPTP : Vous pouvez utiliser le curseur sous [PPTP] pour activer le service PPTP.


ETAPE 2

Ajouter un nouvel utilisateur : Sélectionnez [Privilèges] → [Utilisateur] → [Ajouter]. Dans le graphique ci-dessous, nous avons choisi d'ajouter le compte « vpn » comme exemple. Après avoir choisi l'utilisateur que vous souhaitez ajouter, cliquez sur [Enregistrer].

Cochez la case [PPTP] puis cliquez sur [Appliquer]. Le compte utilisateur « vpn » peut alors utiliser les connexions PPTP.





ETAPE 3

Configurer les paramètres avancés : Sélectionnez [Réglages] → [PPTP]. Ici, vous pourrez configurer les paramètres pour [Adresse IP dynamique], [Nombre max. de clients], [Authentification], [MTU max.], [MRU max.] et [Serveur NAS]. Veillez > cliquer sur [Appliquer] après avoir modifié les paramètres.


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
Activer et configurer les connexions OpenVPN

ETAPE 1

Activer le service OpenVPN : Vous pouvez utiliser le curseur sous [OpenVPN] pour activer le service OpenVPN.


ETAPE 2

Ajouter un nouvel utilisateur : Sélectionnez [Privilèges] → [Utilisateur] → [Ajouter]. Dans le graphique ci-dessous, nous avons choisi d'ajouter le compte « vpn » comme exemple. Après avoir choisi l'utilisateur que vous souhaitez ajouter, cliquez sur [Enregistrer].


Cochez la case [OpenVPN] puis cliquez sur [Appliquer]. Le compte utilisateur « vpn » peut alors utiliser les connexions PPTP.


ETAPE 3

Configurer les paramètres avancés : Sélectionnez [Réglages] → [OpenVPN]. Ici vous pourrez configurer les paramètres pour [Adresse IP dynamique], [Protocole de transmission], [Port], [Nombre max. de clients], [Checksum], [Cryptage (chiffrement)], [Serveur DNS], [Passerelle de redirection] et [Compression liaison VPN]. Veillez > cliquer sur [Appliquer] après avoir modifié les paramètres.


Remarque : Cliquez sur le bouton [Télécharger le fichier de configuration] pour télécharger le fichier de configuration pour les clients OpenVPN. Vous devez importer ce fichier sur votre client VPN afin de pouvoir créer des connexions OpenVPN.

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. Se connecter > votre serveur VPN avec Windows et Mac

2.1 Connexion > votre serveur VPN via PPTP

2.1.1 Connexion en utilisant Windows 7

ETAPE 1

Sélectionnez [Panneau de configuration] → [Tous les éléments du panneau de configuration] → [Réseau et centre de partage] → [Configurer une nouvelle connexion ou un nouveau réseau].


ETAPE 2

Sélectionnez [Se connecter > un espace de travail] → [Suivant].


ETAPE 3

Sélectionnez [Non, créer une nouvelle connexion] → [Suivant].


ETAPE 4

Sélectionnez [Utiliser ma connexion Internet (VPN)].


ETAPE 5

Saisissez l'adresse WAN IP de votre NAS ASUSTOR dans le champ [Adresse Internet] puis cliquez sur [Suivant].



ETAPE 6

Saisissez un nom d'utilisateur et un mot de passe dans les champs appropriés puis cliquez sur [Se connecter]. Vous pouvez maintenant accéder > votre NAS ASUSTOR via Windows.


Remarque : Si vous n'arrivez pas > vous connecter > votre serveur VPN, assurez-vous que vos paramètres VPN sont identiques aux paramètres de votre serveur VPN.

Par exemple, dans le graphique ci-dessous, nous vérifions que le [Type de VPN] est Point to Point Tunneling Protocol (PPTP), que la méthode de [Cryptage de données] est PAP ou MS-CHAP v2, et que ces protocoles sont autorisés avec le bouton radio [Autoriser ces protocoles].


2.1.2 Connexion avec un 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 Connexion > votre serveur VPN via OpenVPN

2.2.1 Connexion en utilisant Windows 7

ETAPE 1

Téléchargez et installez le programme OpenVPN depuis le site Web OpenVPN.


ETAPE 2

Décompressez le fichier de configuration OpenVPN que vous avez téléchargé depuis le serveur VPN de votre NAS ASUSTOR (voir section 3.2). Ouvrez le fichier [asustor.ovpn] , modifiez l'adresse WAN IP du serveur VPN puis enregistrez les modifications. Dans le graphique ci-dessous, nous avons modifié l'adresse WAN IP du serveur VPN en 172.16.2.102.


 


ETAPE 3

Copiez les fichiers [asustor.ovpn] et [ca.crt] vers le dossier (C:\Program Files\OpenVPN\config\) .


ETAPE 4

Ouvrez [OpenVPN GUI].

Vous devriez maintenant voir l'icône [OpenVPN GUI] dans votre barre système. Double-cliquez dessus.


ETAPE 5

Saisissez le nom d'utilisateur et le mot de passe du serveur VPN de votre NAS ASUSTOR, puis cliquez sur [OK].


ETAPE 6

Après vous être connecté, vous devriez voir que l'icône OpenVPN GUI de votre barre système est devenue verte. Vous pouvez maintenant accéder > votre NAS ASUSTOR avec Windows.


2.2.2 Connexion avec un Mac

ETAPE 1

Téléchargez tunnelblick.


ETAPE 2

Installez [Tunnelblick].


Après installation, cliquez sur [Lancer].


ETAPE 3

Cliquez sur [Je dispose des fichiers de configuration].


Si vous avez déj > téléchargé le fichier de configuration depuis le serveur VPN de votre NAS ASUSTOR, cliquez sur [Configuration(s) OpenVPN].


Vous devriez maintenant pouvoir voir le nouveau dossier [Configuration VPN Tunnelblick vide] sur votre bureau. Copiez le fichier de configuration du serveur VPN de votre NAS ASUSTOR vers ce dossier.


Ouvrez le fichier [asustor.ovpn] puis modifiez l'adresse WAN IP du serveur VPN de votre NAS ASUSTOR.


Après avoir enregistré les modifications dans le fichier, modifiez le nom du dossier en « ASUSTORVPN.tblk ».


Les configurations VPN Tunnelblick devraient maintenant être installées correctement.


ETAPE 4

Cliquez sur l'icône [Tunnelblick] dans la barre de menus Mac, puis sélectionnez [Se connecter > ASUSTORVPN].


ETAPE 5

Une fois la connexion établie, vous pourrez voir l'état de connexion et la durée dans la barre de menu, comme présenté dans le graphique ci-dessous.


2.3 Configurer la passerelle et l'acheminement pour le client VPN

Lorsque vous utilisez un client VPN, le système redirige automatiquement la passerelle par défaut de votre serveur VPN. Dans ce cas, vous ne pouvez pas vous connecter > Internet. De ce fait, nous devons modifier la passerelle VPN et l'acheminement pour établir une connexion > Internet.

2.3.1 Configurations en utilisant Windows 7

ETAPE 1

Faites un clic droit sur votre connexion VPN, puis sélectionnez [Propriétés]. Sélectionnez [Internet Protocol Version 4 (TCP/IPv4)] puis cliquez sur [Propriétés].

ETAPE 2

Cliquez sur [Avancé...].


ETAPE 3

Décochez la case [Utiliser la passerelle par défaut sur le réseau distant].




2.3.2 Configurations avec un 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 Configurations avec un Mac

ETAPE 1

Ouvrez [Terminal] puis saisissez la commande « ifconfig-a ». Vous pourrez alors voir alors l'adresse IP de votre serveur VPN. Notez que le système d'exploitation Mac ne propose cette passerelle que pour la connexion > un serveur VPN et ne peut pas se connecter > Internet. De ce fait, nous devons saisir manuellement l'adresse IP du NAS ASUSTOR.

ETAPE 2

Remplacez 10.0.1.6 ou 10.0.1.5 par l'adresse WAN IP du NAS ASUSTOR. Exécuter les commandes ci-dessous vous permettra de vous connecter > Internet.

sudo route add –net 123.51.123.123/16 10.0.1.6

OU

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_MACHINE\SYSTEM\CurrentControlSet\Services\PolicyAgent 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_MACHINE\SYSTEM\CurrentControlSet\Services\PolicyAgent 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.

 

Est-ce que cet article a été utile ? Oui / Non